Learn R Programming

stat.extend (version 0.2.1)

HDR.monotone: Highest density region (HDR) for an arbitrary distributions

Description

Highest density region (HDR) for an arbitrary distributions

Usage

HDR.monotone(
  cover.prob,
  Q,
  decreasing = TRUE,
  distribution = UNSPECIFIED_LABEL,
  ...
)

HDR.unimodal( cover.prob, Q, f = NULL, u = NULL, distribution = UNSPECIFIED_LABEL, ..., gradtol = 1e-10, steptol = 1e-10, iterlim = 100 )

HDR.bimodal( cover.prob, Q, f = NULL, u = NULL, distribution = UNSPECIFIED_LABEL, ..., gradtol = 1e-10, steptol = 1e-10, iterlim = 100 )

HDR.discrete.unimodal( cover.prob, Q, F, f = NULL, u = NULL, distribution = UNSPECIFIED_LABEL, ..., gradtol = 1e-10, steptol = 1e-10, iterlim = 100 )

Arguments

cover.prob

The probability coverage for the HDR (scalar between zero and one). The significance level for the HDR i is 1-cover.prob.

Q

an inverse CDF of a distribution

decreasing

Direction of monotone distribution

distribution

a label

...

Arguments for Q, f and u

f

a PDF of a distribution

u

a log-derivative of f

gradtol

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)).

steptol

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)).

iterlim

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)).

F

a CDF of a distribution

Value

An interval object with classes hdr and interval containing the highest density region and related information.

See Also

HDR.discrete

Examples

Run this code
# NOT RUN {
HDR.monotone(.95, Q=qexp)

HDR.unimodal(.95, Q=qnorm)

HDR.bimodal(.95, Q=qbeta, shape1=1/2, shape2=1/2)

HDR.discrete.unimodal(.95, Q=qpois, F=ppois, lambda=1)

# }

Run the code above in your browser using DataLab