AIC
Akaike's Information Criterion

Description

Calculate Akaike's Information Criterion (AIC) or the Bayesian Information Criterion (BIC) for a fitted model with a log-likelihood.

Usage

AIC(object, ..., k = 2)
## Default S3 method:
AIC(object, ..., k = 2)
## S3 method for class 'logLik':
AIC(object, ..., k = 2)
BIC(object, ...)
## Default S3 method:
BIC(object, ...)
## S3 method for class 'logLik':
BIC(object, ...)

Arguments

object an object inheriting from fitted model or class, which has a log-likelihood value that can be extracted.
... additional arguments to be passed to or from other functions.
k a numeric value, use as penalty coefficient for number of parameters in the fitted model.

Details

AIC is computed as -2*log-likelihood + k*npar, where npar represents the number of parameters in the fitted model.
BIC is computed as log-likelihood + npar*log(nobs), where npar represents the number of parameters and nobs the number of observations in the fitted model.
Value
a numeric value with the corresponding AIC or BIC value if just one object is provided to AIC or BIC. If more than one object is provided, a data frame is returned with row names corresponding to the objects and columns with df (degrees of freedom) and AIC or BIC.
AIC.logLik, BIC.logLik return the AIC or BIC value computed from the provided log-likelihood.
References
Sakamoto, Y., Ishiguro, M., and Kitagawa G. 1986. Akaike Information Criterion Statistics. Tokyo, JP: KTK Scientific Publishers.
See Also
logLik, extractAIC, nobs.
Examples
m1 <- lm(Fuel ~ Disp. + Weight, data=Sdatasets::fuel.frame)
AIC(m1)
BIC(m1)

m2 <- lm(Fuel ~ Disp. + Weight + Type, data=Sdatasets::fuel.frame) AIC(m1, m2) BIC(m1, m2)

AIC(logLik(m1)) BIC(logLik(m1))

Package stats version 6.1.1-7
Package Index