Package: BayesianTools Check: examples New result: ERROR Running examples in ‘BayesianTools-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: bridgesample > ### Title: Calculates the marginal likelihood of a chain via bridge > ### sampling > ### Aliases: bridgesample > ### Keywords: internal > > ### ** Examples > > means <- c(0, 1, 2) > sds <- c(1, 0.6, 3) > > # log-likelihood > ll <- function (x) { + return(sum(dnorm(x, mean = means, sd = sds, log = TRUE))) + } > > # lower and upper bounds for prior > lb <- rep(-10, 3) > ub <- rep(10, 3) > > # create setup and run MCMC > setup <- createBayesianSetup(likelihood = ll, + lower = lb, + upper = ub) > > out <- runMCMC(bayesianSetup = setup, + settings = list(iterations = 1000), + sampler = "DEzs") Running DEzs-MCMC, chain 1 iteration 300 of 1002 . Current logp -13.45132 -14.0386 -12.89206 . Please wait! Running DEzs-MCMC, chain 1 iteration 600 of 1002 . Current logp -14.01405 -13.97087 -14.01756 . Please wait! Running DEzs-MCMC, chain 1 iteration 900 of 1002 . Current logp -13.0555 -13.32697 -12.47774 . Please wait! Running DEzs-MCMC, chain 1 iteration 1002 of 1002 . Current logp -13.8484 -14.97426 -13.62142 . Please wait! runMCMC terminated after 0.0979999999999999seconds > > # sample from MCMC output with "burn-in" of 25% > sample <- getSample(out$chain, start = 250, numSamples = 500) > > # use bridge sampling to get marginal likelihood > bs_result <- bridgesample(chain = sample, + nParams = out$setup$numPars, + lower = lb, + upper = ub, + posterior = out$setup$posterior$density) Iteration: 1 Error in loadNamespace(x) : there is no package called ‘posterior’ Calls: bridgesample ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart Execution halted