Learn R Programming

VGAM (version 1.0-2)

nparam.vlm: Number of Parameters

Description

Returns the number of parameters in a fitted model object.

Usage

nparam(object, ...) nparam.vlm(object, dpar = TRUE, ...) nparam.vgam(object, dpar = TRUE, linear.only = FALSE, ...) nparam.rrvglm(object, dpar = TRUE, ...) nparam.qrrvglm(object, dpar = TRUE, ...) nparam.rrvgam(object, dpar = TRUE, ...)

Arguments

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

...
Other possible arguments fed into the function.

dpar
Logical, include any (estimated) dispersion parameters as a parameter?

linear.only
Logical, include only the number of linear (parametric) parameters?

Value

Returns a numeric value with the corresponding number of parameters. For vgam objects, this may be real rather than integer, because the nonlinear degrees of freedom is real-valued.

Warning

This code has not been double-checked.

Details

The code was copied from the AIC() methods functions.

See Also

VGLMs are described in vglm-class; VGAMs are described in vgam-class; RR-VGLMs are described in rrvglm-class; AICvlm.

Examples

Run this code
pneumo <- transform(pneumo, let = log(exposure.time))
(fit1 <- vglm(cbind(normal, mild, severe) ~ let, propodds, data = pneumo))
coef(fit1)
coef(fit1, matrix = TRUE)
nparam(fit1)
(fit2 <- vglm(hits ~ 1, quasipoissonff, weights = ofreq, data = V1))
coef(fit2)
coef(fit2, matrix = TRUE)
nparam(fit2)
nparam(fit2, dpar = FALSE)

Run the code above in your browser using DataLab