Skip to content

Commit 033bfc9

Browse files
Merge pull request #260 from TahminaMojumder/functionCollectionClass
Function collection class
2 parents b11dbb9 + 4e2c472 commit 033bfc9

12 files changed

Lines changed: 21 additions & 36 deletions

BayesianTools/R/blockUpdate.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
#' Determine the groups of correlated parameters
23
#' @author Stefan Paul
34
#' @param chain MCMC chain including only the parameters (not logP, ll, logP)

BayesianTools/R/classBayesianOutput.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# NOTE: The functions in this class are just templates that are to be implemented for all subclasses of BayesianOutput. They are not functional.
22

3+
34
#' Extracts the sample from a bayesianOutput
45
#' @author Florian Hartig
56
#' @param sampler an object of class mcmcSampler, mcmcSamplerList, smcSampler, smcSamplerList, mcmc, mcmc.list, double, numeric

BayesianTools/R/classLikelihood.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
#' Creates a standardized likelihood class#'
23
#' @author Florian Hartig
34
#' @param likelihood log likelihood density
@@ -106,6 +107,7 @@ createLikelihood <- function(likelihood, names = NULL, parallel = F, catchDuplic
106107

107108
#library(mvtnorm)
108109
#library(sparseMVN)
110+
109111
#' Normal / Gaussian Likelihood function
110112
#' @author Florian Hartig
111113
#' @param predicted vector of predicted values
@@ -136,9 +138,9 @@ likelihoodAR1 <- function(predicted, observed, sd, a){
136138
n = length(observed)
137139

138140
res = predicted - observed
139-
141+
140142
# this calculates the unconditional LL for this data, see e.g. http://stat.unicas.it/downloadStatUnicas/seminari/2008/Julliard0708_1.pdf
141-
143+
142144
ll = 0.5 * ( - n * log(2*pi)
143145
- n * log(sd^2)
144146
+ log( 1- a^2 )

BayesianTools/R/classMcmcSamplerList.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ createMcmcSamplerList <- function(mcmcList){
1212
return(mcmcList)
1313
}
1414

15-
1615
#' @author Stefan Paul
1716
#' @method summary mcmcSamplerList
1817
#' @export

BayesianTools/R/classPrior.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ createPriorDensity <- function(sampler, method = "multivariate", eps = 1e-10, lo
261261

262262
#' @author Maximilian Pichler
263263
#' @export
264-
265264
print.prior <- function(x, ...){
266265
cat('Prior: \n\n')
267266

BayesianTools/R/classSMCSamplerList.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
#' Convenience function to create an object of class SMCSamplerList from a list of mcmc samplers
23
#' @author Florian Hartig
34
#' @param ... a list of MCMC samplers
@@ -35,7 +36,6 @@ plot.smcSamplerList <- function(x, ...){
3536
marginalPlot(x, ...)
3637
}
3738

38-
3939
#' @export
4040
getSample.smcSamplerList <- function(sampler, parametersOnly = T, coda = F, start = 1, end = NULL, thin = 1,
4141
numSamples = NULL, whichParameters = NULL, reportDiagnostics = FALSE, ...){

BayesianTools/R/codaFunctions.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,4 @@ convertCoda <- function(sampler, names = NULL, info = NULL, likelihood = NULL){
104104
}else stop("sampler must be of class 'coda::mcmc' or 'coda::mcmc.list'")
105105
}
106106
return(out)
107-
}
108-
107+
}

BayesianTools/man/combineChains.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BayesianTools/man/convertCoda.Rd

Lines changed: 1 addition & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BayesianTools/man/createBayesianSetup.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)