PlaceboInTime.run#
- PlaceboInTime.run(experiment, context=None)[source]#
Run historical placebo refits and optional hierarchical calibration.
Creates
n_foldshistorical 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. Withcalibrate=False, reports draw-wise average historical impacts and sampling diagnostics without extracting the real effect. Whenexpected_effect_priorwas provided at construction, also runs exact closed-form Bayesian assurance calculations.Can be used standalone (
context=None) whenexperiment_factorywas 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 providingexperiment_configfor re-fits. IfNone, an explicitexperiment_factorymust 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: