ML Systems Lab Open interactive version →
Advanced 65 min read Granger causalityCausalImpactsynthetic controlinterrupted time seriesDiD

Causal Inference in Time Series

Granger causality, ITS, synthetic control, CausalImpact, DiD, temporal autocorrelation

Granger causality is the most widely misused concept in applied time series work. It answers a predictive question — does X help predict Y beyond Y's own past? — not a causal one. A shared upstream cause Z that affects both X and Y with different lags produces Granger causality between X and Y with zero direct relationship. Knowing that search volume Granger-causes sales tells you nothing about whether investing in SEO will increase sales. The tools that actually support causal claims — synthetic control, CausalImpact, interrupted time series, difference-in-differences — all require a credible counterfactual: what would have happened to the treated unit absent the intervention.

The harder problem in practice is staggered rollouts, where different units receive treatment at different times. Standard two-way fixed effects DiD is biased under treatment effect heterogeneity in this case — already-treated units contaminate the control group — and the fix (Callaway-Sant'Anna) is not widely known.

Key points

Takeaway

Granger causality is the most frequently misused concept in applied time series work: it measures predictive priority, not causation, and a common upstream cause produces Granger causality between two otherwise unrelated series. The second most important insight for applied causal time series is that TWFE DiD is biased under staggered rollouts with heterogeneous treatment effects — already-treated units contaminate the control group, and the fix is Callaway-Sant'Anna, not just clustering standard errors. Always run an event study plot before reporting any DiD estimate.

Recap

Check your understanding

Q1. Google search volume Granger-causes weekly sales (p<0.001). A PM wants to invest in SEO to raise sales. Which TWO statements identify the problem correctly?

Q2. You are measuring the impact of a new feature launched to users in Germany on January 15. You have daily active users (DAU) data for Germany (treated) and France (control) from January 2023 onwards. How do you use CausalImpact and what assumptions must hold?

Q3. Your company rolls out a pricing change to different markets in different months over a 6-month window. You use TWFE DiD to estimate the effect. A colleague says your estimate is biased. Why and what do you do?

Q4. You want to estimate the causal effect of an algorithm change on user engagement, but the change was rolled out gradually to all users with no holdout group. CausalImpact, synthetic control, and ITS all require a control group or counterfactual. What do you do?

Try it interactively

ML Systems Lab is a free interview-prep platform for ML engineers — work through the full interactive module, quizzes, and drills.

Open ML Systems Lab →