SyntheticControl.validate_design#

SyntheticControl.validate_design(injected_effect, holdout_periods=None, effect_type='relative', sample_kwargs=None)[source]#

Dress rehearsal: inject a known effect and check if the model recovers it.

Splits the pre-period, injects an effect into the held-out pseudo-post window, fits a fresh SC on the truncated pre-period, and checks whether the posterior cumulative impact recovers the injected truth.

Parameters:
  • injected_effect (float) – Effect to inject. Interpretation depends on effect_type.

  • holdout_periods (int | None) – Number of pre-period rows to hold out as pseudo-post. If None, uses ~25 % of the pre-period (floored, minimum 1).

  • effect_type (Literal['relative', 'absolute']) – "relative" multiplies treated by (1 + injected_effect); "absolute" adds injected_effect to treated values.

  • sample_kwargs (dict | None) – MCMC sampling arguments for the refitted model. Falls back to the parent experiment’s sample_kwargs.

Return type:

DressRehearsalResult

Raises:
  • TypeError – If the model is not a PyMCModel.

  • ValueError – If the remaining pre-period after holdout would have fewer than 10 time points.