vglm.control {VGAM} | R Documentation |
Algorithmic constants and parameters for running vglm
are set
using this function.
vglm.control(backchat = if (is.R()) FALSE else TRUE, checkwz=TRUE, criterion = names(.min.criterion.VGAM), epsilon = 1e-07, half.stepsizing = TRUE, maxit = 30, stepsize = 1, save.weight = FALSE, trace = FALSE, wzepsilon = .Machine$double.eps^0.75, xij = NULL, ...)
backchat |
logical indicating if a backchat is to be used
(not applicable in R).
|
checkwz |
logical indicating whether the diagonal elements of
the working weight matrices should be checked whether they are
sufficiently positive, i.e., greater than wzepsilon . If not,
any values less than wzepsilon are replaced with this value.
|
criterion |
character variable describing what criterion is to
be used to test for convergence.
The possibilities are listed in .min.criterion.VGAM , but
most family functions only implement a few of these.
|
epsilon |
positive convergence tolerance epsilon. Roughly
speaking, the Newton-Raphson/Fisher-scoring iterations
are assumed to have
converged when two successive criterion values are within
epsilon of each other.
|
half.stepsizing |
logical indicating if half-stepsizing is
allowed. For example, in maximizing a log-likelihood, if the
next iteration has a log-likelihood that is less than the current
value of the log-likelihood, then a half step will be taken.
If the log-likelihood is still less than at the current position,
a quarter-step will be taken etc. Eventually a step will be taken
so that an improvement is made to the convergence criterion.
half.stepsizing is ignored if
criterion=="coefficients" .
|
maxit |
maximum number of Newton-Raphson/Fisher-scoring iterations allowed.
|
stepsize |
usual step size to be taken between each
Newton-Raphson/Fisher-scoring iteration. It should be a value
between 0 and 1, where
a value of unity corresponds to an ordinary step.
A value of 0.5 means half-steps are taken.
Setting a value near zero will cause convergence to be generally slow
but may help increase the chances of successful convergence for some
family functions.
|
save.weight |
logical indicating whether the weights slot
of a "vglm" object will be saved on the object. If not, it will
be reconstructed when needed, e.g., summary .
Some family functions have save.weight=TRUE and others have
save.weight=FALSE in their control functions.
|
trace |
logical indicating if output should be produced for each iteration.
|
wzepsilon |
Small positive number used to test whether the diagonals of the working
weight matrices are sufficiently positive.
|
xij |
formula giving terms making up a covariate-dependent term (a variable
that takes on different values for each linear/additive predictor.
For example, the ocular pressure of each eye).
There should be M unique terms; use
fill1 , fill2 , fill3 , etc. if necessary.
Each formula should have a response which is taken as the name of
that variable, and the terms are enumerated in sequential order.
With more than one formula, use a list of formulas.
See Example 2 below.
|
... |
other parameters that may be picked up from control
functions that are specific to the VGAM family function.
|
Most of the control parameters are used within vglm.fit
and
you will have to look at that to understand the full details.
Setting save.weight=FALSE
is useful for some models because
the weights
slot of the object is the largest and so less
memory is used to store the object. However, for some VGAM
family function, it is necessary to set save.weight=TRUE
because the weights
slot cannot be reconstructed later.
A list with components matching the input names. A little error
checking is done, but not much.
The list is assigned to the control
slot of vglm
objects.
In Example 2 below there are two covariates that have linear/additive
predictor specific values.
These are handled using the xij
argument.
Thomas W. Yee
Yee, T. W. and Hastie, T. J. (2003) Reduced-rank vector generalized linear models. Statistical Modelling, 3, 15–41.
# Example 1. data(pneumo) pneumo = transform(pneumo, let=log(exposure.time)) vglm(cbind(normal,mild,severe) ~ let, multinomial, pneumo, crit="coef", step=0.5, trace=TRUE, eps=1e-8, maxit=40) # Example 2. The use of the xij argument set.seed(111) n = 1000 ymat = rdiric(n, shape=c(4,7,3,1)) mydat = data.frame(x1=runif(n), x2=runif(n), x3=runif(n), x4=runif(n), z1=runif(n), z2=runif(n), z3=runif(n), z4=runif(n)) mydat = round(mydat, dig=2) fit = vglm(ymat ~ x1 + x2 + x3 + x4 + z1 + z2 + z3 + z4, fam = dirichlet, data=mydat, crit="c", xij = list(z ~ z1 + z2 + z3 + z4, x ~ x1 + x2 + x3 + x4)) model.matrix(fit, type="lm")[1:7,] # LM model matrix model.matrix(fit, type="vlm")[1:7,] # Big VLM model matrix coef(fit) coef(fit, matrix=TRUE) coef(fit, matrix=TRUE, compress=FALSE) max(abs(predict(fit)-predict(fit, new=mydat))) # Predicts correctly summary(fit)