Machine Learning-Augmented Interrupted Time Series

Statistics
Introduced by
Brodersen et al. (2015); Varian (2014) — foundational ML-for-causal-inference literature
Year
2014-2015
Type
Quasi-experimental causal inference with ML counterfactual
Family
Quasi-experimental / causal inference

What does it do?

Machine Learning-Augmented Interrupted Time Series (ML-ITS) estimates the causal effect of a discrete intervention by fitting a model to pre-intervention time series data, projecting a counterfactual trajectory into the post-intervention period, and measuring the gap between observed and predicted outcomes.

It extends classical ITS by replacing a parametric trend extrapolation with a more flexible estimator, such as gradient boosting, a random forest, or a Bayesian structural time-series (BSTS) model. BSTS is a state-space model rather than a conventional machine learning algorithm, but it fills the same counterfactual role.

The intuition behind the method

Classical interrupted time series fits a simple linear trend before an event and extrapolates it forward as a counterfactual. When the pre-intervention series is noisy, non-linear, or influenced by many covariates, that linear extrapolation can be badly wrong. ML-augmented ITS instead learns the relationships in the pre-intervention data, including seasonal patterns, non-linearities, and correlations with control series, using a flexible estimator. After the intervention, the trained model predicts what would have happened without it, and the difference between actual and predicted outcomes is the estimated causal effect. The flexible model improves the counterfactual; it does not change the underlying causal logic, which still depends on the intervention date being credible and on no other change coinciding with it.

History

The label 'machine learning-augmented' interrupted time series does not correspond to a single originating paper. The counterfactual framework it builds on is that of Brodersen et al. (2015), who proposed a Bayesian state-space model that predicts the counterfactual market response in a synthetic control had no intervention taken place. Their model flexibly accommodates local trends, seasonality and the time-varying influence of contemporaneous covariates, and is implemented in the CausalImpact R package. They illustrated the approach by estimating the effect of an online advertising campaign on search-related site visits. Varian (2014) is a general survey of machine learning tools, such as decision trees and neural nets, for large economic datasets. Its abstract does not address interrupted time series or causal counterfactuals, so it is cited only as background on machine learning in economics.

When to use it

Use ML-ITS when you have a single aggregate-level intervention with a clearly defined start date, a continuous time series outcome, and a pre-intervention period long enough to train a model. Longer pre-periods generally give more stable fits. Around 50-100 pre-intervention points is a rough informal rule of thumb rather than a validated minimum, and very short baselines (under about 30 points) carry a high risk of overfitting. The method is most useful when the pre-intervention series is non-linear or strongly seasonal, or when control series or covariates are available to improve the counterfactual. Do not use it when the pre-intervention series is very short (fewer than about 30 observations) or when other interventions occur at the same time and affect the post-period. Without control covariates the method can still run on the treated series alone, but the model then only extrapolates that series' own past. The gain over linear ITS then depends on how non-linear or seasonal the series is, and a linear ITS or a synthetic control design is often easier to justify.

Limitations and considerations

  • Requires a sufficiently long pre-intervention series to train the model reliably; short baselines lead to unstable counterfactuals.
  • Flexible ML models can overfit the pre-intervention period, which may produce intervals that are too narrow and understate uncertainty.
  • Causal identification rests on three assumptions: (1) the pre-intervention relationship between covariates and outcome would have persisted after t* had there been no intervention; (2) control covariates are not themselves affected by the intervention; and (3) no other shock affects the treated series at the same time. If any of these fails, the counterfactual is biased regardless of how flexible the model is.
  • Model choices (algorithm, covariates, hyper-parameters) are researcher degrees of freedom and should be pre-specified or reported transparently.
  • The counterfactual model is harder to explain to applied audiences than a fitted linear trend.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Handles non-linear and seasonal patterns in the pre-intervention series that would bias a linear extrapolation.
  • Can incorporate control series and covariates, which may improve counterfactual accuracy when those series are not themselves affected by the intervention.
  • Bayesian implementations such as BSTS (as in CausalImpact) return posterior uncertainty for the estimated impact over time, not only point estimates.
  • Placebo and permutation tests give a direct check on whether the estimated break is larger than changes seen at dates with no intervention.

Applications

  • Evaluating the effect of a product launch, marketing campaign, or platform algorithm change on an aggregate metric such as daily active users or revenue.
  • Measuring the impact of a public health intervention, such as a vaccination programme or lockdown, on disease incidence time series.
  • Assessing the effect of an environmental regulation on pollution levels when correlated control series from other regions or pollutants are available.
  • Estimating the traffic or revenue impact of a website redesign or pricing change using pre-change behavioural time series.
  • Quantifying the effect of legislation or policy on aggregate indicators such as unemployment or crime rates.

How it works

How it works

1

All pre-intervention time points form the training set. A model is fitted to the outcome and any available control covariates or donor series. Options include a gradient boosted tree, a random forest, a BSTS model, or a recurrent network such as an LSTM. Hyper-parameters are tuned using only the pre-intervention window, with validation that respects time order, so post-intervention data are not used during training.

2

After the known intervention time t*, the fitted model projects a counterfactual outcome trajectory from the covariate values and the dynamics learned in the pre-intervention period. This projection estimates what the outcome would have been without the intervention, and it is credible only if the assumptions listed under limitations hold.

Formula
\hat{y}_t^{\text{cf}} = f_{\text{ML}}(\mathbf{x}_t), \quad t > t^*
3

The pointwise causal effect at each post-intervention time point is the observed outcome minus the counterfactual prediction. Cumulative or average effects are obtained by summing or averaging these pointwise gaps over the post-intervention window.

Formula
\hat{\tau}_t = y_t - \hat{y}_t^{\text{cf}}
4

Uncertainty is quantified either from the posterior predictive distribution (for Bayesian models such as BSTS, as implemented in the CausalImpact R package) or, for other ML models, from resampling or placebo-based procedures. A standard i.i.d. bootstrap is not valid for autocorrelated time series, so block bootstrap or placebo-based intervals are preferred, and the validity of any interval depends on the chosen procedure. Flexible models can still produce intervals that are too narrow. A placebo test applies the same procedure to a falsified intervention date and checks whether an effect of similar size appears without a real intervention.

Common pitfalls

  • Using post-intervention data to select covariates or tune the model. This leaks future information into the counterfactual and can make it track the outcome, shrinking the estimated effect toward zero.
  • Omitting a concurrent shock or policy change that affects only the treated series, so that its effect is attributed to the intervention of interest.
  • Reporting only the cumulative effect without inspecting pointwise estimates, which can hide delayed or heterogeneous effect trajectories.
  • Applying ML-ITS to very short pre-intervention windows (fewer than about 30 points), where flexible models are prone to overfitting.
  • Skipping placebo or permutation tests, which are a key check on whether the detected break is genuine rather than a modelling artefact.

Frequently asked questions

How is ML-ITS different from classical interrupted time series?

Classical ITS fits a linear (or low-order polynomial) trend to the pre-intervention period and extrapolates it as the counterfactual. ML-ITS replaces that parametric extrapolation with a flexible model that can capture non-linearities, seasonality, and covariate relationships, which can give a better counterfactual when the series is complex.

What estimators are most commonly used?

Bayesian structural time-series (BSTS) models, as implemented in the CausalImpact R package, are among the most widely cited. Gradient boosted trees and random forests are common alternatives. For long series with strong sequential dependence, recurrent networks such as LSTMs are also used, though they generally need more data.

How long does the pre-intervention period need to be?

There is no validated universal minimum. Longer pre-periods generally give more stable fits, and around 50-100 points is an informal rule of thumb. With fewer than about 30 points, flexible estimators are prone to overfitting and the counterfactual interval becomes unreliable. A simpler model with fewer parameters, such as a linear ITS, is less exposed to this problem in short series.

How do I test whether the detected effect is real?

The standard diagnostic is a placebo test: apply the same procedure to a falsified intervention date at which no intervention occurred, and check whether a comparable effect appears. Permutation tests across many placebo dates give a reference distribution for judging the real estimate.

Does ML-ITS require a control group?

No. Like classical ITS, it can run on a single treated series, but the model then only extrapolates that series' own pre-intervention dynamics. Adding control series that are not affected by the intervention as covariates can improve the counterfactual and is recommended when such data are available.

Related methods

Sources

  1. 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 reference
  2. Varian, H. R. (2014). Big Data: New Tricks for Econometrics. Journal of Economic Perspectives, 28(2), 3-28.

    Open DOI reference