% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simstudy.R
\name{htdv_simstudy_warnings}
\alias{htdv_simstudy_warnings}
\title{Flag Simulation-Study Cells in the Limit-of-Identification Zone}
\usage{
htdv_simstudy_warnings(summ, threshold = 0.7)
}
\arguments{
\item{summ}{Data frame from \code{\link{htdv_simstudy_summary}}.}

\item{threshold}{Minimum acceptable Bayesian \code{diag_pass_rate}.
Default \code{0.7}.}
}
\value{
A data frame with the columns \code{n, phi, tail, imb, delta,
  layer, diag_pass_rate}, restricted to Bayesian rows whose pass rate is
  below \code{threshold}, plus an integer column \code{flag_index}
  (sequential identifier of flagged cells, useful for cross-referencing
  in reports and in vignettes).
}
\description{
Reads an aggregated \code{\link{htdv_simstudy_summary}} output and returns
the subset of cells where the Bayesian diagnostic-pass rate falls below a
user-set threshold. Such cells are typically located in the corner of the
design where strong autocorrelation meets a small sample (high \eqn{\phi}
and low \eqn{n}); the AR(1) likelihood there approaches its limit of
identification, MCMC diagnostics flag the resulting posterior, and
practitioners should treat the cell with extra caution—either by
increasing HMC iterations, tightening the priors on \eqn{\phi}, or
falling back to the conformal anchor whose validity does not require
identifiability.
}
\examples{
\donttest{
res <- htdv_simstudy(n_grid = c(40, 200),
                     phi_grid = c(0, 0.85),
                     tail_grid = "normal",
                     imb_grid = c(1, 6),
                     delta_grid = c(0, 0.25),
                     R = 50L)
summ <- htdv_simstudy_summary(res)
htdv_simstudy_warnings(summ, threshold = 0.7)
}

}
