post_bind {postpack}R Documentation

Combine two objects containing posterior samples

Description

Intended for use when derived quantities are calculated from monitored posterior samples, and you wish to combine them into the master mcmc.list, as though they were calculated and monitored during MCMC sampling. It is not advised to combine samples from two MCMC runs, because covariance of MCMC sampling would be lost.

Usage

post_bind(post1, post2, dup_id = "_p2")

Arguments

post1

A mcmc.list or matrix object.

post2

A mcmc.list or matrix object.

dup_id

If any node names are duplicated in post2, what should be appended to the end of these node names in the output? If this occurs a warning will be returned. Defaults to "_p2"

Details

Some important things to note:

Value

A single mcmc.list object containing samples of the nodes from both post1 and post2.

Examples

# load example mcmc.list
data(cjs)

# create two subsets from cjs: one as mcmc.list and one as matrix
# also works if both are mcmc.list objects
p1 = post_subset(cjs, "b0")
p2 = post_subset(cjs, "b1", matrix = TRUE)

# combine them into one mcmc.list
head(post_bind(p1, p2))

[Package postpack version 0.5.4 Index]