Description Usage Arguments Value Author(s) See Also Examples
coda_diag
creates a graphic that includes three diagnostic plots
to help monitor convergence of an MCMC chain for a parameter. By default
the function will loop through all parameters in an mcmc.list object and
create a single graphic of three diagnostic plots for each parameter.
1 |
coda.object |
an mcmc.list object |
parameters |
character vector of parameter names to create diagnostic plots for. If none are supplied all monitored parameters are included. |
A graphic with three diagnostic plots:
traceplot of all chains
density plot of marginal distribution for each chain
autocorrelation for each chain
Michael Malick
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(coda)
data(line)
coda_diag(line)
coda_diag(line, parameters = "alpha")
coda_diag(line, parameters = "beta")
coda_diag(line, parameters = c("alpha", "beta"))
coda_diag(line, parameters = grep("sig", varnames(line), value = TRUE))
coda_diag(line, parameters = grep("a", varnames(line), value = TRUE))
coda_diag(line, parameters = c("alpha", grep("sig", varnames(line),
value = TRUE)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.