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

\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 value.
}
\description{
Computes BIC using the fitted log likelihood and a parameter count that
respects identifiability constraints for the Gaussian 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.

This function applies to Gaussian AD fits from \code{\link{fit_gau}}.
For categorical and INAD models, use \code{\link{bic_cat}} and
\code{\link{bic_inad}}.
}
\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))
}
