50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

ananke (version 0.1.0)

interval_hdr: Highest Density Regions

Description

Highest Density Regions

Usage

# S4 method for CalibratedAges,missing
interval_hdr(x, level = 0.954, ...)

Value

A CalibratedIntervals object.

Arguments

x

A CalibratedAges object.

level

A length-one numeric vector giving the confidence level.

...

Currently not used.

Author

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(), mean(), median(), quantile()

Examples

Run this code
## Calibrate multiple dates
cal <- c14_calibrate(
  values = c(5000, 4500),
  errors = c(45, 35),
  names = c("X", "Y")
)

## HDR
hdr68 <- interval_hdr(cal, level = 0.683)
hdr95 <- interval_hdr(cal, level = 0.954)
hdr99 <- interval_hdr(cal, level = 0.997)

## Coerce to data.frame
as.data.frame(hdr95, calendar = BC())

## Plot
plot(cal, interval = "hdr")

Run the code above in your browser using DataLab