statsmodels
Statsmodels, statistical modeling and econometrics in Python
...Markov switching models (MSAR), also known as Hidden Markov Models (HMM). Vector autoregressive models, VAR and structural VAR. Vector error correction model, VECM. Robust linear models with support for several M-estimators. statsmodels supports specifying models using R-style formulas and pandas DataFrames.