% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/synthetic_control.R
\name{synthetic_control_batch}
\alias{synthetic_control_batch}
\title{Synthetic Control Weights for All Units (Batch)}
\usage{
synthetic_control_batch(Y)
}
\arguments{
\item{Y}{Numeric matrix (\eqn{N \times T}) of pre-treatment outcomes.
Rows are units, columns are time periods.}
}
\value{
A list with components
\describe{
  \item{a_hat}{Numeric vector of length \eqn{N}: unit-level intercepts.}
  \item{B_hat}{Numeric \eqn{N \times N} matrix of SC weights.  Row
    \eqn{i} contains the weights used to construct the synthetic control
    for unit \eqn{i}; \eqn{B_{ii} = 0}.}
}
}
\description{
For each unit in turn, treat that unit as the "treated" unit and
estimate SC weights from the remaining units.  This produces an
\eqn{N \times N} weight matrix \eqn{\hat B} with zeros on the diagonal.
}
\examples{
set.seed(1)
Y <- matrix(rnorm(5 * 20), 5, 20)
res <- synthetic_control_batch(Y)
res$B_hat   # N x N weight matrix

}
