getAIC: Calculate AIC

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/BioGeoBEARS_generics_v1.R

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

1
  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.

Details

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

Value

AICval A vector of AIC results.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

Example output

Loading required package: rexpokit
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

The following object is masked from 'package:ape':

    edges

[1] 73
[1] 47.8
[1] 73.0 47.8

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.