% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{sdid_time_weights_cpp}
\alias{sdid_time_weights_cpp}
\title{Calculate SDID Time Weights (lambda)}
\usage{
sdid_time_weights_cpp(Y_pre_co, Y_post_target, zeta_t)
}
\arguments{
\item{Y_pre_co}{Pre-treatment outcomes for control units, row-demeaned (T_pre x N_co)}

\item{Y_post_target}{Post-treatment mean per control unit, demeaned (N_co x 1)}

\item{zeta_t}{Ridge penalty for time weights (paper: 1e-6 * sigma_hat)}
}
\value{
A numeric vector of length \code{T_pre} holding the SDID time weights
\code{lambda} (non-negative and summing to one).
}
\description{
Solves the time-weight QP (with implicit intercept lambda_0 concentrated out):
}
\details{
min over lambda in Delta_pre: ||Y_post_target - Y_pre_co^T lambda||^2 + zeta_t^2 * N_co * ||lambda||^2

The caller is responsible for pre-demeaning Y_pre_co (row-wise) and
Y_post_target (subtract the cross-unit mean) to concentrate out lambda_0,
as described in Arkhangelsky et al. (2021) Algorithm 1, Eq. (2.3).
}
