Learn R Programming

mcmcsae (version 0.6.0)

acceptance_rates: Return Metropolis-Hastings acceptance rates

Description

Return Metropolis-Hastings acceptance rates

Usage

acceptance_rates(object, aggregate.chains = FALSE)

Arguments

object

a draws object, i.e. the output of function MCMCsim.

aggregate.chains

whether to return averages over chains or results per chain.

Value

A list of acceptance rates.

Examples

Run this code
# NOT RUN {
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)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab