acceptance_rates | R Documentation |
Return Metropolis-Hastings acceptance rates
acceptance_rates(obj, aggregate.chains = FALSE)
obj |
an mcdraws object, i.e. the output of function |
aggregate.chains |
whether to return averages over chains or results per chain. |
A list of acceptance rates.
ex <- mcmcsae_example()
# specify a model that requires MH sampling (in this case for a modeled
# degrees of freedom parameter in the variance part of the model)
sampler <- create_sampler(ex$model, data=ex$dat, formula.V=~vfac(factor="fA",
prior=pr_invchisq(df="modeled")))
sim <- MCMCsim(sampler, burnin=100, n.iter=300, thin=2, n.chain=4, store.all=TRUE)
(summary(sim))
acceptance_rates(sim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.