Time Series Causal Impact Analysis in Python

Amy @GrabNGoInfo
GrabNGoInfo
Published in
10 min readSep 10, 2022

--

Use Google’s python package CausalImpact to do time series intervention causal inference with Bayesian Structural Time Series Model (BSTS)

Time Series Causal Impact Analysis in Python. Use Google’s python package CausalImpact to do time series intervention causal inference with Bayesian Structural Time Series Model (BSTS)
Photo by Icons8 Team on Unsplash

CausalImpact package created by Google estimates the impact of an intervention on a time series. For example, how does a new feature on an application affect the users' time on the app?

In this tutorial, we will talk about how to use the Python package CausalImpact to do time series causal inference. You will learn:

  • How to set the pre and post periods for the causal impact analysis?
  • How to conduct causal inference on time series data?
  • How to summarize the causality analysis results and create a report?
  • What are the differences between the python and the R packages for CausalImpact?

Resources for this post:

Let’s get started!

Step 1: Install and Import Libraries

--

--