R: Custom Computation of AIC, AICc, QAIC, and QAICc from...
AICcCustom
R Documentation
Custom Computation of AIC, AICc, QAIC, and QAICc from User-supplied
Input
Description
This function computes Akaike's information criterion (AIC), the
second-order AIC (AICc), as well as their quasi-likelihood
counterparts (QAIC, QAICc) from user-supplied input instead of
extracting the values automatically from a model object. This
function is particularly useful for output imported from other
software.
logical. If FALSE, the function returns the information
criterion specified. If TRUE, the function returns K (number
of estimated parameters) for a given model.
second.ord
logical. If TRUE, the function returns the second-order Akaike
information criterion (i.e., AICc).
nobs
the sample size required to compute the AICc or QAICc.
c.hat
value of overdispersion parameter (i.e., variance inflation factor)
such as that obtained from c_hat. Note that values of
c.hat different from 1 are only appropriate for binomial GLM's
with trials > 1 (i.e., success/trial or cbind(success, failure)
syntax), with Poisson GLM's, single-season or dynamic occupancy
models (MacKenzie et al. 2002, 2003), N-mixture models (Royle
2004, Dail and Madsen 2011), or capture-mark-recapture models (e.g.,
Lebreton et al. 1992). If c.hat > 1, AICc will return the
quasi-likelihood analogue of the information criterion requested.
Details
AICc computes one of the following four information criteria:
Akaike's information criterion (AIC, Akaike 1973), the second-order
or small sample AIC (AICc, Sugiura 1978, Hurvich and Tsai 1991), the
quasi-likelihood AIC (QAIC, Burnham and Anderson 2002), and the
quasi-likelihood AICc (QAICc, Burnham and Anderson 2002).
Value
AICc returns the AIC, AICc, QAIC, or QAICc, or the number of
estimated parameters, depending on the values of the arguments.
Note
The actual (Q)AIC(c) values are not really interesting in themselves,
as they depend directly on the data, parameters estimated, and
likelihood function. Furthermore, a single value does not tell much
about model fit. Information criteria become relevant when compared
to one another for a given data set and set of candidate models.
Author(s)
Marc J. Mazerolle
References
Akaike, H. (1973) Information theory as an extension of the maximum
likelihood principle. In: Second International Symposium on
Information Theory, pp. 267–281. Petrov, B.N., Csaki, F., Eds,
Akademiai Kiado, Budapest.
Burnham, K. P., Anderson, D. R. (2002) Model Selection and
Multimodel Inference: a practical information-theoretic
approach. Second edition. Springer: New York.
Dail, D., Madsen, L. (2011) Models for estimating abundance from
repeated counts of an open population. Biometrics67,
577–587.
Hurvich, C. M., Tsai, C.-L. (1991) Bias of the corrected AIC
criterion for underfitted regression and time series
models. Biometrika78, 499–509.
Lebreton, J.-D., Burnham, K. P., Clobert, J., Anderson, D. R. (1992)
Modeling survival and testing biological hypotheses using marked
animals: a unified approach with case-studies. Ecological
Monographs62, 67–118.
MacKenzie, D. I., Nichols, J. D., Lachman, G. B., Droege, S., Royle,
J. A., Langtimm, C. A. (2002) Estimating site occupancy rates when
detection probabilities are less than one. Ecology83,
2248–2255.
MacKenzie, D. I., Nichols, J. D., Hines, J. E., Knutson, M. G.,
Franklin, A. B. (2003) Estimating site occupancy, colonization, and
local extinction when a species is detected imperfectly. Ecology84, 2200–2207.
Royle, J. A. (2004) N-mixture models for estimating population
size from spatially replicated counts. Biometrics60,
108–115.
Sugiura, N. (1978) Further analysis of the data by Akaike's
information criterion and the finite corrections. Communications
in Statistics: Theory and MethodsA7, 13–26.
##cement data from Burnham and Anderson (2002, p. 101)
data(cement)
##run multiple regression - the global model in Table 3.2
glob.mod <- lm(y ~ x1 + x2 + x3 + x4, data = cement)
##extract log-likelihood
LL <- logLik(glob.mod)[1]
##extract number of parameters
K.mod <- coef(glob.mod) + 1
##compute AICc with full likelihood
AICcCustom(LL, K.mod, nobs = nrow(cement))
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(AICcmodavg)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/AICcmodavg/AICcCustom.Rd_%03d_medium.png", width=480, height=480)
> ### Name: AICcCustom
> ### Title: Custom Computation of AIC, AICc, QAIC, and QAICc from
> ### User-supplied Input
> ### Aliases: AICcCustom
> ### Keywords: models
>
> ### ** Examples
>
> ##cement data from Burnham and Anderson (2002, p. 101)
> data(cement)
> ##run multiple regression - the global model in Table 3.2
> glob.mod <- lm(y ~ x1 + x2 + x3 + x4, data = cement)
>
> ##extract log-likelihood
> LL <- logLik(glob.mod)[1]
>
> ##extract number of parameters
> K.mod <- coef(glob.mod) + 1
>
> ##compute AICc with full likelihood
> AICcCustom(LL, K.mod, nobs = nrow(cement))
(Intercept) x1 x2 x3 x4
21.76728 60.85642 57.57978 56.46556 55.83366
>
>
>
>
>
> dev.off()
null device
1
>