plotPosteriorDensity: Plot MCMC posterior densities

View source: R/plot.r

plotPosteriorDensityR Documentation

Plot MCMC posterior densities

Description

Plot the posterior density.

Usage

plotPosteriorDensity(trace, prior = NULL, colour = NULL, plot = TRUE)

Arguments

trace

either a data.frame or a list of data.frame with all variables in column, as returned by mcmcMh. Accept also an mcmc, a mcmc.list object or a list of mcmc.list .

prior

a data.frame containing the prior density. It must have the three following columns:

  • theta names of the parameters

  • x value of the parameters

  • density density of the prior at x

colour

named vector of two characters and containing colour names for posterior and prior distributions. Vector names must be posterior and prior.

plot

if TRUE the plot is displayed, and returned otherwise.

See Also

burnAndThin

Examples

data(mcmcEpi)
plotPosteriorDensity(mcmcEpi1)

sbfnk/fitR documentation built on July 18, 2023, 3:28 p.m.