Learn R Programming

mcmcsae (version 0.6.0)

posterior-moments: Get means or standard deviations of parameters from the MCMC output in a draws object

Description

Get means or standard deviations of parameters from the MCMC output in a draws object

Usage

get_means(draws, vnames = NULL)

get_sds(draws, vnames = NULL)

Arguments

draws

an object of class draws.

vnames

optional character vector to select a subset of parameters.

Value

A list with simulation means or standard deviations.

Examples

Run this code
# NOT RUN {
ex <- mcmcsae_example(n=50)
sampler <- create_sampler(ex$model, data=ex$dat)
sim <- MCMCsim(sampler, burnin=100, n.iter=300, thin=2, n.chain=4)
get_means(sim)
get_means(sim, "e_")
sim <- MCMCsim(sampler, burnin=100, n.iter=300, thin=2, n.chain=4,
  store.mean=c("beta", "u"), store.sds=TRUE)
summary(sim, "beta")
get_means(sim, "beta")
get_sds(sim, "beta")
get_means(sim, "u")
get_sds(sim, "u")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab