% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrapper_lrt.R
\name{rtmb_lrt}
\alias{rtmb_lrt}
\title{Fit a Latent Rank Theory (LRT) Model}
\usage{
rtmb_lrt(
  formula,
  k = 3,
  data = NULL,
  rank_coords = NULL,
  covariance = c("diagonal", "diagonal_equal", "full", "full_equal", "full_equal_corr"),
  magnitude = NULL,
  smoothing = NULL,
  noise = 0.01,
  prob_smoothing = FALSE,
  link = c("ordered", "sequential"),
  prior = prior_flat(),
  y_range = NULL,
  fixed = NULL,
  two_stage = FALSE,
  WAIC = FALSE,
  ...
)
}
\arguments{
\item{formula}{A formula specifying the response variable(s).}

\item{k}{Number of ranks (mixture components).}

\item{data}{A data frame containing the variables.}

\item{rank_coords}{Optional numeric vector of coordinates for each rank. Default is 1:k.}

\item{covariance}{Covariance structure: "diagonal", "diagonal_equal", "full", "full_equal", or "full_equal_corr".}

\item{magnitude}{Signal standard deviation for the GP prior. If NULL, it is estimated.}

\item{smoothing}{Length-scale for the GP prior. If NULL, it is estimated.}

\item{noise}{Measurement noise for the GP prior (default is 0.01).}

\item{prob_smoothing}{Logical; whether to apply smoothing to the class membership probabilities.}

\item{link}{Link function for class probabilities: "ordered" or "sequential".}

\item{prior}{Prior configuration: `prior_flat()`, `prior_normal()`,
`prior_weak()`, `prior_rhs()`, or `prior_ssp()`. Default is
`prior_flat()`. If `y_range` is supplied with the default flat prior,
the wrapper automatically switches to `prior_weak()`.}

\item{y_range}{Optional numeric vector or matrix defining the theoretical range (min, max) of response variables.
Specifying this automatically enables weakly informative priors if `prior` is `prior_flat()`.}

\item{fixed}{Optional named list of fixed values for specific parameters.}

\item{two_stage}{Logical; if TRUE, estimate the latent-rank measurement model
first and then estimate the rank regression with delta-method uncertainty
propagation. Currently supported for `$optimize()` only.}

\item{WAIC}{Logical; if TRUE, add pointwise `log_lik` to the generate block for WAIC.}

\item{...}{Additional arguments passed to `rtmb_model`.}
}
\value{
A \code{RTMB_Model} object.
}
\description{
Fits a Latent Rank Theory model, which is a mixture model with ordered ranks
and Gaussian Process smoothing on the mean profiles.
}
