% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lrt_order_inad.R
\name{bic_order_inad}
\alias{bic_order_inad}
\title{BIC-based order selection for INAD models}
\usage{
bic_order_inad(
  y,
  max_order = 2,
  thinning = "binom",
  innovation = "pois",
  blocks = NULL,
  ...
)
}
\arguments{
\item{y}{Integer matrix.}

\item{max_order}{Maximum order (1 or 2).}

\item{thinning}{Thinning operator.}

\item{innovation}{Innovation distribution.}

\item{blocks}{Optional block assignments.}

\item{...}{Additional arguments.}
}
\value{
A list with class \code{"bic_order_inad"} containing:
\describe{
\item{fits}{List of fitted INAD models by candidate order}
\item{bic}{Named numeric vector of BIC values by order}
\item{best_order}{Order with minimum BIC}
\item{table}{Data frame with order, logLik, n_params, and BIC}
\item{settings}{Input and derived settings used for selection}
}
}
\description{
Fits INAD models across candidate orders and reports BIC-based selection.
}
\examples{
\donttest{
set.seed(1)
y <- simulate_inad(
  n_subjects = 30,
  n_time = 5,
  order = 1,
  thinning = "binom",
  innovation = "pois",
  alpha = 0.3,
  theta = 2
)
ord <- bic_order_inad(y, max_order = 2, thinning = "binom", innovation = "pois", max_iter = 10)
ord$best_order
}
}
