HDR.xxxx
returns the highest density region (HDR) for a chosen distribution.
HDR.norm(
cover.prob,
mean = 0,
sd = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)HDR.lnorm(
cover.prob,
meanlog = 0,
sdlog = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.t(cover.prob, df, ncp = 0, gradtol = 1e-10, steptol = 1e-10, iterlim = 100)
HDR.cauchy(
cover.prob,
location = 0,
scale = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.f(
cover.prob,
df1,
df2,
ncp = 0,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.beta(
cover.prob,
shape1,
shape2,
ncp = 0,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.chisq(
cover.prob,
df,
ncp = 0,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.gamma(
cover.prob,
shape,
rate = 1,
scale = 1/rate,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.weibull(
cover.prob,
shape,
scale = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.exp(cover.prob, rate, gradtol = 1e-10, steptol = 1e-10, iterlim = 100)
HDR.unif(
cover.prob,
min = 0,
max = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.hyper(cover.prob, m, n, k, gradtol = 1e-10, steptol = 1e-10, iterlim = 100)
HDR.geom(cover.prob, prob, gradtol = 1e-10, steptol = 1e-10, iterlim = 100)
HDR.binom(
cover.prob,
size,
prob,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.pois(cover.prob, lambda, gradtol = 1e-10, steptol = 1e-10, iterlim = 100)
HDR.nbinom(
cover.prob,
size,
prob,
mu,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.arcsine(
cover.prob,
min = 0,
max = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.matching(cover.prob, size, trials = 1, prob = 0, approx = (trials > 100))
HDR.betapr(
cover.prob,
shape1,
shape2,
scale = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.fatigue(
cover.prob,
alpha,
beta = 1,
mu = 0,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.gompertz(
cover.prob,
shape = 1,
scale = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.gpd(
cover.prob,
mu = 0,
sigma = 1,
xi = 0,
location = mu,
scale = sigma,
shape = xi,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.huber(
cover.prob,
mu,
sigma,
epsilon,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.kumar(
cover.prob,
a = 1,
b = 1,
shape1 = a,
shape2 = b,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.tnorm(
cover.prob,
mean = 0,
sd = 1,
a = -Inf,
b = Inf,
min = a,
max = b,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.invchisq(
cover.prob,
df,
ncp = 0,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.invexp(
cover.prob,
rate = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.invgamma(
cover.prob,
shape,
rate = 1,
scale = 1/rate,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.benini(
cover.prob,
shape,
y0,
scale = y0,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.frechet(
cover.prob,
shape,
scale = 1,
location = 0,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.gengamma(
cover.prob,
d,
k,
shape1 = d,
shape2 = k,
rate = 1,
scale = 1/rate,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.gumbelII(
cover.prob,
shape,
scale = 1,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
HDR.lgamma(
cover.prob,
shape = 1,
scale = 1,
location = 0,
gradtol = 1e-10,
steptol = 1e-10,
iterlim = 100
)
The probability coverage for the HDR (scalar between zero and one). The significance level for the HDR i is 1-cover.prob
.
Parameter for the nlm optimisation - a positive scalar giving the tolerance at which the scaled gradient is considered close enough to zero to terminate the algorithm (see [nlm
doccumentation](https://stat.ethz.ch/R-manual/R-patched/library/stats/html/nlm.html)).
Parameter for the nlm optimisation - a positive scalar providing the minimum allowable relative step length (see [nlm
doccumentation](https://stat.ethz.ch/R-manual/R-patched/library/stats/html/nlm.html)).
Parameter for the nlm optimisation - a positive integer specifying the maximum number of iterations to be performed before the program is terminated (see [nlm
doccumentation](https://stat.ethz.ch/R-manual/R-patched/library/stats/html/nlm.html)).
Distribution parameters.
An interval object with classes hdr
and interval
containing the highest density region and related information.
This function computes the highest density region (HDR) for a univariate distribution in the stats
package. The functions for
the HDR for different distributions are named in the form HDR.xxxx
where the xxxx
refers to the distribution
(e.g., HDR.chisq
, HDR.gamma
, HDR.norm
, etc.). The user can use any univariate distribution in the stats
package,
and the function accepts parameters from the specified distribution (see table below). The output of the function is an interval of classes
hdr
and interval
giving the highest density region and some related information pertaining to the distribution and the
computation of the HDR (for information on intervals, see the sets
package). If the input distribution is continuous then the
HDR is a real interval, and if the input distribution discrete then the HDR is a discrete interval. For non-trivial cases the computation
is done by optimisation using the nlm
function.
Using stats |
Continuous | ||
HDR.arcsine | min | max | |
HDR.beta | shape1 | shape2 | ncp |
HDR.cauchy | location | scale | |
HDR.chisq | df | ncp | |
HDR.exp | rate | ||
HDR.f | df1 | df2 | ncp |
HDR.gamma | shape | rate | scale |
HDR.lnorm | meanlog | sdlog | |
HDR.norm | mean | sd | |
HDR.t | df | ncp | |
HDR.unif | min | max | |
HDR.weibull | shape | scale | |
Using stats |
Discrete | ||
HDR.binom | size | prob | |
HDR.geom | prob | ||
HDR.hyper | m | n | k |
HDR.nbinom | size | prob | mu |
HDR.pois | lambda | ||
Using extraDistr |
|||
HDR.betapr | shape1 | shape2 | scale |
HDR.fatigue | alpha | beta | mu |
HDR.gompertz | shape | scale | |
HDR.gpd | mu,location | sigma, scale | shape, xi |
HDR.huber | mu | sigma | epsilon |
HDR.kumar | a,shape1 | b,shape2 | |
HDR.tnorm | mean | sd | a, b, min, max |
Using invgamma |
|||
HDR.invchisq | df | ncp | |
HDR.invexp | rate | ||
HDR.invgamma | shape | rate | scale |
Using VGAM |
|||
HDR.benini | shape | y0 | scale |
HDR.frechet | shape | scale | location |
HDR.gengamma | d, shape1 | k, shape2 | rate, scale |
HDR.gumbelII | shape | scale | |
HDR.lgamma | shape | scale | location |
HDR.matching | size | prob | trials & approx |
The table above shows the parameters in each of the distributions. Some have default values, but most need to be specified. (For the gamma
distribution you should specify either the rate
or scale
but not both.)