Do we have an implementation of Bayesian structural time series in Python?

2.7k views Asked by At

We are looking for a close pythonian implementation of the r library bsts. To be precise, I'm looking for something that allows me to emulate the functionality of 'add_regressor' from fbprophet.

  1. Have already tried Pybsts (the kernel kept dying), and
  2. According to a thread on tensorflow_probability Github account, it doesn't support multivariate mode yet.

Any help would be appreciated. Thanks

2

There are 2 answers

1
lunguini On

This blog post from Tensorflow Probability shows how to add an exogenous regressor with the TFP structural time series tools. In particular, check out the usage of the temperature_effect variable in the Example: Forecasting Demand for Electricity section!

1
Devin Garcia On

I recently wrote a version of R's bsts package in Python. It doesn't have all of bsts's features, but it does have options for level, trend, seasonality, and regression. The syntax closely follows statsmodels' UnobservedComponents module. You can find the code and description of the package here: https://github.com/devindg/pybuc.