samplesPlot {basicMCMCplots}R Documentation

Plot MCMC traceplots and density plots

Description

Plot MCMC traceplots and density plots

Usage

samplesPlot(
  samples,
  var = colnames(samples),
  ind = NULL,
  burnin = NULL,
  scale = FALSE,
  line = NULL,
  width = 7,
  height = 4,
  legend = TRUE,
  legend.location = "topright",
  traceplot = TRUE,
  densityplot = TRUE,
  file = NULL
)

Arguments

samples

Array of MCMC samples, or a list of samples from multiple chains in which case the first chain is used

var

Parameter names to plot

ind

Indices of MCMC samples to plot

burnin

Number of initial MCMC samples to discard (default: 0)

scale

Logical, whether to normalize each posterior chain

line

Numeric vector of true parameter values for adding lines to plots

width

Width of the plot

height

Height of the plot

legend

Logical, whether to include a legend of parameter names

legend.location

Location of legend

traceplot

Logical, whether to include traceplots (default: TRUE)

densityplot

Logaical, whether to include density plots (default: TRUE)

file

Optional filename to save figure as a file

Examples

samples <- cbind(rnorm(1000), rgamma(1000, 1))
colnames(samples) <- c('alpha', 'beta')
samplesPlot(samples)


[Package basicMCMCplots version 0.2.7 Index]