% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/auto-trim.R
\name{wf_auto_trim}
\alias{wf_auto_trim}
\title{Recommend a weight-trimming cap}
\usage{
wf_auto_trim(
  design,
  target,
  caps = c(2, 3, 4, 5, 6, 8, 10, 12),
  lo = 0.05,
  max_deff = 6,
  max_residual = 0.02,
  ...
)
}
\arguments{
\item{design}{An unchanged \code{wf_design_data}.}

\item{target}{An unchanged, non-demo \code{wf_verified_target}.}

\item{caps}{Unique positive finite upper-cap multipliers.}

\item{lo}{Positive lower-cap multiplier used for every finite candidate.}

\item{max_deff}{Maximum acceptable worst-group design effect.}

\item{max_residual}{Maximum acceptable worst relative margin residual.}

\item{...}{Additional raking settings. ID and base-weight roles are owned by
\code{design}; \code{trim} is not allowed because this function owns candidates.}
}
\value{
A \code{wf_auto_trim} object containing the candidate frontier and the
recommended cap. \code{Inf} means no trimming is needed; \code{NA} means no candidate
meets both criteria.
}
\description{
Sweeps candidate upper caps by rerunning raking and reports the trade-off
between design effect and residual margin error. The function recommends a
cap but never applies it to a production result.
}
