'Markov-switching dynamic factor model (MS-DFM) for Recession Probabilities / Python

I am searching for a good code example in Python for the calculation of the recession probabilities of the Markov-switching dynamic factor model (MS-DFM) by Chauvet / Piger which are also publicated by the FRED database: https://fred.stlouisfed.org/series/RECPROUSM156N . I want to implement the same methodology for different countries and searching for a code to calculate it.

Does anyone have an idea where to look for this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source