unionHdi-methods: Calculate the union of highest density intervals for...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function calculates the union of prior or posterior highest density (HD) intervals for a LuckModel object, i.e. it gives the lowest lower border and the highest upper border of HD intervals over the set of parametric distributions defined by a LuckModel object.

Usage

1
unionHdi(object, gamma = 0.95, posterior = FALSE)

Arguments

object

An object of a class extending LuckModel, i.e. representing inference for data from a certain distribution, e.g., ScaledNormalLuckModel. (Plain LuckModel objects implement the general superstructure for canonical conjugate priors and thus do not specify a certain parametric family of priors.)

gamma

The coverage probability for each of the HD intervals forming the union. The union then has at least the coverage probability of gamma. Default is 0.95, i.e. 95%.

posterior

Whether the prioror the posterior union of HD intervals should be calculated. For posterior = TRUE, the LuckModel must contain a LuckModelData object.

Details

The function makes use of wrapOptim to optimize over the prior or posterior parameter set, where for each parameter combination from the set, the function singleHdi is used to calculate the highest density interval.

Value

A list with the elements

borders

A two-element vector containing the lowest lower and the highest upper HD bound.

lowpars

The canonical parameters for which the lowest lower HD bound was attained, itself a list with elements n and y.

upppars

The canonical parameters for which the highest upper HD bound was attained, itself a list with elements n and y.

Author(s)

Gero Walter

See Also

singleHdi for the method to calculate the single highest density intervals, luck for a general description of the package, LuckModel for its central class.

Examples

1
2
3
4
scn3 <- ScaledNormalLuckModel(n0=c(1,25), y0=c(3,4))
unionHdi(scn3)
data(scn3) <- ScaledNormalData(mean=4,n=10)
unionHdi(scn3, posterior=TRUE)$borders

luck documentation built on May 2, 2019, 4:43 p.m.