% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bic_cat.R
\name{bic_cat}
\alias{bic_cat}
\title{Bayesian information criterion for fitted categorical AD models}
\usage{
bic_cat(fit, n_subjects = NULL)
}
\arguments{
\item{fit}{A fitted model object of class \code{"cat_fit"} returned by
\code{\link{fit_cat}}.}

\item{n_subjects}{Number of subjects. If NULL, extracted from fit.}
}
\value{
A numeric scalar BIC value.
}
\description{
Computes BIC using the fitted log likelihood and a parameter count for
categorical antedependence parameters.
}
\details{
The BIC is computed as:
\deqn{BIC = -2 \times \ell + k \times \log(N)}
where \eqn{\ell} is the log-likelihood, \eqn{k} is the number of free parameters,
and \eqn{N} is the number of subjects.
}
\examples{
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))

}
