plot2mcmc: Two MCMC chain plot.

Description Usage Arguments Value Warning Author(s) See Also Examples

View source: R/MCMCaccessories.R

Description

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

Usage

1
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)

[email protected]

See Also

postPlot and densplot

Other MCMC posterior distribution helper functions: postPlot, postTable

Examples

1
2
3
4
5
6
7
8
# 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 Feb. 25, 2018, 9:38 a.m.