Learn R Programming

ArchaeoPhases (version 1.8)

multi_credible_interval: Bayesian credible interval for a series of dates

Description

Estimate the shortest credible interval for each of several MCMC chains.

Usage

multi_credible_interval(data, position, level = 0.95, round_to = 0)

Arguments

data

data frame containing the output of the MCMC algorithm.

position

Numeric vector containing the position of the column corresponding to the MCMC chains of interest, or a list of column names.

level

Probability corresponding to the level of confidence used for the credible interval.

round_to

Integer indicating the number of decimal places.

Value

Returns a list with the following components:

ci

A data frame with a row for each column in data and two columns: inf, the lower credible interval in calendar years (BC/AD); and sup, the upper credible interval in calendar years (BC/AD).

level

Probability corresponding to the level of confidence used for the credible interval.

call

The function call.

Details

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

Examples

Run this code
# NOT RUN {
  data(Events)
  multi_credible_interval(Events, c(2, 4, 3), 0.95)
  # round to decade
  multi_credible_interval(Events, c(2, 4, 3), 0.95, -1)

# }

Run the code above in your browser using DataLab