Learn R Programming

postpack (version 0.5.4)

post_dim: Obtain MCMC dimensions from an mcmc.list

Description

Quickly query the number of burn-in samples, post-burnin, thinning, number of chains, etc. from a mcmc.list object.

Usage

post_dim(post, types = NULL)

Value

A numeric vector with named elements, which may contain:

  • burn: The burn-in period + adapting phase (per chain).

  • post_burn: The post-burn-in period (per chain).

  • thin: The thinning interval post-burn-in.

  • chains: The number of chains.

  • saved: The number of saved samples across all chains.

  • params: The number of nodes with MCMC samples.

All of these will be returned if types = NULL, a subset can be returned by specifying (for example) types = c("burn", "thin").

Arguments

post

A mcmc.list object.

types

The dimension types to return. Must contain some of "burn", "post_burn", "thin", "chains", "nodes". Defaults to NULL, in which case all of these are returned.

Examples

Run this code
# load example mcmc.list
data(cjs)

# get all relevant dimensions
post_dim(cjs)

# get only the number of chains
post_dim(cjs, "chains")

# get the thinning and burn-in intervals
post_dim(cjs, c("burn", "thin"))

Run the code above in your browser using DataLab