SyntheticDifferenceInDifferences.algorithm#

SyntheticDifferenceInDifferences.algorithm()[source]#

Run the SDiD algorithm: fit weight modules, compute tau analytically.

The method is a thin orchestrator that delegates each step to a private helper so that the individual pieces can be unit tested in isolation:

  1. _build_weight_fitter_inputs() prepares the dict-based X, y and coords inputs for the weight fitter.

  2. PyMCModel.fit() fits both the omega and lambda modules via MCMC.

  3. _extract_weight_posteriors() pulls the posterior weight arrays out of the fitted model.

  4. _compute_synthetic_and_gaps() builds the synthetic control trajectory and the gap between treated and synthetic.

  5. _compute_tau() evaluates the double-difference ATT.

  6. _build_reporting_objects() constructs the xarray objects required by the reporting helpers.

Return type:

None