my.traceplot: Custom traceplot with thinning and burn-in

Description Usage Arguments See Also Examples

View source: R/my.traceplot.R

Description

Function to plot a single parameter from a single chain of an MCMC. The burn-in period will be included by shaded red. Additional chains can be added to the same plot using the add.chain() function

Usage

1
my.traceplot(trace.vec, label = NULL, thin = 0, burn = 0, col = "black")

Arguments

trace.vec

Vector containing draws from the MCMC sampler

label

Parameter label and title for the plot. Default is no label.

thin

Amount of thinning applied to the plot. For example, if thin=3, then every third sample point will be plotted. The total number of iterations should be divisible by the thinning amount.

burn

Number of iterations for burn-in.

col

Color of trace line. Defaults to black.

See Also

add.chain

Examples

1
2
3
## Draw a traceplot for a random sample
my.samples = rnorm(10000, 5, 10)
my.traceplot(my.samples,label="Some title",thin=5,burn=1000,col="blue")

lcomm/ltools documentation built on May 20, 2019, 11:28 p.m.