post_dim: Obtain MCMC dimensions from an mcmc.list

Description Usage Arguments Value Note Examples

View source: R/post_dim.R

Description

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

Usage

1
post_dim(post, types = NULL)

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.

Value

A numeric vector with named elements, which may contain:

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

Note

If the post object was thinned after MCMC completed using post_thin(), then the "burn" and "thin" dimensions will be improperly calculated. post_thin() performs post-MCMC thinning of mcmc.list objects, and is solely for developing long-running post-processing code, so this is okay.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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"))

postpack documentation built on June 3, 2021, 1:07 a.m.