Learn R Programming

aster2 (version 0.3-2)

constancy: Constancy Spaces for Aster Models

Description

Produce basis for constancy space of an aster model. Test whether the difference of two canonical parameter vectors is in the constancy space (so the two parameter vectors correspond to the same probability model).

Usage

constancy(data, parm.type = c("theta", "phi"))
is.same(parm1, parm2, data, parm.type = c("theta", "phi"),
    tolerance = sqrt(.Machine$double.eps))

Value

for is.same a logical value; for constancy

a matrix whose rows constitute a basis for the constancy space. This means that if \(\delta\) is a linear combination of rows of this matrix then for all real \(s\) the distributions having parameter vectors \(\psi\) and \(\psi + s \delta\) are the same, where \(\psi = \theta\)

or \(\psi = \varphi\) depending on whether

parm.type = "theta" or parm.type = "phi". Conversely, if \(\psi_1\) and \(\psi_2\) are valid parameter vectors of the same type, then they correspond to the same probability distribution only if \(\psi_1 - \psi_2\) is a linear combination of rows of this matrix.

Arguments

data

an object of class "asterdata" produced by asterdata or “by hand” such that is.validasterdata(data) returns TRUE. The specification of the aster model.

parm.type

the parametrization for which the constancy space is wanted.

parm1

a parameter vector of the type specified by parm.type for the saturated aster model specified by data.

parm2

another parameter vector of the type specified by parm.type for the saturated aster model specified by data.

tolerance

numeric >= 0. Relative errors smaller than tolerance are not considered in the comparison.

Details

There is no need for functions to test whether different mean value parameters (\(\xi\) or \(\mu\)) correspond to the same probability distribution because these parametrizations are identifiable (different valid parameter vectors correspond to different probability distributions).

See Also

asterdata

Examples

Run this code
data(test1)
fred <- asterdata(test1,
    vars = c("m1", "m2", "m3", "n1", "n2", "b1", "p1", "z1"),
    pred = c(0, 0, 0, 1, 1, 2, 3, 6), group = c(0, 1, 2, 0, 4, 0, 0, 0),
    code = c(1, 1, 1, 2, 2, 3, 4, 5),
    families = list(fam.multinomial(3), "normal.location.scale",
    "bernoulli", "poisson", "zero.truncated.poisson"))
cmat <- constancy(fred, parm.type = "phi")

Run the code above in your browser using DataLab