| Line 1... |
Line 1... |
| 1 |
% File src/library/stats/man/AIC.Rd
|
1 |
% File src/library/stats/man/AIC.Rd
|
| 2 |
% Part of the R package, http://www.R-project.org
|
2 |
% Part of the R package, http://www.R-project.org
|
| 3 |
% Copyright 1995-2012 R Core Team
|
3 |
% Copyright 1995-2013 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{AIC}
|
6 |
\name{AIC}
|
| 7 |
\encoding{UTF-8}
|
7 |
\encoding{UTF-8}
|
| 8 |
\alias{AIC}
|
8 |
\alias{AIC}
|
| Line 31... |
Line 31... |
| 31 |
\item{\dots}{optionally more fitted model objects.}
|
31 |
\item{\dots}{optionally more fitted model objects.}
|
| 32 |
\item{k}{numeric, the \emph{penalty} per parameter to be used; the
|
32 |
\item{k}{numeric, the \emph{penalty} per parameter to be used; the
|
| 33 |
default \code{k = 2} is the classical AIC.}
|
33 |
default \code{k = 2} is the classical AIC.}
|
| 34 |
}
|
34 |
}
|
| 35 |
\details{
|
35 |
\details{
|
| - |
|
36 |
When comparing models fitted by maximum likelihood to the same data,
|
| - |
|
37 |
the smaller the AIC or BIC, the better the fit.
|
| - |
|
38 |
|
| - |
|
39 |
The theory of AIC requires that the log-likelihood has been maximized:
|
| - |
|
40 |
whereas AIC can be computed for models not fitted by maximum
|
| - |
|
41 |
likelihood, their AIC values should not be compared.
|
| - |
|
42 |
|
| - |
|
43 |
Examples of models not \sQuote{fitted to the same data} are where the
|
| - |
|
44 |
response is transformed (accelerated-life models are fitted to
|
| - |
|
45 |
log-times) and where contingency tables have been used to summarize
|
| - |
|
46 |
data.
|
| - |
|
47 |
|
| 36 |
These are generic functions (with S4 generics defined in package
|
48 |
These are generic functions (with S4 generics defined in package
|
| 37 |
\pkg{stats4}): however methods should be defined for the
|
49 |
\pkg{stats4}): however methods should be defined for the
|
| 38 |
log-likelihood function \code{\link{logLik}} rather than these
|
50 |
log-likelihood function \code{\link{logLik}} rather than these
|
| 39 |
functions: the action of their default methods is to call \code{logLik}
|
51 |
functions: the action of their default methods is to call \code{logLik}
|
| 40 |
on all the supplied objects and assemble the results.
|
52 |
on all the supplied objects and assemble the results. Note that in
|
| 41 |
|
- |
|
| 42 |
When comparing fitted objects, the smaller the AIC or BIC, the better
|
53 |
several common cases \code{\link{logLik}} does not return the value at
|
| 43 |
the fit.
|
54 |
the MLE: see its help page.
|
| 44 |
|
55 |
|
| 45 |
The log-likelihood and hence the AIC/BIC is only defined up to an
|
56 |
The log-likelihood and hence the AIC/BIC is only defined up to an
|
| 46 |
additive constant. Different constants have conventionally be used
|
57 |
additive constant. Different constants have conventionally been used
|
| 47 |
for different purposes and so \code{\link{extractAIC}} and \code{AIC}
|
58 |
for different purposes and so \code{\link{extractAIC}} and \code{AIC}
|
| 48 |
may give different values (and do for models of class \code{"lm"}: see
|
59 |
may give different values (and do for models of class \code{"lm"}: see
|
| 49 |
the help for \code{\link{extractAIC}}). Particular care is needed
|
60 |
the help for \code{\link{extractAIC}}). Particular care is needed
|
| 50 |
when comparing fits of different classes (with, for example, a
|
61 |
when comparing fits of different classes (with, for example, a
|
| 51 |
comparison of a Poisson and gamma GLM being meaningless since one has
|
62 |
comparison of a Poisson and gamma GLM being meaningless since one has
|