constraints(object, ...)
vglmff-class
.type
.
For vglm
and vgam
objects,
feeding in the "lm"
-type constraint matrices back
into the same model should work and give an identical model.
The default are the "vlm"
-type constraint matrices.
See the constraints
argument of vglm
,
and the example below.
VGLMs and VGAMs have constraint matrices which are known. The class of RR-VGLMs have constraint matrices which are unknown and are to be estimated.
Yee, T. W. and Hastie, T. J. (2003) Reduced-rank vector generalized linear models. Statistical Modelling, 3, 15--41.
vglm-class
;
RR-VGLMs are described in rrvglm-class
.
Arguments such as zero
and parallel
found in many zero
.
See CommonVGAMffArguments
for more information.
# Fit the proportional odds model:
pneumo <- transform(pneumo, let = log(exposure.time))
(fit1 <- vglm(cbind(normal, mild, severe) ~ bs(let, 3),
cumulative(parallel = TRUE, reverse = TRUE), pneumo))
coef(fit1, matrix = TRUE)
constraints(fit1) # Parallel assumption results in this
constraints(fit1, type = "vlm") # This is the same as the default ("vlm"-type)
# An equivalent model to fit1 (needs the type "lm" constraints):
clist.lm <- constraints(fit1, type = "lm") # The "lm"-type constraints
(fit2 <- vglm(cbind(normal, mild, severe) ~ bs(let, 3),
cumulative(reverse = TRUE), pneumo, constraints = clist.lm))
abs(max(coef(fit1, matrix = TRUE) -
coef(fit2, matrix = TRUE))) # Should be zero
# Fit a rank-1 stereotype (RR-multinomial logit) model:
data(car.all)
fit <- rrvglm(Country ~ Width + Height + HP, multinomial, car.all, Rank = 1)
constraints(fit) # All except the first are the estimated A matrix
Run the code above in your browser using DataLab