infoCriteria | R Documentation |
Computes Akiake and Bayesian (Schwarz) Information Criteria for models.
Either the Restricted Maximum likelihood (REML
) or the full likelihood
(full
) can be used. The full likelihood, evaluated using REML estimates
is used when it is desired to compare models that differ in their fixed models.
## S3 method for class 'asreml'
infoCriteria(object, DF = NULL,
bound.exclusions = c("F","B","S","C"),
IClikelihood = "REML", fixedDF = NULL, varDF = NULL, ...)
## S3 method for class 'list'
infoCriteria(object, bound.exclusions = c("F","B","S","C"),
IClikelihood = "REML", fixedDF = NULL, varDF = NULL, ...)
object |
An |
DF |
A |
bound.exclusions |
A |
IClikelihood |
A |
fixedDF |
A |
varDF |
A |
... |
Provision for passing arguments to functions called internally - not used at present. |
The variance degrees of freedom (varDF) are the number of number of variance parameters that
have been estimated, excluding those whose estimates have a code for bound
specified in bound.exclusions
. If varDF
is not NULL
, the supplied value
is used. Otherwise varDF
is determined from the information in object
,
i.e. if object
is an asreml
object then from it, or if object
is a
list
then from each asreml
object in the list
.
Similarly, the fixed degrees of freedom (fixedDF) are the number of number of fixed parameters
that have been estimated, any coefficients that have the value NA
being excluded.
If fixedDF
is not NULL
, the supplied value is used. Otherwise fixedDF
is determined from the information in object
.
If ASReml-R version 4 is being used then the codes specified in bound.exclusions
are
not restricted to a subset of the default codes, but a warning is issued if a code other
than these is specified.
For ASReml-R version 3, only a subset of the default codes are allowed:
F
(Fixed
), B
(Boundary
), C
(Constrained
) and
S
(Singular
).
The calculation of the information criteria is an adaptation of the code supplied in File S1
of Verbyla (2019). The log-likelihood is calculated as
loglik = log(REML) - log(|C|)/2
,
where C is the inverse coefficient matrix; the term involving C is omitted for REML
.
The AIC is calculated as - 2 * loglik + 2 * (varDF + fixedDF)
and the BIC as - 2 * loglik + (fixedDF + varDF) * log(n - r + fixedDF)
,
where n
is the number of observations and r
is the rank of the fixed effects
design matrix. For REML
, fixedDF = 0
.
A data.frame
containing the numbers of estimated fixed (fixedDF) and variance (varDF)
parameters, the number of bound parameters (NBound), AIC, BIC and the value of the
log-likelihood (loglik). All elements of the data.frame
will be set to NA
for the invalid combinations of family and dispersion as noted in the IClikelihood
argument.
If object
is a list
and its components are named, then those names will be used to
set the rownames
of the data.frame
.
Chris Brien
Verbyla, A. P. (2019). A note on model selection using information criteria for general linear models estimated using REML. Australian & New Zealand Journal of Statistics, 61, 39–50. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1111/anzs.12254")}.
REMLRT.asreml
, changeTerms.asrtests
, changeModelOnIC.asrtests
## Not run:
data(Wheat.dat)
## Fit several models to the wheat data and calculate their ICs
# Fit initial model
m.max <- asreml(yield ~ Rep + WithinColPairs + Variety,
random = ~ Row + Column + units,
residual = ~ ar1(Row):ar1(Column),
data=Wheat.dat)
infoCriteria(m.max.asr, IClikelihood = "full")
#Drop term for within Column pairs
m1 <- asreml(yield ~ Rep + Variety,
random = ~ Row + Column + units,
residual = ~ ar1(Row):ar1(Column),
data=Wheat.dat)
#Drop nugget term
m2 <- asreml(yield ~ Rep + WithinColPairs + Variety,
random = ~ Row + Column,
residual = ~ ar1(Row):ar1(Column),
data=Wheat.dat)
#Drop Row autocorrelation
m3 <- asreml(yield ~ Rep + WithinColPairs + Variety,
random = ~ Row + Column + units,
residual = ~ Row:ar1(Column),
data=Wheat.dat)
#Drop Col autocorrelation
m4 <- asreml(yield ~ Rep + WithinColPairs + Variety,
random = ~ Row + Column + units,
residual = ~ ar1(Row):Column,
data=Wheat.dat)
mods.asr <- list(m.max, m1, m2, m3, m4)
infoCriteria(mods.asr, IClikelihood = "full")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.