| bic_cat | R Documentation |
Computes BIC using the fitted log likelihood and a parameter count for categorical antedependence parameters.
bic_cat(fit, n_subjects = NULL)
fit |
A fitted model object of class |
n_subjects |
Number of subjects. If NULL, extracted from fit. |
The BIC is computed as:
BIC = -2 \times \ell + k \times \log(N)
where \ell is the log-likelihood, k is the number of free parameters,
and N is the number of subjects.
A numeric scalar BIC value.
set.seed(1)
y <- simulate_cat(40, 5, order = 1, n_categories = 2)
# Fit models of different orders
fit0 <- fit_cat(y, order = 0)
fit1 <- fit_cat(y, order = 1)
fit2 <- fit_cat(y, order = 2)
# Compare BIC
c(BIC_0 = bic_cat(fit0), BIC_1 = bic_cat(fit1), BIC_2 = bic_cat(fit2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.