Learn R Programming

VGAM (version 1.1-3)

vgam.control: Control Function for vgam()

Description

Algorithmic 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=TRUE for \(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 than wzepsilon are replaced with this value.

Check.rank, Check.cm.rank
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 criterion values are within epsilon of 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.os or sm.ps terms. See vgam for a little information about the default outer iteration. Note that one can use performance iteration by setting Maxit.outer = 1; then the smoothing parameters will be automatically chosen at each IRLS iteration (some specific programming allows this).

na.action

how to handle missing values. Unlike the SPLUS gam function, vgam cannot handle NAs when smoothing.

nk

vector of length \(d\) containing positive integers. where \(d\) be the number of s terms 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\)th s() term. nk differs from the number of knots by some constant. If specified, nk overrides the automatic knot selection procedure.

save.weights

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.

se.fit

logical indicating whether approximate pointwise standard errors are to be saved on the object. If TRUE, then these can be plotted with plot(..., 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 gamma in magic. 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.

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.

Warning

See vglm.control.

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.

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.

See Also

vgam, vglm.control, vsmooth.spline, vglm.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab