hpd: Calculate highest posterior density

View source: R/calibrate.R

hpdR Documentation

Calculate highest posterior density

Description

Calculate highest posterior density ranges of calibrated distribution

Usage

hpd(calib, prob = 0.95, return.raw = FALSE, rounded = 1)

Arguments

calib

The calibrated distribution, as returned from caldist()

prob

Probability range which should be calculated. Default prob=0.95.

return.raw

The raw data to calculate hpds can be returned, e.g. to draw polygons of the calibrated distributions. Defaults to return.raw=FALSE.

rounded

Rounding for reported probabilities. Defaults to 1 decimal.

Examples

hpd(caldist(130,20))
plot(tmp <- caldist(2450,50), type='l')
abline(v=hpd(tmp)[,1:2], col=4)

IntCal documentation built on July 12, 2022, 1:05 a.m.