View source: R/MCMCaccessories.R
plot2mcmc | R Documentation |
Pretty plot of two MCMC chains side-by-side.
plot2mcmc(x1, x2 = NULL, smooth = FALSE, bwf, save = FALSE, ...)
x1 |
Object of class |
x2 |
Optional object of class |
smooth |
Logical. See |
bwf |
Character indicating function to calculate the bandwith. See
|
save |
Either a logical or character value. When |
... |
Additional arguments passed to |
Nothing returned invisibly at the moment (assign to keep):#FIXME
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.
postPlot
and densplot
Other MCMC posterior distribution helper functions:
postPlot()
,
postTable()
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.