Learn R Programming

ValidationExplorer (version 0.1.1)

mcmc_sum: MCMC_sum: A custom function for summarizing MCMC posterior sampling

Description

MCMC_sum: A custom function for summarizing MCMC posterior sampling

Usage

mcmc_sum(out, thin = 1, truth)

Value

A dataframe object summarizing the MCMC draws, including diagnostics, quantiles and posterior means.

Arguments

out

Draws from a model fit using a probabilistic programming language (e.g., Stan, NIMBLE or JAGS). The expected format of this input is a list, where each entry is a Markov chain.

thin

An optional thinning interval.

truth

A vector with the true parameter values organized alphanumerically by parameter value (e.g., lambda\[1\], lambda\[2\], psi\[1\], psi\[2\], theta\[1,1\], theta\[1,2\], theta\[2,1\], theta\[2,2\])

Examples

Run this code

# An example fit of one dataset
draws <- ValExp_example_fit

# The data generating values
truth <- c(11,2,0.3, 0.6, 0.9, 0.15, 0.10, 0.85)

mcmc_sum(draws, truth = truth)

Run the code above in your browser using DataLab