Extracts the number of IRLS iterations
performed for a VGLM object.
Usage
niters(object, ...)
niters.vlm(object, history = FALSE, ...)
Arguments
- object
A vglm object.
Currently a vgam object
is accepted but the correct value
is not returned.
- history
Logical, if TRUE it returns the
convergence history with respect to the
criterion, e.g.,
vglm.control()[["criterion"]].
- ...
Currently unused.
Details
The number of
iteratively reweighted least squares (IRLS)
iterations needed for convergence
(or non-convergence) does say something
about the model.
Since Fisher scoring has a linear convergence
rate in general, it should take no more than
10 iterations, say, for successful
convergence. Much more indicates potential
problems, e.g.,
a large disagreement between data and the
specified model.
Value
A non-negative integer by default.
If history = TRUE then a matrix.
Note
Step-halving may or may not affect the answer.
Examples
fit <- vglm(rpois(9, 2) ~ 1, poissonff, crit = "c")
niters(fit)
#> [1] 5
niters(fit, history = TRUE)
#> (Intercept)
#> [1,] 1.1487308
#> [2,] 0.9941679
#> [3,] 0.9809178
#> [4,] 0.9808293
#> [5,] 0.9808293