Learn R Programming

RBaM (version 1.1.1)

tracePlot: MCMC reporting

Description

2DO (adapt from STooDs): Generate pdf report files summarizing mcmc samples

Usage

tracePlot(sim, ylab = "values", keep = NULL, col = "black", psize = 0.5)

Value

A ggplot (or a list thereof if several columns in sim)

Arguments

sim

vector or matrix or data frame, MCMC simulations

ylab

Character, label of y-axis to be used if sim has no names

keep

Integer vector, indices of samples to be kept in cooked MCMC sample

col

Color

psize

Numeric, point size

Details

tracePlot

returns a trace plot ggplot (or a list thereof if several columns in sim)

Examples

Run this code
# Create Monte Carlo samples
n=1000
sim=data.frame(p1=rnorm(n),p2=rlnorm(n),p3=runif(n))
# create trace plot for each component
figures=tracePlot(sim)

Run the code above in your browser using DataLab