PlaceboInTime.run#

PlaceboInTime.run(experiment, context=None)[source]#

Run historical placebo refits and optional hierarchical calibration.

Creates n_folds historical experiments at generated or explicit treatment times. By default, extracts posterior cumulative impact from each fold, fits a hierarchical Bayesian status-quo model, and compares the actual intervention effect against this null. With calibrate=False, reports draw-wise average historical impacts and sampling diagnostics without extracting the real effect. When expected_effect_prior was provided at construction, also runs exact closed-form Bayesian assurance calculations.

Can be used standalone (context=None) when experiment_factory was provided, or within a pipeline.

Parameters:
  • experiment (BaseExperiment) – The fitted experiment whose treatment time will be shifted to generate placebo folds.

  • context (PipelineContext | None) – Pipeline context providing experiment_config for re-fits. If None, an explicit experiment_factory must have been supplied at construction time.

Returns:

Calibrated results indicate whether the actual cumulative effect is clearly outside the learned null. Descriptive results have passed=None, an average-difference table with one row per planned fold, schedule geometry and completed-fit aggregates, with no calibration quantities. Failed or ineligible folds keep their original positions and seeds. Descriptive summaries include weak completed fits; their diagnostics remain visible.

Return type:

CheckResult