Control Function for vgam()
vgam.control.RdAlgorithmic constants and parameters for running vgam
are set using this function.
Usage
vgam.control(all.knots = FALSE, bf.epsilon = 1e-07, bf.maxit = 30,
checkwz=TRUE, Check.rank = TRUE, Check.cm.rank = TRUE,
criterion = names(.min.criterion.VGAM),
epsilon = 1e-07, maxit = 30, Maxit.outer = 10,
noWarning = FALSE,
na.action = na.fail,
nk = NULL, save.weights = FALSE, se.fit = TRUE,
trace = FALSE, wzepsilon = .Machine$double.eps^0.75,
xij = NULL, gamma.arg = 1, ...)Arguments
- all.knots
logical indicating if all distinct points of the smoothing variables are to be used as knots. By default,
all.knots=TRUEfor \(n \leq 40\), and for \(n > 40\), the number of knots is approximately \(40 + (n-40)^{0.25}\). This increases very slowly with \(n\) so that the number of knots is approximately between 50 and 60 for large \(n\).- bf.epsilon
tolerance used by the modified vector backfitting algorithm for testing convergence. Must be a positive number.
- bf.maxit
maximum number of iterations allowed in the modified vector backfitting algorithm. Must be a positive integer.
- 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 thanwzepsilonare replaced with this value.- Check.rank, Check.cm.rank
See
vglm.control.- 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/local-scoring iterations are assumed to have converged when two successive
criterionvalues are withinepsilonof each other.- maxit
maximum number of Newton-Raphson/Fisher-scoring/local-scoring iterations allowed.
- Maxit.outer
maximum number of outer iterations allowed when there are
sm.osorsm.psterms. Seevgamfor a little information about the default outer iteration. Note that one can use performance iteration by settingMaxit.outer = 1; then the smoothing parameters will be automatically chosen at each IRLS iteration (some specific programming allows this).Note that
gamuses outer iteration by default. However,magicis only invoked for the Gaussian family, so the results ofgammay differ substantially fromsm.osandsm.psin general.- na.action
how to handle missing values. Unlike the SPLUS
gamfunction,vgamcannot handleNAs when smoothing.- nk
vector of length \(d\) containing positive integers. where \(d\) be the number of
sterms in the formula. Recycling is used if necessary. The \(i\)th value is the number of B-spline coefficients to be estimated for each component function of the \(i\)ths()term.nkdiffers from the number of knots by some constant. If specified,nkoverrides the automatic knot selection procedure.- save.weights
logical indicating whether the
weightsslot of a"vglm"object will be saved on the object. If not, it will be reconstructed when needed, e.g.,summary.- se.fit
logical indicating whether approximate pointwise standard errors are to be saved on the object. If
TRUE, then these can be plotted withplot(..., se = TRUE).- 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.
- noWarning
Same as
vglm.control.- xij
Same as
vglm.control.- gamma.arg
Numeric; same as
gammainmagic. Inflation factor for optimizing the UBRE/GCV criterion. If given, a suggested value is 1.4 to help avoid overfitting, based on the work of Gu and co-workers (values between 1.2 and 1.4 appeared reasonable, based on simulations). A warning may be given if the value is deemed out-of-range.- ...
other parameters that may be picked up from control functions that are specific to the VGAM family function.
Details
Most of the control parameters are used within
vgam.fit and you will have to look at that
to understand the full details. Many of the control
parameters are used in a similar manner by vglm.fit
(vglm) because the algorithm (IRLS) is
very similar.
Setting save.weights=FALSE is useful for some
models because the weights slot of the object is
often the largest and so less memory is used to store the
object. However, for some VGAM family function,
it is necessary to set save.weights=TRUE because
the weights slot cannot be reconstructed later.
Value
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 vgam objects.
References
Yee, T. W. and Wild, C. J. (1996). Vector generalized additive models. Journal of the Royal Statistical Society, Series B, Methodological, 58, 481–493.
Note
vgam does not implement half-stepsizing,
therefore parametric models should be fitted with
vglm. Also, vgam is slower
than vglm too.
Warning
See vglm.control.
Examples
pneumo <- transform(pneumo, let = log(exposure.time))
vgam(cbind(normal, mild, severe) ~ s(let, df = 2), multinomial,
data = pneumo, trace = TRUE, eps = 1e-4, maxit = 10)
#> VGAM s.vam loop 1 : deviance = 3.582
#> VGAM s.vam loop 2 : deviance = 3.405
#> VGAM s.vam loop 3 : deviance = 3.386
#> VGAM s.vam loop 4 : deviance = 3.385
#> VGAM s.vam loop 5 : deviance = 3.385
#>
#> Call:
#> vgam(formula = cbind(normal, mild, severe) ~ s(let, df = 2),
#> family = multinomial, data = pneumo, trace = TRUE, eps = 1e-04,
#> maxit = 10)
#>
#>
#> Degrees of Freedom: 16 Total; 10.53 Residual
#> Residual deviance: 3.385485
#> Log-likelihood: -24.26959
#>
#> This is a multinomial logit model with 3 levels