% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{sdid_unit_weights_cpp}
\alias{sdid_unit_weights_cpp}
\title{Calculate SDID Unit Weights (omega)}
\usage{
sdid_unit_weights_cpp(Y_pre, Y_tr_pre, zeta2)
}
\arguments{
\item{Y_pre}{Pre-treatment outcome matrix for control units (T_pre x N_co)}

\item{Y_tr_pre}{Pre-treatment outcome vector for treated unit (T_pre x 1), averaged if multiple}

\item{zeta2}{Ridge penalty parameter (zeta^2). The code internally multiplies by T_pre per the paper.}
}
\value{
A numeric vector of length \code{N_co} holding the SDID unit weights
\code{omega} (non-negative and summing to one).
}
\description{
Solves the regularized QP:
min over omega in Delta: sum_t (sum_i omega_i Y_it - Y_tr_t)^2 + zeta^2 * T_pre * ||omega||^2
}
\details{
This corresponds to equation (5) in Arkhangelsky et al. (2021).
}
