AIC.izip: Akaike's Information Criterion

Description Usage Arguments Details Value See Also Examples

View source: R/summarize_extract.R

Description

A function calculating Akaike's Information Criterion (AIC) based on the log-likelihood value extracted from logLik.izip, according to the formula -2log-likelihood + knpar, where npar represents the number of parameters in the fitted model, and k=2 for the usual AIC or k=log(n) (n being the number of observations) for the so-called BIC (Bayesian Information Criterion).

Usage

1
2
3
4
5
## S3 method for class 'izip'
AIC(object, ..., k = 2)

## S3 method for class 'tsizip'
AIC(object, ..., k = 2)

Arguments

object

an object class 'izip' or 'tsizip' object, obtained from a call to glm.izip or tsglm.izip.

...

other arguments passed to or from other methods (currently unused).

k

numeric: the penalty per parameter to be used; the default k = 2 is the classical AIC.

Details

When comparing models fitted by maximum likelihood to the same data, the smaller the AIC or BIC, the better the fit.

Value

A numeric value with the corresponding AIC (or BIC, or ..., depends on k).

See Also

logLik.izip, nobs.izip, glm.izip, logLik.tsizip, nobs.tsizip, tsglm.izip

Examples

1
2
3
4
5
6
7
8
9
data(bioChemists)
M_bioChem <- glm.izip(art ~ ., data = bioChemists)
# AIC
AIC(M_bioChem)

data(arson)
M_arson <- tsglm.izip(arson ~ 1, past_mean_lags = 1, past_obs_lags = c(1, 2))
# BIC
AIC(M_arson, k = log(nobs(M_arson)))

thomas-fung/izipr documentation built on Dec. 23, 2021, 9:57 a.m.