mergeChains: Merge chains of MCMC run from 'micore' object

Description Usage Arguments Value Examples

View source: R/methods.R

Description

Merge chains of MCMC run from micore object

Usage

1
mergeChains(obj, par = c("A", "B", "Psi", "eta", "gamma", "Gamma"))

Arguments

obj

An object of class micore

par

Character object specifying which parameter to merge chains for.

Value

An array with the merged MCMC samples from the specified parameter. The first dimension of the array is the MCMC iteration.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
n <- 50
p <- 5
X <- cbind(1, rnorm(n))
counts <- matrix(0, n, p+1)
for (i in 1:n) {
  counts[i,] <- rmultinom(1, size=100, prob=rep(1,p+1))
}

library(micore)
mc.fit <- micore(counts, X, n.samp=100, n.burn=100, n.chain=2)

Amerge <- mergeChains(mc.fit, par="B")

kevinmcgregor/micore documentation built on June 9, 2021, 10:29 p.m.