infoCriteria {asremlPlus}R Documentation

Computes AIC and BIC for models.

Description

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 is used when it is desired to compare models that differ in their fixed models.

Usage

## 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, ...)

Arguments

object

An asreml object resulting from the fitting of a model using REML or a list of asreml objects. If the components of the list are named, then those names will be used as the rownames for the returned data.frame.

DF

A numeric giving the number of estimated variance parameters. If NULL then this is determined from the information in object. This argument has been replaced by varDF, but is retained for compatibility with legacy code. It is not available with the list method.

bound.exclusions

A character specifying the bound (constraint) codes that will result in a variance parameter being excluded from the count of estimated variance parameters. If set to NULL then none will be excluded.

IClikelihood

A character specifying whether Restricted Maximum Likelihood (REML) or the full likelihood (full) are to be used in calculating the information criteria.

fixedDF

A numeric giving the number of estimated fixed parameters. If NULL then this is determined from the information in object. For object a list only a single value that is used for all components of the list has been implemented.

varDF

A numeric giving the number of estimated variance parameters. If NULL then this is determined from the information in object. It replaces the DF argument. For object a list only a single value that is used for all components of the list has been implemented.

...

Provision for passsing arguments to functions called internally - not used at present.

Details

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 adaption of the code supplied in File S1 of Verbyla (2019). The log-likeliood 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.

Value

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). If object is a list and its components are named, then those names will be used to set the rownames of the data.frame.

Author(s)

Chris Brien

References

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. doi: 10.1111/anzs.12254.

See Also

REMLRT.asreml, changeTerms.asrtests, changeModelOnIC.asrtests

Examples

## Not run: 
   data(Wheat.dat)
   ## Fit several models to the wheat data and caclulate 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)

[Package asremlPlus version 4.2-32 Index]