Description
At the moment we only have one example of using splines in CausalPy, and that's in a non-Bayesian example of the regression discontinuity design.
I would be interesting to see splines used more, particular in a Bayesian notebook. The easiest way to do this would be to extend the existing Excess deaths due to COVID-19 notebook example which just has a basic linear trend. For example, we could modify the equation to standardize(deaths) ~ 0 + cr(t, df=6) + C(month) + temp
to model the trend with a natural cubic spline.
I did give that a quick go, and was able to get a better pre-treatment fit (standardize
function in the patsy
model formula. One solution to that might end up being better / automated priors (related to, but not the same as, #387).
It would also be interesting to optionally add in cyclic splines to model annual seasonality.