coda_histogram: Create a histogram of marginal posterior distributions

Description Usage Arguments Value Author(s) See Also Examples

Description

coda_histogram uses the histogram function in the lattice package to plot histograms of the marginal posterior distribution for each parameter specified by the parameters argument. In addition, a density overlay, rug of mcmc sample values, median value (bold vertical dash), and 95% credibility interval (bold horizontal line) are plotted. The function uses lattice to panel the histograms for each parameter.

Usage

1
coda_histogram(coda.object, parameters = NULL)

Arguments

coda.object

An mcmc.list object

parameters

character vector of parameter names to include in graphic. If none are supplied all monitored parameters are included.

Value

A graphics device

Author(s)

Michael Malick

See Also

histogram

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(coda)
data(line)

coda_histogram(line)

coda_histogram(line, parameters = "alpha")

coda_histogram(line, parameters = c("alpha", "beta"))

coda_histogram(line, parameters = grep("sig", varnames(line), value = TRUE))

coda_histogram(line, parameters = grep("a", varnames(line), value = TRUE))

coda_histogram(line, parameters = c("alpha", grep("sig", varnames(line),
               value = TRUE)))

MichaelMalick/r-codatools documentation built on May 8, 2019, 9:56 a.m.