Learn R Programming

ArchaeoPhases (version 2.1.0)

interval_credible: Bayesian Credible Interval

Description

Computes the shortest credible interval of the output of the MCMC algorithm for a single parameter.

Usage

interval_credible(x, ...)

# S4 method for MCMC interval_credible(x, level = 0.95, calendar = get_calendar())

Value

Returns a list of numeric

matrix.

Arguments

x

An MCMC object containing the output of the MCMC algorithm.

...

Currently not used.

level

A length-one numeric vector giving the confidence level.

calendar

A aion::TimeScale object specifying the target calendar (see aion::calendar()).

Author

A. Philippe, M.-A. Vibet, T. S. Dye, N. Frerebeau

Details

A \((100 \times level)\) % credible interval is an interval that keeps \(N \times (1 - level)\) elements of the sample outside the interval.

The \((100 \times level)\) % credible interval is the shortest of all those intervals.

For instance, the 95% credible interval is the central portion of the posterior distribution that contains 95% of the values.

See Also

arkhe::interval_credible()

Other statistics: interval_hdr(), sensitivity(), summary()

Examples

Run this code
## Coerce to events
eve <- as_events(mcmc_events, calendar = CE(), iteration = 1)
eve <- eve[1:10000, ]

## Rata die
interval_credible(eve, level = 0.95) # Credible interval
interval_hdr(eve, level = 0.68) # HPD interval

## BP
interval_credible(eve, level = 0.95, calendar = BP()) # Credible interval
interval_hdr(eve, level = 0.95, calendar = BP()) # HPD interval

Run the code above in your browser using DataLab