Learn R Programming

ArchaeoPhases (version 1.4.5)

CredibleInterval: Bayesian credible interval

Description

Computes the shortest credible interval at the desired level.

Usage

CredibleInterval(a_chain, level = 0.95)

Arguments

a_chain

numeric vector containing the output of the MCMC algorithm for a one-parameter. The MCMC samples should be in calendar year (BC/AD).

level

probability corresponding to the level of confidence used for the credible interval

Value

Returns a vector of values containing the level of confidence and the endpoints of the shortest credible interval. The result is given in calendar year (in format BC/AD).

Details

A (100 * level) % credible intervalgives the shortest interval, whose posterior probability is equal to the desired level. This interval is approximated by constructing the shortest interval such that N*(1-level) elements of the sample are outside the interval.

Examples

Run this code
# NOT RUN {
  data(Events); attach(Events)

  CredibleInterval(Event.1)
  CredibleInterval(Event.12, 0.50)
# }

Run the code above in your browser using DataLab