% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/smsncut.R
\name{cutoff_optimal}
\alias{cutoff_optimal}
\title{Optimal diagnostic cutoff under SMSN distributions}
\usage{
cutoff_optimal(
  theta0,
  theta1,
  family0,
  family1,
  lambda0,
  lambda1,
  pi0,
  pi1,
  interval = NULL,
  grid_length = 5000L
)
}
\arguments{
\item{theta0}{Numeric vector. MLE for group 0.}

\item{theta1}{Numeric vector. MLE for group 1.}

\item{family0}{Character. Family for group 0.}

\item{family1}{Character. Family for group 1.}

\item{lambda0}{Positive numeric. Cost of a false positive.}

\item{lambda1}{Positive numeric. Cost of a false negative.}

\item{pi0}{Numeric in \eqn{(0,1)}. Prevalence of non-diseased.}

\item{pi1}{Numeric in \eqn{(0,1)}. Prevalence of diseased.}

\item{interval}{Numeric vector \code{c(a, b)}. If \code{NULL}, computed
via \code{\link{cutoff_admissible_interval}}.}

\item{grid_length}{Integer. Grid resolution for sign-change search.
Default \code{5000}.}
}
\value{
A list with \code{cutoff}, \code{risk}, \code{interval},
  and \code{boundary}.
}
\description{
Estimates the decision-theoretic optimal cutoff \eqn{c^*} as the minimiser
of the weighted misclassification risk \eqn{R(c;\theta)} over the admissible
interval \eqn{[a,b]} (Theorem 5.13 of de Paula et al., 2026). Under the
monotone likelihood ratio condition, \eqn{c^*} is the unique root of
\eqn{\varphi(c,\theta)=0}, found by grid search followed by
\code{uniroot}. If no root is found, \code{optimize} on \eqn{R} is used
as fallback.
}
\examples{
theta0 <- c(0, log(1), 1)
theta1 <- c(2, log(1), 1.5)
res  <- cutoff_optimal(theta0, theta1, "SN", "SN", 1, 1, 0.5, 0.5)
res$cutoff
}
