as_coda | R Documentation |
Extracts parallel chains from an MCMC
object to create an
mcmc.list
object for use with coda diagnostic tools.
as_coda(from, ...)
## S4 method for signature 'MCMC'
as_coda(from, chains = 1)
from |
from An object to be coerced. |
... |
Currently not used. |
chains |
An |
An coda::mcmc.list
object.
A. Philippe, M.-A. Vibet
coda::mcmc()
, coda::mcmc.list()
Other read methods:
as_events()
,
as_phases()
,
check
,
read_bcal()
,
read_chronomodel
,
read_oxcal()
if (requireNamespace("coda", quietly = TRUE)) {
## Load coda
library(coda)
## Coerce to MCMC
eve <- as_events(mcmc_events, calendar = CE(), iteration = 1)
## Coerce to coda
mc <- as_coda(eve[, 1:2], chains = 3)
plot(mc)
## Autocorrelation
autocorr.plot(mc)
## Gelman-Rubin diagnostic
## The multivariate criterion can not be evaluated when a phase
## contains only one date. This induces colinearity problems.
gelman.diag(mc)
gelman.plot(mc)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.