- Introduced by
- Brodersen, Gallusser, Koehler, Remy & Scott; Rubin potential outcomes framework
- Year
- 2015 (canonical implementation); Rubin potential outcomes: 1974-2005
- Type
- Bayesian causal inference / counterfactual estimation
- Family
- Quasi-experimental / causal inference
What does it do?
Bayesian counterfactual impact evaluation estimates the effect of an intervention on a time-series outcome by using a Bayesian model to predict what the outcome would have been without the intervention.
Brodersen et al. (2015) describe this approach with Bayesian structural time-series (BSTS) models fitted to pre-intervention data, where control series supply information about the counterfactual. The causal effect is the gap between the observed post-intervention outcome and that prediction, summarised as a posterior distribution.
The intuition behind the method
The question is what the treated series would have done had the intervention not occurred. The model learns how the treated outcome relates to control covariates, and to trend and seasonality, from the period before the intervention, and then projects that relationship forward. Because the model is Bayesian, the projection is a distribution over possible counterfactual paths rather than a single line, so the estimated effect carries uncertainty that grows as the forecast extends further from the intervention date. The approach depends on control series that move with the outcome before the intervention and are not affected by it.
History
Rubin (2005) sets out the potential-outcomes framework, in which causal effects are comparisons of potential outcomes under different treatments, and separates scientific inference about causal effects from decisions based on that inference. Brodersen, Gallusser, Koehler, Remy and Scott (2015) applied Bayesian state-space models to estimate the causal impact of a designed market intervention, in contrast to classical difference-in-differences schemes. They provide an implementation in the CausalImpact R package.
When to use it
Choose this method when one unit (or a few units) receives a single, identifiable intervention at a known date, outcomes are recorded over a long run of time points before and after it, and one or more control series that track the treated outcome before the intervention are available. It suits a single policy change, campaign or launch measured over time. Avoid it when the pre-intervention series is short relative to its noise and seasonality, when no control series is credible, when treatment is gradual or continuous rather than a sharp event, or when the outcome is a count with small rates for which Gaussian assumptions fit poorly. When there are many treated units with panel data, difference-in-differences or synthetic control designs are usually more suitable, as the FAQ notes.
Limitations and considerations
- It needs a sufficiently long pre-intervention series for the trend and seasonal dynamics to be identified; how long depends on the noise level and seasonal structure, so check the pre-period fit and the sensitivity of results to the window length.
- The counterfactual is only as good as the control series; if the controls respond to the intervention, the estimated effect absorbs that response.
- MCMC-based posterior inference is slower than closed-form frequentist regression, and runtime grows with series length.
- The model assumes the relationship between the outcome and its controls is stable across the intervention date; a change in that relationship not caused by the intervention will be read as an effect.
- In small samples the prior can carry substantial weight in the posterior, so sensitivity to the prior should be checked.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- The posterior gives a distribution for both the counterfactual and the effect, so uncertainty is reported directly rather than as a point estimate with a separate test.
- The state-space structure can accommodate local trend, seasonality and the time-varying influence of contemporaneous covariates, as Brodersen et al. (2015) describe.
- Spike-and-slab priors can select among many candidate control series, which limits overfitting when controls are numerous.
- Effects are estimated at each post-intervention time point, so the time profile of the impact can be inspected, not only its average.
- It works with a single treated unit, where designs that require many treated units are not feasible.
Applications
- Estimating the effect of an online advertising campaign on search-related site visits, the example Brodersen et al. (2015) use to illustrate the method.
- Evaluating a one-time policy change or regulatory reform on a region's outcome series, provided a credible unaffected control series exists.
- Assessing a product launch or pricing change on sales, where comparable series not exposed to the change can be identified.
- Measuring the effect of a public health programme on incidence, where the choice of control series must be justified against possible spillovers.
How it works
How it works
Before fitting, the analyst sets prior distributions over the model's parameters, including the variances that govern how the latent state evolves, the observation noise, and the coefficients on control covariates. When many candidate control series are available, spike-and-slab priors can be used so that the data help determine which covariates are retained, with irrelevant coefficients shrunk toward zero.
Formula
p(\theta) \propto \text{prior over model parameters (state evolution, observation noise)}A BSTS model is specified for the pre-intervention outcome. Brodersen et al. (2015) use a diffusion-regression state-space model: the observed outcome is a linear function of latent states plus noise, and the states evolve over time according to a transition equation. The states can include a local trend, seasonal components and regression on control series. The model describes how the treated outcome would have evolved without the intervention.
Formula
y_t^{(0)} = \mathbf{Z}_t^{\top}\boldsymbol{\alpha}_t + \varepsilon_t,\ \varepsilon_t \sim \mathcal{N}(0,\sigma^2);\quad \boldsymbol{\alpha}_{t+1} = \mathbf{T}\boldsymbol{\alpha}_t + \mathbf{R}\boldsymbol{\eta}_t,\ \boldsymbol{\eta}_t \sim \mathcal{N}(0,\mathbf{Q})Using only pre-intervention observations, the posterior distribution over the parameters and latent states is estimated, typically by Markov chain Monte Carlo as in Brodersen et al. (2015). This posterior reflects uncertainty about the time-series dynamics and about which control series carry information.
Formula
p(\theta \mid y_{1:T_0}, \mathbf{x}_{1:T}) \propto p(y_{1:T_0} \mid \theta, \mathbf{x}_{1:T_0})\, p(\theta)For each post-intervention time point, the model's posterior predictive distribution for the counterfactual outcome is subtracted from the observed outcome, giving a pointwise effect with its own uncertainty. This difference is attributable to the intervention only if the counterfactual forecast is credible.
Formula
\hat{\tau}_t = y_t^{(1)} - \hat{y}_t^{(0)}, \quad t > T_0Pointwise effects are aggregated into cumulative or average effects, each summarised by its posterior mean, a 95% credible interval, and the posterior probability that the effect is positive or negative. This probability is a statement about the effect conditional on the model, its priors and the control series, not a frequentist p-value, and it should be reported together with a check of sensitivity to the prior.
Formula
p(\tau \mid \text{data}) \Rightarrow \text{posterior mean, credible interval, tail probability}Common pitfalls
- Using as controls series that were themselves influenced by the intervention, such as competitor outcomes responding to the same policy; this invalidates the counterfactual.
- Reporting only the posterior mean effect without its 95% credible interval and the posterior probability of a positive effect.
- Applying the model to a very short pre-intervention window, where the fit mainly tracks noise and the counterfactual forecast is unreliable.
- Skipping checks of the pre-intervention fit; if the model tracks the pre-period poorly, the post-period counterfactual should not be trusted.
- Reading a precisely estimated small effect as practically important; the posterior probability addresses whether an effect is present under the model, not whether it matters.
Frequently asked questions
What is the key difference between Bayesian counterfactual impact evaluation and standard interrupted time series?
Standard interrupted time-series uses frequentist regression with a level or slope change at the intervention point. The Bayesian approach additionally models latent state dynamics, incorporates control covariates for the counterfactual, and produces a full posterior distribution over the effect rather than a point estimate with standard errors.
How many pre-intervention time points do I need?
There is no universal threshold. The required length depends on the noise level and on how much trend and seasonality must be learned. Longer pre-intervention windows generally make the counterfactual forecast more credible. Check how well the model tracks the pre-period and whether the estimated effect is stable when the window is changed.
What if I have no control time series?
The method can still be applied using a trend-plus-seasonality BSTS model without covariates, but the counterfactual will be noisier and rely heavily on extrapolating pre-intervention dynamics. Credible controls substantially improve precision.
How do I interpret the posterior probability of a causal effect?
The posterior probability that the effect is positive (or larger than some threshold) is a probability statement about the effect that is conditional on the model, its priors and its control series. It is more direct to interpret than a frequentist p-value, but it is still model-dependent.
Can I use this method for multiple treated units?
Yes, but each unit typically receives its own BSTS model and its own counterfactual. Aggregating effects across units requires additional pooling assumptions. For many treated units with panel data, difference-in-differences or synthetic control methods may be more appropriate.
Related methods
Sources
Brodersen, K. H., Gallusser, F., Koehler, J., Remy, N., & Scott, S. L. (2015). Inferring causal impact using Bayesian structural time-series models. Annals of Applied Statistics, 9(1), 247-274.
Open DOI referenceRubin, D. B. (2005). Causal inference using potential outcomes: Design, modeling, decisions. Journal of the American Statistical Association, 100(469), 322-331.
Open DOI reference