nparamvglm.RdReturns the number of parameters in a fitted model object.
nparam(object, ...)
nparam.vlm(object, dpar = TRUE, ...)
nparam.vgam(object, dpar = TRUE, linear.only = FALSE, ...)
nparam.rrvglm(object, dpar = TRUE, ...)
nparam.drrvglm(object, dpar = TRUE, ...)
nparam.qrrvglm(object, dpar = TRUE, ...)
nparam.rrvgam(object, dpar = TRUE, ...)Some VGAM object, for example, having
class vglmff-class.
Other possible arguments fed into the function.
Logical, include any (estimated) dispersion parameters as a parameter?
Logical, include only the number of linear (parametric) parameters?
The code was copied from the AIC() methods functions.
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.
This code has not been double-checked.
VGLMs are described in vglm-class;
VGAMs are described in vgam-class;
RR-VGLMs are described in rrvglm-class;
AICvlm.
pneumo <- transform(pneumo, let = log(exposure.time))
(fit1 <- vglm(cbind(normal, mild, severe) ~ let, propodds, data = pneumo))
#>
#> Call:
#> vglm(formula = cbind(normal, mild, severe) ~ let, family = propodds,
#> data = pneumo)
#>
#>
#> Coefficients:
#> (Intercept):1 (Intercept):2 let
#> -9.676093 -10.581725 2.596807
#>
#> Degrees of Freedom: 16 Total; 13 Residual
#> Residual deviance: 5.026826
#> Log-likelihood: -25.09026
coef(fit1)
#> (Intercept):1 (Intercept):2 let
#> -9.676093 -10.581725 2.596807
coef(fit1, matrix = TRUE)
#> logitlink(P[Y>=2]) logitlink(P[Y>=3])
#> (Intercept) -9.676093 -10.581725
#> let 2.596807 2.596807
nparam(fit1)
#> [1] 3
(fit2 <- vglm(hits ~ 1, poissonff, weights = ofreq, data = V1))
#>
#> Call:
#> vglm(formula = hits ~ 1, family = poissonff, data = V1, weights = ofreq)
#>
#>
#> Coefficients:
#> (Intercept)
#> -0.07010957
#>
#> Degrees of Freedom: 6 Total; 5 Residual
#> Residual deviance: 668.7322
#> Log-likelihood: -732.5946
coef(fit2)
#> (Intercept)
#> -0.07010957
coef(fit2, matrix = TRUE)
#> loglink(lambda)
#> (Intercept) -0.07010957
nparam(fit2)
#> [1] 1
nparam(fit2, dpar = FALSE)
#> [1] 1