View source: R/DiSCo_weights_reg.R
DiSCo_weights_reg | R Documentation |
Function for obtaining the weights in the DiSCo method at every time period
DiSCo_weights_reg(
controls,
target,
M = 500,
qmethod = NULL,
qtype = 7,
simplex = FALSE,
q_min = 0,
q_max = 1
)
controls |
List with matrices of control distributions |
target |
Matrix containing the target distribution |
M |
Integer indicating the number of control quantiles to use in the DiSCo method. Default is 1000. |
qmethod |
Character, indicating the method to use for computing the quantiles of the target distribution. The default is NULL, which uses the |
qtype |
Integer, indicating the type of quantile to compute when using |
simplex |
Logical, indicating whether to use to constrain the optimal weights to the unit simplex. Default is FALSE, which only constrains the weights to sum up to 1 but allows them to be negative. |
q_min |
Numeric, minimum quantile to use. Set this together with |
q_max |
Numeric, maximum quantile to use. Set this together with |
Estimate the optimal weights for the distributional synthetic controls method.
solving the convex minimization problem in Eq. (2) in \insertCitegunsilius2023distributional;textualDiSCos..
using a regression of the simulated target quantile on the simulated control quantiles, as in Eq. (3),
\underset{\vec{\lambda} \in \Delta^J}{\operatorname{argmin}}\left\|\mathbb{Y}_t \vec{\lambda}_t-\vec{Y}_{1 t}\right\|_2^2
.
For the constrained optimization we rely on the package pracma
the control distributions can be given in list form, where each list element contains a
vector of observations for the given control unit, in matrix form;
in matrix- each column corresponds to one unit and each row is one observation.
The list-form is useful, because the number of draws for each control group can be different.
The target must be given as a vector.
Vector of optimal synthetic control weights
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.