% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bic_cat.R, R/bic_gau.R, R/bic_inad.R
\name{bic_cat}
\alias{bic_cat}
\alias{aic_cat}
\alias{bic_gau}
\alias{aic_gau}
\alias{bic_inad}
\alias{aic_inad}
\title{Bayesian and Akaike Information Criteria for Antedependence Fits}
\usage{
bic_cat(fit, n_subjects = NULL)

aic_cat(fit)

bic_gau(fit, n_subjects = NULL)

aic_gau(fit)

bic_inad(fit, n_subjects = NULL)

aic_inad(fit)
}
\arguments{
\item{fit}{A fitted model object returned by \code{\link{fit_gau}},
\code{\link{fit_cat}}, or \code{\link{fit_inad}}.}

\item{n_subjects}{Number of subjects, typically \code{nrow(y)}. If
\code{NULL}, inferred from \code{fit$settings$n_subjects}.}
}
\value{
A numeric scalar BIC or AIC value.
}
\description{
Compute BIC or AIC for a fitted Gaussian, categorical, or INAD
antedependence model. Since \code{logLik()} methods are registered for all three
fit classes, \code{stats::AIC()} and \code{stats::BIC()} generics also work directly
and are preferred.
}
\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.

The AIC is computed as:
\deqn{AIC = -2 \times \ell + 2k}
}
\examples{
set.seed(1)
y <- simulate_gau(n_subjects = 30, n_time = 5, order = 1, phi = 0.3)
fit <- fit_gau(y, order = 1)
bic_gau(fit, n_subjects = nrow(y))
aic_gau(fit)
}
