Learn R Programming

ArchaeoPhases (version 2.1.0)

interval_hdr: Bayesian HPD Regions

Description

Bayesian HPD Regions

Usage

interval_hdr(x, y, ...)

# S4 method for MCMC,missing interval_hdr(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.

y

Currently not used.

...

Extra arguments to be passed to stats::density().

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

References

Hyndman, R. J. (1996). Computing and graphing highest density regions. American Statistician, 50: 120-126. tools:::Rd_expr_doi("10.2307/2684423").

See Also

stats::density(), arkhe::interval_hdr()

Other statistics: interval_credible(), 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