Learn R Programming

RChronoModel (version 0.4)

MultiHPD: Bayesian highest posterior density regions for a series of MCMC chains

Description

Estimation of the highest posterior density regions for each variables of simulated Markov chain. This function uses the "hdr" function oincluded in the package "hdrcde.

Usage

MultiHPD(data, position, level=0.95)

Arguments

data
dataframe containing the output of the MCMC algorithm
position
numeric vector containing the position of the column corresponding to the MCMC chains of interest
level
probability corresponding to the level of confidence

Value

Returns a matrix of values containing the level of confidence and the endpoints of each interval for each variable of the MCMC chain. The name of the resulting rows are the positions of the corresponding columns in the CSV file.

References

Hyndman, R.J. (1996) Computing and graphing highest density regions. American Statistician, 50, 120-126.

Examples

Run this code
  data(Events)
  MultiHPD(Events, c(2,4,3), 0.95)

Run the code above in your browser using DataLab