Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Multivariate Markov Switching Models #4564

Open
haginile opened this issue Apr 29, 2018 · 6 comments
Open

ENH: Multivariate Markov Switching Models #4564

haginile opened this issue Apr 29, 2018 · 6 comments
Labels

Comments

@haginile
Copy link

The statespace component already has an excellent module for fitting Markov switching models; however, only univariate models are supported. Is there a way to extend it so as to support multivariate models? Thanks!

@ChadFulton
Copy link
Member

We had a GSOC project to allow estimating any Markov switching state space model in #2921, and it is reasonably far along, but it has not been merged (partly because it is written in pure Python and so it can be very slow).

If you mean something like VAR models with Markov switching, those could be estimated using the Hamilton filter and Kim smoother already in Statsmodels (along very similar lines to the markov_autoregression.py file), but we do not have a built-in model to do that yet. This is simply an issue of no one having had the time / energy to write the code, and we would be really happy for any contributions.

@haginile
Copy link
Author

haginile commented May 7, 2018

Thanks @ChadFulton. I'll take a look and revert back.

@sumit-uk1
Copy link

@ChadFulton is there a sample code that you can share? my use case is:-

I have a dataframe of N observable features and I want to fit a HMM Gaussian mixture to that.

Similar to the example in:
https://www.statsmodels.org/devel/examples/notebooks/generated/markov_autoregression.html

I was hoping to get the transition probabilities/ duration of 2 states and state probability predictions

Thanks

@ChadFulton
Copy link
Member

@sumit-uk1 I'm not quite sure what model you're looking for:

  • If you're looking for a switching regression model with 1 variable on the left-hand-side and N variables on the right-hand-side, then you can use MarkovRegression
  • If you're looking for a switching vector autoregression model with N variables on the left-hand-side, then unfortunately we still don't have that built in.

@sumit-uk1
Copy link

sumit-uk1 commented Sep 2, 2019 via email

@ChadFulton
Copy link
Member

It sounds like you are looking for a Markov switching VAR model, and we do not support that right now. The only models we have so far are univariate models.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants