hzar.AIC.default: Calculate the AIC score.

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

View source: R/40-hzarPostProcessing.R

Description

Calculate the AIC or the corrected AIC (AICc) for the given likelihood, number of parameters and number of observations.

Extracts the parameters as needed when passed the correct hzar object.

Usage

1
2
3
4
5
6
hzar.AIC.default(maxLL, param.count)
hzar.AICc.default(maxLL, param.count, nObs)
hzar.AIC.hzar.cline(cline)
hzar.AICc.hzar.cline(cline,nObs)
hzar.AIC.hzar.dataGroup(dataGroup)
hzar.AICc.hzar.dataGroup(dataGroup)

Arguments

maxLL

The maximum log likelihood value.

param.count

The number of free parameters, also known as the number of degrees of freedom.

nObs

The number of samples observed.

cline

A hzar.cline object.

dataGroup

A hzar.dataGroup object.

Details

The formula for AIC used is 2 * (param.count - maxLL).

The formula for AICc used is: AIC + 2 * param.count * (param.count + 1) / (nObs - param.count - 1)

Value

The AIC or AICc score calculated.

Author(s)

Graham Derryberry asterion@alum.mit.edu

See Also

AIC hzar.AIC.hzar.obsDataGroup

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
print(hzar.AIC.default(-8,3))
print(hzar.AICc.default(-8,3,30))

data(manakinMolecular);
mknAdaA <-
  hzar.doMolecularData1DPops(manakinMolecular$distance,
                             manakinMolecular$ada.A,
                             manakinMolecular$ada.nSamples);
hzar.plot.obsData(mknAdaA);
mknAdaAmodel <-
  hzar.makeCline1DFreq(mknAdaA, scaling="fixed",tails="none");
mknAdaAmodel <-
  hzar.model.addBoxReq(mknAdaAmodel,-30,600);
mknAdaAmodelFitR <-
   hzar.first.fitRequest.old.ML(model=mknAdaAmodel ,
                                mknAdaA,
                                verbose=FALSE);
print(hzar.AIC.hzar.dataGroup(hzar.fit2DataGroup(mknAdaAmodelFitR)))

mknAdaAcline <- hzar.gen.cline(list(center=300,width=10),
                               mknAdaAmodelFitR);

print(hzar.AIC.hzar.cline(mknAdaAcline));

hzar documentation built on May 2, 2019, 7 a.m.