% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_ctsem.R
\name{ild_ctsem}
\alias{ild_ctsem}
\title{Fit a continuous-time state-space model via ctsem}
\usage{
ild_ctsem(
  data,
  outcome,
  ct_model = NULL,
  model_type = c("stanct", "ctfit"),
  id_col = ".ild_id",
  time_col = ".ild_time_num",
  time_scale = 1,
  ...
)
}
\arguments{
\item{data}{An object that passes [validate_ild()] (typically after [ild_prepare()]).}

\item{outcome}{Character name of numeric outcome column.}

\item{ct_model}{Optional ctsem model object. If \code{NULL}, a conservative
default model is created: for \code{model_type = "stanct"}, \code{ctsem::ctModel(type = "ct", ...)}
with one manifest loading on one latent; for \code{"ctfit"}, \code{type = "omx"} with
\code{Tpoints = max(rows per id, 2)} from the prepared long data (custom \code{ct_model}
may still be needed for irregular designs).}

\item{model_type}{Character. \code{"stanct"} (default) or \code{"ctfit"}.}

\item{id_col}{Person-id column in \code{data} (default \code{".ild_id"}).}

\item{time_col}{Continuous-time index column in \code{data}
(default \code{".ild_time_num"}).}

\item{time_scale}{Optional positive scalar to rescale \code{time_col}
before fitting (default \code{1}).}

\item{...}{Passed to \code{ctsem::ctStanFit()} or \code{ctsem::ctFit()}.}
}
\value{
An object of class \code{c("ild_fit_ctsem", "ild_fit_model", "ild_analysis")}.
  Attributes \code{ild_data} and \code{ild_provenance} are attached.
}
\description{
First-class tidyILD wrapper for \pkg{ctsem}. This backend is designed for
irregularly spaced ILD where continuous-time dynamics are preferable to
discrete-time approximations.
}
\details{
v1 focuses on a conservative single-outcome pathway with explicit class,
provenance, and diagnostics compatibility. Users may supply a custom ctsem
model object; otherwise a simple 1-manifest local-level style template is used.
}
\seealso{
[ild_tidy()], [ild_augment()], [ild_diagnose()], [ild_autoplot()].
}
