% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/replicates.R
\name{wf_replicates}
\alias{wf_replicates}
\title{Generate re-calibrated replicate weights for variance estimation.}
\usage{
wf_replicates(
  data,
  refit,
  method = c("bootstrap", "jackknife", "brr"),
  R = 500,
  strata = NULL,
  clusters = NULL,
  id = NULL,
  base_weight = NULL,
  seed = NULL,
  rho = 0,
  parallel = FALSE,
  progress = FALSE
)
}
\arguments{
\item{data}{Input data frame (one row per unit).}

\item{refit}{A closure \verb{function(data, weights) -> wf_weights} that re-runs
the calibration pipeline using \code{weights} as the base/initial weights.}

\item{method}{Replication method.}

\item{R}{Number of bootstrap replicates (ignored for jackknife / BRR).}

\item{strata}{Optional stratum column name (single stratum if \code{NULL}).}

\item{clusters}{Optional PSU column name (each row is its own PSU if \code{NULL}).}

\item{id}{Optional id column aligning replicate weights (row order if \code{NULL}).}

\item{base_weight}{Optional starting base-weight column (all \code{1} if \code{NULL}).}

\item{seed}{Optional integer seed for the bootstrap draws.}

\item{rho}{Fay's BRR shrinkage parameter in \verb{[0, 1)}. Used only when
\code{method = "brr"}; \code{rho = 0} gives standard BRR.}

\item{parallel}{Whether to re-run replicate refits with forked parallelism
where available, using at most two workers. Windows falls back to serial
execution.}

\item{progress}{Whether to show a \code{cli} progress bar when \code{cli} is installed.}
}
\value{
A \code{wf_replicate_weights} object.
}
\description{
Perturbs base weights by bootstrap, jackknife, or BRR multipliers and
re-runs a calibration pipeline (\code{refit}) on each replicate, so the resulting
variance captures calibration uncertainty. Pair with \code{\link[=wf_variance]{wf_variance()}}.
}
