Regime switching models

I’ve not had time to delve into this yet - so putting this here.

Has anyone built a model like this?

It might be a bit challenging to rewrite the autoregressive model using tt.scan, but overall it is possible - would be great if somebody pick it up, it can be a nice exercise/example.

I gave it a stab:

Comments welcome :wink:


I find this topic very interesting, was wondering if anybody has done any more work since 2018?

Working with regime shifts and tipping points in environmental science, having a Bayesian model to approach these issues would be invaluable.

However, unfortunately I am really not an expert in Pymc (as most environmental scientists I am sure), so it would be very useful to have a simplified version.

any comments welcome, thanks!