chainsSummary: Compare summary statistics from multiple MCMC chains

Description Usage Arguments Examples

View source: R/plots.R

Description

Plots median and 95

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
chainsSummary(
  samplesList,
  var = NULL,
  nrows = NULL,
  scale = FALSE,
  width = 7,
  height = NULL,
  legend = !is.null(names(samplesList)),
  legend.location = "topright",
  jitter,
  buffer = NULL,
  buffer.right = NULL,
  buffer.left = NULL,
  cex = 1,
  file = NULL
)

Arguments

samplesList

List of arrays of MCMC samples from different chains

var

Parameter names to plot

nrows

Number of rows in the resulting plot

scale

Logical, whether to normalize each posterior chain

width

Width of figure

height

Height of figure

legend

Logical, whether to include a legend of chain names

legend.location

Legend location

jitter

Scale factor for spreading out lines from each chain

buffer

Buffer margin on both sides. Overrides buffer.right and buffer.left

buffer.right

Additional buffer on left side of plot

buffer.left

Additional buffer on right side of plot

cex

Expansion coefficient for text

file

Filename for saving figure to a file

Examples

1
2
3
4
5
6
samples1 <- cbind(rnorm(1000, 1), rgamma(1000, 1), rpois(1000, 1))
colnames(samples1) <- c('alpha', 'beta', 'gamma')
samples2 <- cbind(rnorm(1000, 2), rgamma(1000, 2), rpois(1000, 2))
colnames(samples2) <- c('alpha', 'beta', 'gamma')
samplesList <- list(chain1 = samples1, chain2 = samples2)
chainsSummary(samplesList, nrow = 1, jitter = .3, buffer.left = .5, buffer.right = .5)

basicMCMCplots documentation built on Nov. 5, 2021, 1:08 a.m.