Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

nIter

Return number of iterations for iterative models


Description

Returns the number of iterations for iterative models. The default method assumes presence of a component iterations in x.

Usage

nIter(x, ...)
## Default S3 method:
nIter(x, ...)

Arguments

x

a statistical model, or a result of maximisation, created by maxLik, maxNR or another optimizer.

...

further arguments for methods

Details

This is a generic function. The default method returns the component x$iterations.

Value

numeric, number of iterations. Note that ‘iteration’ may mean different things for different optimizers.

Author(s)

Ott Toomet

See Also

Examples

## Estimate the exponential distribution parameter:
t <- rexp(100, 2)
loglik <- function(theta) sum(log(theta) - theta*t)
## Estimate with numeric gradient and numeric Hessian
a <- maxNR(loglik, start=1)
nIter(a)

maxLik

Maximum Likelihood Estimation and Related Tools

v1.4-8
GPL (>= 2)
Authors
Ott Toomet <otoomet@gmail.com>, Arne Henningsen <arne.henningsen@gmail.com>, with contributions from Spencer Graves and Yves Croissant
Initial release
2021-03-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.