coda_hist: Create a histogram of marginal posterior distributions

Description Usage Arguments Value Author(s) See Also Examples

View source: R/coda_hist.R

Description

coda_hist uses the hist function inbase R 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. A single histogram is printed per graphics device.

Usage

1
coda_hist(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

hist

Examples

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

coda_hist(line)

coda_hist(line, parameters = "alpha")

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

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

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

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

michaelmalick/r-codatools documentation built on May 22, 2019, 9:51 p.m.