pymc-labs/CausalPy

Add `InterruptedTimeSeries` class

drbenvincent opened this issue · 0 comments

  • Create a dedicated InterruptedTimeSeries class.
  • This will be similar to the RegressionDiscontinuity class. With regression discontinuity, the x-axis is never(?) time. Therefore it is not necessarily very meaningful to calculate a counterfactual off to the left or right of the discontinuity. Rather, the focus is on what the discontinuity is. But this is not the case for interrupted time series. Here you do want to calculate a counterfactual, the prediction of what would have happened in the post-intervention period had the intervention not taken place.
  • This class will not deal with comparative interrupted time series where there is a control group. This is just for 'regular' interrupted time series where there is no control group.
  • It makes sense to subclass TimeSeriesExperiment PrePostFit in the way that SyntheticControl does and how an eventual CITS class will.
  • You could make an argument that DifferenceInDifferences should also subclass TimeSeriesExperiment PrePostFit, but I think this is wrong in fact. DiD estimates parameters given all the data whereas ITS and SC estimate parameters on the pre-intervention data alone. So it might make more sense to rename TimeSeriesExperiment to something like pre_post_experiment instead, but this will be dealt with in a different issue. [This was done in #193]
  • Make sure to rebuild the UML diagrams
  • Update the Covid excess deaths notebook to use the new InterruptedTimeSeries class (see #181)