Learn R Programming

BioGeoBEARS (version 0.2.1)

getAIC: Calculate AIC

Description

Calculate AIC (Akaike Information Criterion). Lower values of AIC indicate some combination of better fit to the data and more parsimony in the model (fewer free parameters).

Usage

getAIC(LnL, numparams)

Arguments

LnL
The log-likelihood (typically negative, but may not be for continuous data).
numparams
The number of parameters for each model.

Value

AICval A vector of AIC results.

Details

See Burnham et al. (2002) and http://www.brianomeara.info/tutorials/aic for discussion of AIC and its uses.

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster http://www.brianomeara.info/tutorials/aic

Burnham_Anderson_2002

Matzke_2012_IBS

See Also

calc_AIC_column, calc_AIC_column

Examples

Run this code
LnL = -34.5
numparams = 2
getAIC(LnL, numparams)

LnL = -20.9
numparams = 3
getAIC(LnL, numparams)

# It turns out to work on lists, also
LnL = c(-34.5, -20.9)
numparams = c(2, 3)
getAIC(LnL, numparams)

Run the code above in your browser using DataLab