coresynth 0.2.1
Bug fixes
-
v_selection = "oos"(outcomes-only case) previously fit candidateW(V)on the full pre-treatment outcome matrix and restricted only the MSPE evaluation to the validation window, allowing the V optimiser to fit the validation period indirectly (a data leak relative to Abadie (2021) S.3.2). The new.scm_oos_outcomes()implements the correct train/validation split: candidateW(V)are fitted on training-half outcomes only,V*minimises validation-half MSPE, andW*is refit withV*on the outcomes of the lastfloor(T_pre/2)pre-treatment periods. For OOS fits,v_weightsnow hasfloor(T_pre/2)entries and a newv_rowsfield records which periods they refer to. This changes numerical results forv_selection = "oos".
New features
-
scale_predictors(defaultTRUE): predictor rows supplied viapredictors =are now divided by their standard deviation across all units before optimisation, matching the Synth reference implementation (Abadie, Diamond & Hainmueller 2011, JSS).predictor_tablecontinues to report values on the original scale. This changes numerical results for SCM fits with user-suppliedpredictorsunlessscale_predictors = FALSE. -
placebo_in_time(): in-time placebo (backdating) test for sharp SCM fits (Abadie, Diamond & Hainmueller 2015; Abadie & Vives-i-Bastida 2022). -
loo_donors(): leave-one-out donor robustness check with the predictor weights V held fixed (Abadie, Diamond & Hainmueller 2015, footnote 20). -
build_predictor_matrices()now errors with an informative message if apred()time window produces missing or non-finite predictor values.
coresynth 0.2.0
New features
-
Conformal inference (
conformal_inference()): permutation-based p-values and confidence intervals following Chernozhukov, Wüthrich & Zhu (2021). Works with sharp fits across all supported estimation methods (scm,sdid,gsc,mc,si). The counterfactual proxy is re-estimated under the null on all T periods (essential for finite-sample validity per CWZ S.2.2), and p-values are obtained via moving-block (cyclic-shift) permutation of the estimated residuals. Confidence intervals are constructed by test inversion over a user-supplied or automatically chosen grid. Returns acoresynth_inferencesubclass compatible withtidy()andglance().
Minor improvements
-
panel_to_matrices(): fill loop replaced by vectorisedmatch()+ matrix-index assignment; removes an O(n × (T + N)) bottleneck in the shared data-prep path. -
tasc.cpp:safe_inv_sympd()helper added so the Kalman filter degrades topinvinstead of aborting when the innovation covariance is not numerically PD. -
%||%null-coalescing helper centralised inutils.R; duplicate definitions inbroom.Randplot.Rremoved. -
check_sharp_adoption()(unused internal function) removed.
coresynth 0.1.0
First public release.
Methods
-
SCM (Abadie, Diamond & Hainmueller 2010): Synthetic Control Method with unified formula interface. Supports predictor variables via
pred(), out-of-sample V selection (v_selection = "oos"), donor filtering (donor_mspe_threshold), penalised SCM (lambda_pen), and staggered adoption. Inference: MSPE ratio permutation test viamspe_ratio_pval(). -
SDID (Arkhangelsky et al. 2021): Synthetic Difference-in-Differences. Supports time-varying covariates (
covariates =), sharp and staggered adoption. Inference:sdid_inference()with placebo / bootstrap / jackknife / jackknife_global. -
GSC (Xu 2017): Generalised Synthetic Control with interactive fixed effects. Supports time-varying covariates via the full EM algorithm, sharp and staggered adoption. Inference: parametric bootstrap (
gsc_boot()) and non-parametric (gsc_inference()). - MC (Athey et al. 2021): Matrix Completion via nuclear-norm regularisation (Soft-Impute). Supports sharp and staggered adoption.
- TASC (Rho et al. 2026): Time-Aware Synthetic Control via Kalman EM. Supports sharp and staggered adoption.
-
SI (Agarwal et al. 2025): Synthetic Interventions via SI-PCR. Supports sharp, staggered, multi-arm (K > 1), and staggered × multi-arm. Inference:
si_inference()with bootstrap / jackknife / jackknife_global. -
SCM-Design (Abadie & Zhao 2026):
scm_design()with base / weakly_targeted / unit_level variants, blank-period permutation test, and split-conformal confidence intervals.
Unified API
- Single
scm_fit(outcome ~ treatment | unit + time, data, method = ...)entry point for all methods. -
panel_to_tensor()for multi-arm SI data preparation. -
broomintegration:tidy(),glance(),augment()for all methods and inference objects. -
plot.coresynth(): trend, gap, and weights plots via ggplot2. -
export_json(): JSON export for reproducibility.
