hpdi: Computes the highest posterior density interval (HPDI) for...

View source: R/calibration.R

hpdiR Documentation

Computes the highest posterior density interval (HPDI) for calibrated dates

Description

Computes the highest posterior density interval (HPDI) for calibrated dates

Usage

hpdi(
  x,
  credMass = 0.95,
  asList = TRUE,
  calendar = "BP",
  sep = "|",
  pdigits = 3
)

Arguments

x

A CalDates class object.

credMass

Interval probability mass

asList

Logical variable determining whether the output should be a list (TRUE) or a character vector (FALSE). Default is TRUE

calendar

Whether daes should be reported in cal BP ("BP") or in BCAD ("BCAD"). Default is 'BP'. Ignored when "asList=TRUE".

sep

character string to separate date ranges. Default is '|'. Ignored when "asList==TRUE".

pdigits

indicate the number of decimal places for reporting probabilities. Default is 3. Ignored when "asList==TRUE".

Value

A list of matrices with HPDI ranges and associated probabilities in cal BP. Note that the sum of the probability mass will be only approximately equal to the argument credMass.

See Also

calibrate

Examples

x <- calibrate(c(2000,3050,2950),c(35,20,20))
hpdi(x)
hpdi(x,asList=FALSE,calendar='BCAD')

rcarbon documentation built on Aug. 24, 2023, 5:11 p.m.