constancy {aster2} | R Documentation |
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))
Arguments
data |
an object of class |
parm.type |
the parametrization for which the constancy space is wanted. |
parm1 |
a parameter vector of the type specified by |
parm2 |
another parameter vector of the type specified
by |
tolerance |
numeric >= 0. Relative errors smaller
than |
Details
There is no need for functions to test whether different mean value parameters
( or
) correspond to the same probability
distribution because these parametrizations are identifiable (different valid
parameter vectors correspond to different probability distributions).
Value
for is.same
a logical value;
for constancy
a matrix whose rows constitute a basis for the constancy space.
This means that if is a linear combination of rows
of this matrix then for all real
the distributions having parameter
vectors
and
are the
same, where
or
depending on whether
parm.type = "theta"
or parm.type = "phi"
.
Conversely, if and
are valid parameter
vectors of the same type, then they correspond to the same probability
distribution only if
is a linear
combination of rows of this matrix.
See Also
Examples
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")