plot2mcmc: Two MCMC chain plot.

View source: R/MCMCaccessories.R

plot2mcmcR Documentation

Two MCMC chain plot.

Description

Pretty plot of two MCMC chains side-by-side.

Usage

plot2mcmc(x1, x2 = NULL, smooth = FALSE, bwf, save = FALSE, ...)

Arguments

x1

Object of class mcmc containing MCMC chain(s).

x2

Optional object of class mcmc containing a second set of MCMC chain(s).

smooth

Logical. See traceplot for details.#FIXME

bwf

Character indicating function to calculate the bandwith. See traceplot for details.#TODO correspond with 'postPlot()'

save

Either a logical or character value. When FALSE (default) plots are not saved to the hard drive. If TRUE, the plots are saved as a pdf with a default filename to the current working directory. If a character is specified, this will be used as the base filename to save the plots as pdfs in the current working directory.

...

Additional arguments passed to densplot and traceplot.#FIXME update densplot and traceplot to own functions

Value

Nothing returned invisibly at the moment (assign to keep):#FIXME

Warning

The function attempts to match parameters by the column names, but may have trouble where vastly different objects are in each of the two MCMC objects.

Author(s)

matthewwolak@gmail.com

See Also

postPlot and densplot

Other MCMC posterior distribution helper functions: postPlot(), postTable()

Examples

# Simulate two sets of two example MCMC chains:
## Both are standard normal distributions of only positive values
## However, one is on the boundary (near zero) while the other is not
normMCMC <- coda::mcmc(matrix(c(abs(rnorm(1000, 0.2, 1)), rnorm(1000, 10, 1)),
ncol = 2))
normMCMC2 <- coda::mcmc(matrix(c(abs(rnorm(1000, 0.2, 1)), rnorm(1000, 10, 1)),
ncol = 2))
plot2mcmc(normMCMC, normMCMC2)

matthewwolak/wolakR documentation built on May 10, 2023, 1:27 p.m.