Calculate posterior volume
getVolume(sampler, prior = F, method = "MVN", ...)
sampler | an object of superclass bayesianOutput or any other class that has the getSample function implemented (e.g. Matrix) |
---|---|
prior | schould also prior volume be calculated |
method | method for volume estimation. Currently, the only option is "MVN" |
... | additional parameters to pass on to the |
The idea of this function is to provide an estimate of the "posterior volume", i.e. how "broad" the posterior is. One potential application is to the overall reduction of parametric uncertainty between different data types, or between prior and posterior.
Implemented methods for volume estimation:
Option "MVN" - in this option, the volume is calculated as the determinant of the covariance matrix of the prior / posterior sample.
bayesianSetup = createBayesianSetup( likelihood = generateTestDensityMultiNormal(sigma = "no correlation"), lower = rep(-10, 3), upper = rep(10, 3)) out <- runMCMC(bayesianSetup = bayesianSetup, sampler = "Metropolis", settings = list(iterations = 2000, message = FALSE)) getVolume(out, prior = TRUE)#> $priorVol #> [1] 38943.63 #> #> $postVol #> [1] 1.035675 #>bayesianSetup = createBayesianSetup( likelihood = generateTestDensityMultiNormal(sigma = "strongcorrelation"), lower = rep(-10, 3), upper = rep(10, 3)) out <- runMCMC(bayesianSetup = bayesianSetup, sampler = "Metropolis", settings = list(iterations = 2000, message = FALSE)) getVolume(out, prior = TRUE)#> $priorVol #> [1] 38388.73 #> #> $postVol #> [1] 2.82539e-06 #>