postTable: Posterior distribution summary.

View source: R/MCMCaccessories.R

postTableR Documentation

Posterior distribution summary.

Description

Reports a table containing the mode, mean, and highest posterior density of the marginal posterior distribution.

Usage

postTable(mcpost, ind = NULL, sigdig = 3, ...)

Arguments

mcpost

Object of class mcmc containing marginal posterior distributions.

ind

Column indices for the subset of mcpost for which the summary statistics are to be returned.

sigdig

Integer value for the number of significant digits to report.

...

Additional arguments.

Value

A character matrix of two rows and ncol(mcpost) columns (length(ind) when ind is not NULL). The first row contains component names from mcpost. The second row contains a a string representing the posterior mode then posterior mean, separated by a comma, followed by the lower and upper limits of the highest posterior density, enclosed in parentheses.

Author(s)

matthewwolak@gmail.com

See Also

Other MCMC posterior distribution helper functions: plot2mcmc(), postPlot()

Examples

# Simulate two example MCMC chains:
## Both are standard normal distributions of only positive values
## However, one is on the boundary (near zero) while the other is not
normMCMC <- coda::mcmc(matrix(c(abs(rnorm(1000, 0.2, 1)), rnorm(1000, 10, 1)),
ncol = 2))
postTable(normMCMC)

matthewwolak/wolakR documentation built on May 10, 2023, 1:27 p.m.