Problem
Twitter switched its default edge network to a faster public cloud edge in selected countries to cut latency. Because of the network configuration, users could not be randomly assigned to the faster edge, so an A/B test was impossible. The team still had to show whether lower latency raises revenue and engagement. Raw before/after numbers are exposed to external shocks and bias.
Example from the article: the team estimated the impact on revenue, customer state, engagement and performance metrics for each switched country, using the same metrics from other countries as controls.
Solution in brief
Treat each switched country as the treated unit and build its counterfactual with Google's CausalImpact, a Bayesian structural time-series (BSTS) model. The model is trained on a long pre-period and on the same metric in untreated countries. Before modeling, the team confirms that latency really improved and that critical metrics stayed stable.
Questions this case answers
- How to estimate the causal effect of a change that cannot be randomized across users, using untreated groups as controls for a time-series counterfactual
- How to validate a quasi-experiment when external shocks shorten the post-intervention period
- How to measure the effect of an infrastructure change on revenue and engagement when users cannot be randomly assigned?
- How to build a counterfactual for treated countries from untreated ones with CausalImpact?
Tools and methods
- CausalImpact — BSTS model that predicts the counterfactual and the effect with credible intervals
- Kalman filter, spike-and-slab regression, Bayesian model averaging — components of the BSTS model
- Difference-in-differences — fallback check on latency when charts are not conclusive
- A/A test, residual and autocorrelation plots — validation of the model and results
Google or a one-time email code. No password.