返回 Skill 列表
extension
分类: 开发与工程无需 API Key

running-placebo-analysis

执行安慰剂时间敏感性分析以验证因果声明。在检查模型稳健性、验证干预前无效应或确保观察到的效果不是虚假时使用。

person作者: jakexiaohubgithub

Running Placebo Analysis

Executes placebo-in-time sensitivity analysis to validate causal experiments.

Workflow

  1. Define Experiment Factory: Create a function that returns a fitted CausalPy experiment (e.g., ITS, DiD, SC) given a dataset and time boundaries.
  2. Configure Analysis: Initialize PlaceboAnalysis with the factory, dataset, intervention dates, and number of folds (cuts).
  3. Run Analysis: Execute .run() to fit models on pre-intervention data folds.
  4. Evaluate Results: Compare placebo effects (which should be null) to the actual intervention effect. Use histograms and hierarchical models to quantify the "status quo" distribution.

Key Concepts

  • Placebo-in-time: Simulating an intervention at a time when none occurred to check if the model falsely detects an effect.
  • Fold: A slice of pre-intervention data used to test a placebo period.
  • Factory Pattern: Decouples the placebo logic from the specific CausalPy experiment type.

References