ExponentialLuckModel-class: Class '"ExponentialLuckModel"' and its constructor function...

Description Usage Arguments Details Slots of the resulting object Methods for ExponentialLuckModel objects Author(s) References See Also Examples

Description

"ExponentialLuckModel" objects describe a set of conjugate Gamma priors for imprecise Bayesian inference about exponetially distributed data X[i] ~ Exp(lambda). The set of Gamma priors on lambda is defined via the set of canonical parameters y^(0) and n^(0). ExponentialLuckModel extends the class LuckModel. Objects can be created using the constructor function ExponentialLuckModel() described below.

Usage

1
2
ExponentialLuckModel(arg1 = NULL, n0 = NULL, y0 = NULL,
                     data = new("ExponentialData"))

Arguments

arg1

Used for treatment of unnamed arguments only, see Details.

n0

A (1x2)-matrix, with the first element the lower bound and the second element the upper bound for n^(0). Alternatively, a two-element vector containing lower and upper bound. If a single value is given, it is taken as lower and upper bound, such that a model with fixed n^(0) is specified. See also Details.

y0

A (1x2)-matrix, with the first element the lower bound and the second element the upper bound for y^(0). Alternatively, a two-element vector containing lower and upper bound. If a single value is given, it is taken as lower and upper bound, such that a model with fixed y^(0) is specified. See also Details.

data

An object of class ExponentialData, or, alternatively, a vector or list of arguments that its constructor function ExponentialData() can handle. Also, an object of class LuckModelData can be supplied if tau has dimension 1 and is strictly positive. Default value is a default ExponentialData object containing no data that can be replaced later by data(object) <- .

Details

ExponentialLuckModel objects can be created by one of the two following ways:

With the data distributed as X[i] ~ Exp(lambda), the conjugate prior on mu is defined as

lambda ~ Ga(n^(0)+1, n^(0) y^(0)),

where Ga(alpha,beta) is the Gamma distribution with shape parameter alpha and rate parameter beta and density

p(λ) = (beta^alpha/G(alpha)) * lambda^(alpha-1) * e^(-beta*lambda)

and G is the Gamma function.

In the canonical parametrization in terms of y^(0) and n^(0) used here, the main parameter y^(0) gives the inverse mode of the gamma distribution. n^(0) can, as usually, be interpreted as a prior strength parameter.

The set of priors is then defined as the set of Gamma distributions as given above, where y^(0) and n^(0) vary in sets with the bounds given in y0 and n0, respectively.

Slots of the resulting object

n0:

n^(0), the "prior strength" parameter set, is stored as a (1x2)-matrix, with the first element the lower bound and the second element the upper bound.

y0:

The range of y^(0), the "main parameter", taking here the role of the inverse mode of lambda, is stored as a (1x2)-matrix, with the first element giving the lower bound and the second element the upper bound.

data:

Object of class ExponentialData, containing the sample statistic tau(x) = n*mean(x) and the sample size n. For details, see ExponentialData.

Methods for ExponentialLuckModel objects

There are methods to access or replace the contents of the slots:

n0

signature(object = "ExponentialLuckModel")

n0<-

signature(object = "ExponentialLuckModel")

y0

signature(object = "ExponentialLuckModel")

y0<-

signature(object = "ExponentialLuckModel")

data

signature(object = "ExponentialLuckModel")

data<-

signature(object = "ExponentialLuckModel")

There are methods to display ExponentialLuckModels by text or graphically:

show

signature(object = "ExponentialLuckModel"): This is invoked when printing an ExponentialLuckModel.

plot

signature(x = "ExponentialLuckModel", y = "missing"): This plots the prior or posterior set of parameters, with n^(0) as the abscissa and y^(0) as the ordinate. See plot.

There are two exemplary functions for inference tasks implemented so far.

cdfplot

signature(object = "ExponentialLuckModel"): This displays the range of cumulative density functions as defined by the set of prior or posterior parameters, see cdfplot.

unionHdi

signature(object = "ExponentialLuckModel"): This calculates the union of highest density intervals for the prior or posterior set of distributions, see unionHdi.

Author(s)

Norbert Krautenbacher

References

Gero Walter and Thomas Augustin (2009), Imprecision and Prior-data Conflict in Generalized Bayesian Inference, Journal of Statistical Theory and Practice 3:255-271.

Norbert Krautenbacher (2011), Ein Beitrag zur generalisierten Bayes-Inferenz: Erweiterung und Anwendung der Implementierung der generalized iLUCK-models (A contribution to generalized Bayesian Inference: Extension and Application of the implementation of generalized iLUCK-models), Diploma Thesis, Department of Statistics, LMU Munich.

See Also

luck for a general description of the package, LuckModel for the general class describing the framework of canonical conjugate priors for inference based on samples from an exponential family, and ExponentialData for the class of the data slot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# directly generate a ExponentialLuckModel object with a ExponentialData object
exp1 <- ExponentialLuckModel(n0=c(1,2), y0=c(3,4))

# turn a LuckModel object into a ExponentialLuckModel object
luck1 <- LuckModel(n0=c(2,10), y0=c(3, 4))
exp2 <- ExponentialLuckModel(luck1)

# access and replace slots
n0(exp1)
y0(exp1)
n0(exp1) <- c(1,25)
set.seed(12345)
data(exp2) <- ExponentialData(mean=5, n=20, sim=TRUE)
data(exp2)
tauN(data(exp2))

# plot prior and posterior parameter sets (same as with LuckModel objects)
par(mfrow=c(1,2))
plot(exp2)
plot(exp2, control = controlList(posterior = TRUE))
par(mfrow=c(1,1))

# plot the set of cdfs
cdfplot(exp2)
cdfplot(exp2, control=controlList(posterior=TRUE))

# exemplary inference: union of highest density intervals
unionHdi(exp2)
unionHdi(exp2, posterior=TRUE)$borders

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