constancy {aster2} | R Documentation |
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).
constancy(data, parm.type = c("theta", "phi")) is.same(parm1, parm2, data, parm.type = c("theta", "phi"), tolerance = sqrt(.Machine$double.eps))
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 |
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).
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 = phi depending on whether
parm.type = "theta"
or parm.type = "phi"
.
Conversely, if psi1 and psi2 are valid parameter
vectors of the same type, then they correspond to the same probability
distribution only if psi1 - psi2 is a linear
combination of rows of this matrix.
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")