Learn R Programming

bssbinom (version 1.0.0)

hd.beta: HD interval for the beta distribution

Description

Computes the highest density interval for the beta distribution by optimization or simulation.

Usage

hd.beta(c, d, rho = NULL, len = NULL, N = 1000)

Value

Lower and upper bounds of the HD interval.

Arguments

c

First parameter of the beta distribution.

d

Second parameter of the beta distribution.

rho

A number in (0, 1) representing the fixed probability for the HD interval.

len

A positive real number representing the fixed length for the HD interval.

N

Number of replicates used in the simulation when the length is fixed. Default is 1000.

References

M’Lan, C.E., Joseph, L., Wolfson, D.B. (2006). Bayesian sample size determination for case-control studies. Journal of the American Statistical Association, 101, 760–772.

Examples

Run this code
hd.beta(c = 2, d = 3, rho = 0.95)

hd.beta(c = 2, d = 3, len = 0.3)

Run the code above in your browser using DataLab