Description Usage Arguments Details Slots of the resulting object Methods for ScaledNormalLuckModel objects Author(s) References See Also Examples
"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.
1 2 |
arg1 |
Used for treatment of unnamed arguments only, see Details. |
n0 |
A (1x2)- |
y0 |
A (1x2)- |
data |
An object of class |
ScaledNormalLuckModel
objects can be created by one of the two following ways:
By supplying a LuckModel
object as the only (unnamed) argument.
By supplying n0
and y0
, and possibly also data
.
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.
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
.
ScaledNormalLuckModel
objectsThere are methods to access or replace the contents of the slots:
signature(object = "ScaledNormalLuckModel")
signature(object = "ScaledNormalLuckModel")
signature(object = "ScaledNormalLuckModel")
signature(object = "ScaledNormalLuckModel")
signature(object = "ScaledNormalLuckModel")
signature(object = "ScaledNormalLuckModel")
There are methods to display ScaledNormalLuckModel
s by text or graphically:
signature(object = "ScaledNormalLuckModel")
: This is invoked when
printing a ScaledNormalLuckModel
.
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.
signature(object = "ScaledNormalLuckModel")
: This displays the
range of cumulative density functions as defined by the set of prior or
posterior parameters, see cdfplot
.
signature(object = "ScaledNormalLuckModel")
: This calculates the
union of highest density intervals for the prior or posterior set of
distributions, see unionHdi
.
Gero Walter
Gero Walter and Thomas Augustin (2009), Imprecision and Prior-data Conflict in Generalized Bayesian Inference, Journal of Statistical Theory and Practice 3:255-271.
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.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.