| cv_pensynth | R Documentation |
Compute a penalized synthetic control estimator with hold-out validation for the lambda penalty parameter. Lambda will be determined by minimizing the mean squared error on a hold-out set of pre-intervention outcome time-series.
cv_pensynth(
X1,
X0,
Z1,
Z0,
v = 1,
nlambda = 100,
opt_pars = clarabel::clarabel_control(),
standardize = TRUE,
return_solver_info = FALSE,
verbose = interactive(),
adaptive_lambda = TRUE
)
X1 |
|
X0 |
|
Z1 |
|
Z0 |
|
v |
|
nlambda |
|
opt_pars |
|
standardize |
|
return_solver_info |
|
verbose |
|
adaptive_lambda |
|
The lambda sequence is an exponentially increasing sequence where The minimum lambda is always 1e-11, the max lambda is determined by the data.
For multiple treated units, is adaptive_lambda is set to FALSE, the (shared) minimum
lambda will be selected by local regression of sqrt(mse) on log(lambda).
A list of optimal weights, optimal lambda(s), the lambda sequence(s),
the associated weights, and the mses. If there are multiple treated units,
this list contains sublists for each unit. If return_solver_info is TRUE,
the list will also contain diagnostic information about the solvers.
pensynth(), plot.cvpensynth(), placebo_test(), simulate_data_synth()
set.seed(45)
dat <- simulate_data_synth()
res <- with(dat, cv_pensynth(X1, X0, Z1, Z0))
plot(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.