post_bind: Combine two objects containing posterior samples

Description Usage Arguments Details Value Examples

View source: R/post_bind.R

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

1
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

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

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