Learn R Programming

ArchaeoPhases (version 1.8)

credible_interval: Bayesian credible interval

Description

Computes the shortest credible interval for a single parameter.

Usage

credible_interval(data, level = 0.95, round_to = 0)

Arguments

data

Numeric vector containing the output of the MCMC algorithm for the parameter.

level

Probability corresponding to the level of confidence used for the credible interval, default = 0.95.

round_to

Integer indicating the number of decimal places to be used, default = 0.

Value

A list with the following components:

ci

Named vector of length 2, with inf the lower endpoint of the shortest credible interval as a calendar year; and sup the upper endpoint of the shortest credible interval as a calendar year;

level

Confidence level for the credible intervals; and

call

Function call.

Details

A \((100 * level)\)\ that keeps \(N * (1 - level)\) elements of the sample outside the interval. The \((100 * level)\)\ of those intervals.

Examples

Run this code
# NOT RUN {
  data(Events); attach(Events)
  credible_interval(Event.1)
  credible_interval(Event.12, 0.50)

# }

Run the code above in your browser using DataLab