akaikeInfoCriterion

fun akaikeInfoCriterion(numParameters: Int, lnMax: Double): Double(source)

Computes Akaike's information criterion (AIC) from the number of parameters estimated for the model numParameters and the maximized value lnMax of the log-likelihood function of the model. That is, 2p - 2L, for p parameters and maximized log-likelihood L. Smaller is better. The penalty 2p grows by 2 for each additional parameter, which is what makes the criterion trade fit against complexity.

Unlike the other information criteria, the plain criterion does not depend on the sample size. For a small-sample corrected form that does, see akaikeInfoCriterionCorrected.


fun akaikeInfoCriterion(sampleSize: Int, numParameters: Int, lnMax: Double): Double(source)

Deprecated

AIC does not depend on the sample size. Use the two-argument form.

Replace with

Statistic.akaikeInfoCriterion(numParameters, lnMax)

Computes Akaike's information criterion (AIC) from the number of parameters estimated for the model numParameters and the maximized value lnMax of the log-likelihood function of the model. The sampleSize is validated but otherwise unused: AIC does not depend on it.

Retained only so that code written against R1.5 and earlier still compiles. Note that the value returned has changed: through R1.5 the penalty was the ratio (n - 2p + 2)/(n - p + 1), which lies in (0, 1] and shrinks as parameters are added, so the criterion fell as the model grew rather than rising. Callers that ranked models by it were ranking by log-likelihood alone, with a small bonus for complexity.