% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/conformal.R
\name{conformal_inference}
\alias{conformal_inference}
\title{Conformal Inference for Synthetic Control Estimators}
\usage{
conformal_inference(
  fit,
  tau0 = 0,
  q = 1,
  alternative = c("two.sided", "greater", "less"),
  ci = TRUE,
  level = 0.95,
  grid = NULL,
  n_grid = 200L,
  grid_mult = 4,
  ...
)
}
\arguments{
\item{fit}{A \code{coresynth} object from \code{\link[=scm_fit]{scm_fit()}}.}

\item{tau0}{Null value of the ATT for the reported p-value (default 0).}

\item{q}{Exponent of the \eqn{S_q} test statistic
(\verb{S_q = (T_post^\{-1\} \\sum |u_t|^q)^\{1/q\}}). Default 1, robust to
heavy-tailed data (CWZ 2021). Used only for \code{alternative = "two.sided"};
one-sided tests use the signed mean post-treatment residual.}

\item{alternative}{\code{"two.sided"} (default), \code{"greater"}, or \code{"less"}.}

\item{ci}{Logical; construct a confidence interval by test inversion
(default \code{TRUE}).}

\item{level}{Confidence level for the interval (default 0.95).}

\item{grid}{Optional numeric vector of candidate \eqn{\tau_0} values for test
inversion. When \code{NULL} (default), a grid of \code{n_grid} points is centred on
the point estimate with half-width \code{grid_mult} times the pre-treatment
residual standard deviation.}

\item{n_grid}{Number of grid points when \code{grid = NULL} (default 200).}

\item{grid_mult}{Half-width multiplier when \code{grid = NULL} (default 4).}

\item{...}{Unused.}
}
\value{
A list of class \code{c("conformal_inference", "coresynth_inference")}
with \code{estimate}, \code{se} (\code{NA}; conformal has no SE), \code{p_value} (at \code{tau0}),
\code{ci_lower}, \code{ci_upper}, \code{method} (\code{"conformal"}), \code{n_controls},
\code{alternative}, \code{staggered} (\code{FALSE}), plus \code{tau0}, \code{q}, \code{grid}, and
\code{p_grid} (p-values along the grid). Compatible with \code{\link[generics:tidy]{tidy()}} / \code{\link[generics:glance]{glance()}}.
}
\description{
Implements the permutation-based conformal inference procedure of
Chernozhukov, Wuthrich & Zhu (2021, JASA). The test inverts a sharp null
\eqn{H_0: \tau = \tau_0} by imputing the treated post-treatment
counterfactual as \eqn{Y_{1t} - \tau_0}, re-estimating the counterfactual
proxy on \strong{all} \eqn{T} periods (imposing the null), and computing a
moving-block permutation p-value from the estimated residuals. A confidence
interval is obtained by test inversion over a grid of candidate \eqn{\tau_0}.
}
\details{
Supported for \strong{sharp} (single-cohort) fits with \code{method} in
\code{c("scm", "sdid", "gsc", "mc", "si")}. Staggered, multi-arm, and \code{tasc}
fits are not supported (use \code{sdid_inference()}, \code{gsc_inference()}, or
\code{si_inference()} instead).
}
\references{
Chernozhukov, V., Wuthrich, K., & Zhu, Y. (2021). An Exact and
Robust Conformal Inference Method for Counterfactual and Synthetic
Controls. \emph{Journal of the American Statistical Association}, 116(536),
1849-1864.
}
