AICvlm: Akaike's Information Criterion

View source: R/bAIC.q

AICvlmR Documentation

Akaike's Information Criterion


Calculates the Akaike information criterion for a fitted model object for which a log-likelihood value has been obtained.


    AICvlm(object, ..., corrected = FALSE, k = 2)
   AICvgam(object, ..., k = 2)
 AICrrvglm(object, ..., k = 2)
AICqrrvglm(object, ..., k = 2)
 AICrrvgam(object, ..., k = 2)



Some VGAM object, for example, having class vglm-class.


Other possible arguments fed into logLik in order to compute the log-likelihood.


Logical, perform the finite sample correction?


Numeric, the penalty per parameter to be used; the default is the classical AIC.


The following formula is used for VGLMs: -2 \mbox{log-likelihood} + k n_{par}, where n_{par} represents the number of parameters in the fitted model, and k = 2 for the usual AIC. One could assign k = \log(n) (n the number of observations) for the so-called BIC or SBC (Schwarz's Bayesian criterion). This is the function AICvlm().

This code relies on the log-likelihood being defined, and computed, for the object. When comparing fitted objects, the smaller the AIC, the better the fit. The log-likelihood and hence the AIC is only defined up to an additive constant.

Any estimated scale parameter (in GLM parlance) is used as one parameter.

For VGAMs and CAO the nonlinear effective degrees of freedom for each smoothed component is used. This formula is heuristic. These are the functions AICvgam() and AICcao().

The finite sample correction is usually recommended when the sample size is small or when the number of parameters is large. When the sample size is large their difference tends to be negligible. The correction is described in Hurvich and Tsai (1989), and is based on a (univariate) linear model with normally distributed errors.


Returns a numeric value with the corresponding AIC (or BIC, or ..., depending on k).


This code has not been double-checked. The general applicability of AIC for the VGLM/VGAM classes has not been developed fully. In particular, AIC should not be run on some VGAM family functions because of violation of certain regularity conditions, etc.


AIC has not been defined for QRR-VGLMs, yet.

Using AIC to compare posbinomial models with, e.g., posbernoulli.tb models, requires posbinomial(omit.constant = TRUE). See posbinomial for an example. A warning is given if it suspects a wrong omit.constant value was used.

Where defined, AICc(...) is the same as AIC(..., corrected = TRUE).


T. W. Yee.


Hurvich, C. M. and Tsai, C.-L. (1989). Regression and time series model selection in small samples, Biometrika, 76, 297–307.

See Also

VGLMs are described in vglm-class; VGAMs are described in vgam-class; RR-VGLMs are described in rrvglm-class; AIC, BICvlm, TICvlm, drop1.vglm, extractAIC.vglm.


pneumo <- transform(pneumo, let = log(exposure.time))
(fit1 <- vglm(cbind(normal, mild, severe) ~ let,
              cumulative(parallel = TRUE, reverse = TRUE), data = pneumo))
coef(fit1, matrix = TRUE)
AICc(fit1)  # Quick way
AIC(fit1, corrected = TRUE)  # Slow way
(fit2 <- vglm(cbind(normal, mild, severe) ~ let,
              cumulative(parallel = FALSE, reverse = TRUE), data = pneumo))
coef(fit2, matrix = TRUE)
AIC(fit2, corrected = TRUE)

VGAM documentation built on Sept. 19, 2023, 9:06 a.m.