transformSaturated(parm, data, from = c("theta", "phi", "xi", "mu"), to = c("theta", "phi", "xi", "mu"), differential, tolerance = 8 * .Machine$double.eps)
transformConditional(parm, modmat, data, from = "beta", to = c("theta", "phi", "xi", "mu"), differential, offset, tolerance = 8 * .Machine$double.eps)
transformUnconditional(parm, modmat, data, from = c("beta", "tau"), to = c("beta", "theta", "phi", "xi", "mu", "tau"), differential, offset, tolerance = 8 * .Machine$double.eps)
jacobian(parm, data, transform = c("saturated", "conditional", "unconditional"), from = c("beta", "theta", "phi", "xi", "mu", "tau"), to = c("beta", "theta", "phi", "xi", "mu", "tau"), modmat, offset, tolerance = 8 * .Machine$double.eps)
validtheta(data, theta, tolerance = 8 * .Machine$double.eps)
is.validtheta(data, theta, tolerance = 8 * .Machine$double.eps)
validxi(data, xi, tolerance = 8 * .Machine$double.eps)
is.validxi(data, xi, tolerance = 8 * .Machine$double.eps)nrow(data$redata)
for transformSaturated or of length ncol(modmat)
for transformConditional and transformUnconditional."asterdata" produced by
asterdata or by hand such that
is.validasterdata(data) returns TRUE. The specification
of the aster model.parm is. May be abbreviated.parm is to be converted.
May be abbreviated.parm. If missing the change-of-parameter is calculated.
If not missing the derivative of the change-of-parameter is calculated.nrow(data$redata) rows
and length(beta) columns for transformConditional
or length(parm) columns for transformUnconditional.nrow(data$redata). May be missing,
in which case offset vector equal to zero is used.nrow(data$redata).nrow(data$redata).tolerance are not considered in checking validity
of xi for multinomial data.transform == "saturated" means the
function transformSaturated will be called. May be abbreviated.parm. The new parameter if
deriv == FALSE or the transform of the differential
if deriv = TRUE. See details.
differential is missing, the returned value is a new parameter
vector of the specified type. If differential is not missing,
the returned value is the derivative evaluated at parm
and differential, that is, if $f$ is the change-of variable
function and $psi$ is the from parameter, then
$f(psi)$ is calculated when the differential is missing and
$f'(psi)(delta)$ is calculated when the
differential $delta$ is not missing, where the latter is defined by
$$f(\psi + \delta) \approx f(\psi) + f'(\psi)(\delta)$$ for small $delta$.The kinds of parameters are "theta" the conditional canonical parameter
for the saturated model, "phi" the unconditional canonical parameter
for the saturated model, "xi" the conditional mean value parameter
for the saturated model, "mu" the unconditional mean value parameter
for the saturated model,
"beta" the regression coefficient parameter for a canonical affine
submodel ($theta = a + M beta$ for a conditional
canonical affine submodel or
$phi = a + M beta$ for an unconditional
canonical affine submodel, where $a$ is the offset vector
and $M$ is the model matrix),
"tau" the mean value parameter for an unconditional canonical affine
submodel ($tau = M^T mu$,
where $M$ is the model matrix).
Only the conditional canonical parameter vector $theta$ and the conditional mean value parameter vector $xi$ can be checked directly. (To check the validity of another parameter, transform to one of these and check that.) This means that in conversions to these parameters the output vector is checked rather than the input vector, and conversions (apparently) not involving these parameters (which do go through these parameters inside the transformation function) a conversion to one of these parameters is what is checked rather than the input vector.
The function jacobian turns the derivative considered as
a linear transformation calculated by the transform functions
into the matrix that represents the linear transformation (sometimes
called the Jacobian matrix of the transformation). The arguments
modmat and offset are only used if
transform == "conditional" or transform == "unconditional",
and (as with the transform functions) the argument offset
may be missing, in which case the zero vector is used. Not all of the
candidate values for from and to arguments
for the jacobian function are valid: the value must be valid for
the transform function that will be called.
asterdata
data(echinacea)
theta <- rnorm(nrow(echinacea$redata), 0, 0.1)
phi <- transformSaturated(theta, echinacea, from = "theta", to = "phi")
## rarely (if ever) want jacobian for unsaturated model transform
## result here is 5130 by 5130 matrix
## Not run: jack <- jacobian(theta, echinacea, from = "theta", to = "phi")
Run the code above in your browser using DataLab