% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ild_generics.R, R/ild_kfas_diagnose.R,
%   R/ild_diagnose_methods.R
\name{ild_diagnose}
\alias{ild_diagnose}
\alias{ild_diagnose.ild_fit_kfas}
\alias{ild_diagnose.lmerMod}
\alias{ild_diagnose.lme}
\alias{ild_diagnose.brmsfit}
\alias{ild_diagnose.ild_fit_ctsem}
\alias{ild_diagnose.default}
\title{Engine-agnostic diagnostics façade}
\usage{
ild_diagnose(object, ...)

\method{ild_diagnose}{ild_fit_kfas}(object, data = NULL, type = NULL, by_id = NULL, ...)

\method{ild_diagnose}{lmerMod}(
  object,
  data = NULL,
  type = c("residual_acf", "residual_time", "qq"),
  by_id = TRUE,
  missing_model = FALSE,
  missing_model_predictors = NULL,
  causal_detail = FALSE,
  balance = FALSE,
  balance_treatment = NULL,
  balance_covariates = NULL,
  balance_weights_col = ".ipw_treat",
  balance_by_occasion = FALSE,
  ...
)

\method{ild_diagnose}{lme}(
  object,
  data = NULL,
  type = c("residual_acf", "residual_time", "qq"),
  by_id = TRUE,
  missing_model = FALSE,
  missing_model_predictors = NULL,
  causal_detail = FALSE,
  balance = FALSE,
  balance_treatment = NULL,
  balance_covariates = NULL,
  balance_weights_col = ".ipw_treat",
  balance_by_occasion = FALSE,
  ...
)

\method{ild_diagnose}{brmsfit}(
  object,
  data = NULL,
  type = c("all", "convergence", "sampler", "ppc"),
  by_id = TRUE,
  ppc_ndraws = 500L,
  missing_model = FALSE,
  missing_model_predictors = NULL,
  causal_detail = FALSE,
  balance = FALSE,
  balance_treatment = NULL,
  balance_covariates = NULL,
  balance_weights_col = ".ipw_treat",
  balance_by_occasion = FALSE,
  ...
)

\method{ild_diagnose}{ild_fit_ctsem}(
  object,
  data = NULL,
  type = NULL,
  by_id = NULL,
  missing_model = FALSE,
  missing_model_predictors = NULL,
  causal_detail = FALSE,
  balance = FALSE,
  balance_treatment = NULL,
  balance_covariates = NULL,
  balance_weights_col = ".ipw_treat",
  balance_by_occasion = FALSE,
  ...
)

\method{ild_diagnose}{default}(object, ...)
}
\arguments{
\item{object}{A fitted model.}

\item{...}{Reserved.}

\item{data}{Optional ILD data (defaults to \code{attr(object, "ild_data")}).}

\item{type}{Residual diagnostic types for \code{lmerMod}/\code{lme} (passed to [ild_diagnostics()]).
For \code{brmsfit}: \code{"all"} or any of \code{"convergence"}, \code{"sampler"}, \code{"ppc"}.}

\item{by_id}{For \code{lmerMod}/\code{lme}: ACF by person.}

\item{missing_model}{If \code{TRUE}, fit \code{\link{ild_missing_model}} for the response (optional; can be slow). Requires at least one predictor.}

\item{missing_model_predictors}{Character vector for \code{ild_missing_model}; default \code{NULL} uses formula predictors.}

\item{causal_detail}{If \code{TRUE}, add extra quantile summaries for \code{.ipw} when present.}

\item{balance}{If \code{TRUE}, add weighted covariate balance (SMD) and ESS to \code{causal$balance}
when \code{balance_covariates} and \code{balance_treatment} are set.}

\item{balance_treatment}{Character. Binary treatment column for balance (required if \code{balance = TRUE}).}

\item{balance_covariates}{Character vector of covariate columns for SMDs (required if \code{balance = TRUE}).}

\item{balance_weights_col}{Weights column for balance (default \code{".ipw_treat"}; use \code{".ipw"} for joint MSM).}

\item{balance_by_occasion}{If \code{TRUE}, balance and ESS are stratified by \code{.ild_seq}.}

\item{ppc_ndraws}{For \code{brmsfit}: posterior predictive draws.}
}
\value{
An \code{\link{ild_diagnostics_bundle}}.
}
\description{
Returns a single \code{\link{ild_diagnostics_bundle}} for \code{lmerMod}, \code{lme},
\code{brmsfit}, \code{ild_fit_kfas}, and \code{ild_fit_ctsem}.
Sections are parallel across engines;
see \code{?ild_diagnostics_bundle}. Residual ACF/Q-Q for frequentist models are stored in
\code{residual$legacy_ild_diagnostics} for [plot_ild_diagnostics()]. For raw residual-only
computation without the bundle, call [ild_diagnostics()] directly.
}
\details{
**Building blocks:** the same analyses are available as standalone functions
([ild_design_check()], [ild_missing_pattern()], etc.); see [ild_diagnostics_utilities].
}
\seealso{
\code{\link{ild_autoplot}}, \code{\link{ild_diagnostics_bundle}},
  \code{\link{guardrail_registry}}, \code{\link{ild_diagnostics_utilities}},
  \code{\link{ild_diagnostics}}
}
