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

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

Description

"ScaledNormalLuckModel" objects describe a set of conjugate Normal priors for imprecise Bayesian inference about scaled Normal data X[i] ~ N(mu,1). The set of Normal priors on mu is defined via the set of canonical parameters y^(0) and n^(0). ScaledNormalLuckModel extends the class LuckModel. Objects can be created using the constructor function ScaledNormalLuckModel() described below.

Usage

1
2
ScaledNormalLuckModel(arg1 = NULL, n0 = NULL, y0 = NULL,
                      data = new("ScaledNormalData"))

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 ScaledNormalData, or, alternatively, a vector or list of arguments that its constructor function ScaledNormalData() can handle. Also, an object of class LuckModelData can be supplied if tau has dimension 1. Default value is a default ScaledNormalData object containing no data that can be replaced later by data(object) <- .

Details

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

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

mu ~ N(y^(0), 1/n^(0)),

such that the main parameter y^(0) is the mean, and the strength parameter n^(0) is the inverse variance of the Normal prior on mu.

The set of priors is then defined as the set of Normal 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, taking here the role of the prior inverse variance of mu, 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 prior expectation of mu, 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 ScaledNormalData, containing the sample statistic tau(x) = n*mean(x) and the sample size n. For details, see ScaledNormalData.

Methods for ScaledNormalLuckModel objects

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

n0

signature(object = "ScaledNormalLuckModel")

n0<-

signature(object = "ScaledNormalLuckModel")

y0

signature(object = "ScaledNormalLuckModel")

y0<-

signature(object = "ScaledNormalLuckModel")

data

signature(object = "ScaledNormalLuckModel")

data<-

signature(object = "ScaledNormalLuckModel")

There are methods to display ScaledNormalLuckModels by text or graphically:

show

signature(object = "ScaledNormalLuckModel"): This is invoked when printing a ScaledNormalLuckModel.

plot

signature(x = "ScaledNormalLuckModel", 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 = "ScaledNormalLuckModel"): This displays the range of cumulative density functions as defined by the set of prior or posterior parameters, see cdfplot.

unionHdi

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

Author(s)

Gero Walter

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.

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 ScaledNormalData 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
30
# directly generate a ScaledNormalLuckModel object with a ScaledNormalData object
scn1 <- ScaledNormalLuckModel(n0=c(1,2), y0=c(3,4), data=ScaledNormalData(mean=4, n=10))

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

# access and replace slots
n0(scn1)
y0(scn1)
data(scn1)
n0(scn1) <- c(1,25)
data(scn2) <- ScaledNormalData(mean=5, n=200, sim=TRUE)
data(scn2)
tauN(data(scn2))

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

# plot the set of cdfs
cdfplot(scn1)
cdfplot(scn1, control=controlList(posterior=TRUE))
cdfplot(scn1, xvec = seq(0, 4, length.out = 80))

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

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