hdr: Calculate Highest Density Interval from vector of...

Description Usage Arguments References

View source: R/hdr.R

Description

Calculate Highest Density Interval from vector of probabilities

Usage

1
2
hdr(x, prob = 0.95, method = c("quantile", "grid"), simulate = TRUE,
  nsim = 5000)

Arguments

x

numeric vector of probabilities or density estimates.

prob

probability coverage.

method

method of calculating HDR to be used: "quantile" for using quantiles as suggested by Hyndman (1996), "grid" for grid-based method suggested by Kruschke (2011).

simulate

if TRUE bootstrap samples are drawn from x for the "quantile" method.

nsim

number of samples to be drawn if simulate=TRUE.

References

Hyndman, R.J. (1996) Computing and graphing highest density regions. American Statistician, 50, 120-126.

Kruschke, J.K. (2011). Doing Bayesian data analysis: A Tutorial with R and BUGS. Elsevier Science/Academic Press.


twolodzko/twextras documentation built on May 3, 2019, 1:52 p.m.