Learn R Programming

VGAM (version 1.1-12)

rrvglm.control: Control Function for rrvglm()

Description

Algorithmic constants and parameters for running rrvglm are set using this function. Doubly constrained RR-VGLMs (DRR-VGLMs) are also catered for.

Usage

rrvglm.control(Rank = 1, Corner = TRUE,
    Index.corner = head(setdiff(seq(length(str0) +
    Rank), str0), Rank), noRRR = ~ 1, str0 = NULL,
    Crow1positive = NULL, trace = FALSE, Bestof = 1,
    H.A.thy = list(), H.C = list(),
    Ainit = NULL, Cinit = NULL, sd.Cinit = 0.02,
    Algorithm = "alternating", Etamat.colmax = 10,
    noWarning = FALSE, Use.Init.Poisson.QO = FALSE,
    checkwz = TRUE, Check.rank = TRUE, Check.cm.rank = TRUE,
    wzepsilon = .Machine$double.eps^0.75, ...)

Value

A list with components matching the input names. Some error checking is done, but not much.

Arguments

Rank

The numerical rank \(R\) of the model. Must be an element from the set {1,2,...,min(\(M\),p2)}. Here, the vector of explanatory variables x is partitioned into (x1, x2), which is of dimension p1+p2. The variables making up x1 are given by the terms in noRRR argument, and the rest of the terms comprise x2.

Corner

Logical indicating whether corner constraints are to be used. Strongly recommended as the only method for fitting RR-VGLMs and DRR-VGLMs. This is one method for ensuring a unique solution and the availability of standard errors. If TRUE then Index.corner specifies the position of the corner constraints. Also used by DRR-VGLMs, and this is known as RCCs (see below).

Index.corner

Specifies the \(R\) rows of the corner constraints, e.g., they hold an order-\(R\) identity matrix for RR-VGLMs. The default are the first \(R\) positive integers that exclude str0.

For DRR-VGLMs one needs to have (restricted) corner constraints. Then argument str0 will be ignored. If there are structural zeros then they should be built into the constraint matrices (see H.A.thy).

noRRR

Formula giving terms that are not to be included in the reduced-rank regression. That is, noRRR specifes which explanatory variables are in the x1 vector of rrvglm, and the rest go into x2. I will write x1 as \(x_1\) and x2 as \(x_2\) hereafter. The \(x_1\) variables constitute the \(\bold{B}_1\) matrix in Yee and Hastie (2003). Those \(x_2\) variables which are subject to the reduced-rank regression correspond to the \(\bold{B}_2\) matrix. Set noRRR = NULL for the reduced-rank regression to be applied to every explanatory variable including the intercept.

str0

Integer vector specifying which rows of the estimated constraint matrices (A) are to be all zeros. These are called structural zeros. Must not have any common value with Index.corner, and be a subset of the vector 1:M. The default, str0 = NULL, means no structural zero rows at all. This argument is ignored by DRR-VGLMs.

Crow1positive

Currently this argument has no effect. In the future, it may be a logical vector of length Rank (recycled if necessary): are the elements of the first row of \(C\) positive? Because of corner constraints (diag(Rank)) this argument currently must be NULL. Having a logical vector would mean some of the diagonals might be \(1\) and others \(-1\).

trace

Logical indicating if output should be produced for each iteration.

Bestof

Integer. The best of Bestof models fitted is returned. This argument helps guard against local solutions by (hopefully) finding the global solution from many fits. The argument works only when the function generates its own initial value for C, i.e., when C is not passed in as initial values.

H.A.thy, H.C

Lists. DRR-VGLMs are Doubly constrained RR-VGLMs where A has Rank constraint matrices (one for each column) in a list called H.A.thy, and C has a constraint matrix for each row, i.e., for each explanatory variable making up it. The class "drrvglm" may arise for such models. So H.C should be a named list of \(p_2\) constraint matrices, each one for a different row of C, i.e., \(p_2\) is the number of variables making up the latent variable. Note that if H.C has names then matching is done with that, and the components of H.C are reordered if they are not sorted according to the terms in formula. If they are not named, then their order is used, for example, H.C[[1]] and H.C[[2]] are taken as the constraint matrices for the first two variables of the latent variable(s).

Algorithm

Character string indicating what algorithm is to be used. The default is the first one. The choice "derivative" has been withdrawn in VGAM 1.1-10.

Ainit, Cinit

Initial A and C matrices which may speed up convergence. They must be of the correct dimension.

sd.Cinit

Standard deviation of the initial values for the elements of C. These are normally distributed with mean zero. This argument is used only if Use.Init.Poisson.QO = FALSE.

Etamat.colmax

Positive integer, no smaller than Rank. Controls the amount of memory used by .Init.Poisson.QO(). It is the maximum number of columns allowed for the pseudo-response and its weights. In general, the larger the value, the better the initial value. Used only if Use.Init.Poisson.QO = TRUE.

Use.Init.Poisson.QO

Logical indicating whether the .Init.Poisson.QO() should be used to obtain initial values for the C. The function uses a new method that can work well if the data are Poisson counts coming from an equal-tolerances QRR-VGLM (CQO). This option is less realistic for RR-VGLMs compared to QRR-VGLMs.

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.

noWarning, Check.rank, Check.cm.rank

Same as vglm.control. Ignored for VGAM 0.9-7 and higher.

wzepsilon

Small positive number used to test whether the diagonals of the working weight matrices are sufficiently positive.

...

Variables in ... are passed into vglm.control. If the derivative algorithm is used then ... are also passed into rrvglm.optim.control; and if the alternating algorithm is used then ... are also passed into valt0.control.

In the above, \(R\) is the Rank and

\(M\) is the number of linear predictors.

Author

Thomas W. Yee

Details

VGAM supported three normalizations to ensure a unique solution. But currently, only corner constraints will work with summary of RR-VGLM and DRR-VGLM objects. Update during late-2023/early-2024: with ongoing work implementing the "drrvglm" class, there may be disruption and changes to other normalizations. However, corner constraints should be fully supported and have the greatest priority.

References

Yee, T. W. and Hastie, T. J. (2003). Reduced-rank vector generalized linear models. Statistical Modelling, 3, 15--41.

See Also

rrvglm, rrvglm-class, summary.drrvglm, rrvglm.optim.control, vglm, vglm.control, TypicalVGAMfamilyFunction, CM.qnorm, cqo.

Examples

Run this code
if (FALSE) {
set.seed(111)
pneumo <- transform(pneumo, let = log(exposure.time),
                            x3 = runif(nrow(pneumo)))  # Unrelated
fit <- rrvglm(cbind(normal, mild, severe) ~ let + x3,
              multinomial, pneumo, Rank = 1, Index.corner = 2)
constraints(fit)
vcov(fit)
summary(fit)
}

Run the code above in your browser using DataLab