Skip to contents

Computes AIC using the fitted log likelihood and a parameter count for categorical antedependence parameters.

Usage

aic_cat(fit)

Arguments

fit

A fitted model object of class "cat_fit" returned by fit_cat.

Value

A numeric scalar AIC value.

Details

The AIC is computed as: $$AIC = -2 \times \ell + 2k$$ where \(\ell\) is the log-likelihood and \(k\) is the number of free parameters.

Examples

set.seed(1)
y <- simulate_cat(40, 5, order = 1, n_categories = 2)
fit <- fit_cat(y, order = 1)
aic_cat(fit)
#> [1] 288.5537