-
Notifications
You must be signed in to change notification settings - Fork 15
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
More than one time series? #2
Comments
Hi Mathieu, First, just to make sure, the pymar library should be considered as obsolete - a much improved version is available in Statsmodels v0.8 - v0.8 is not released yet, but there is a release candidate on pip. Alternatively Statsmodels master can be used. The equation you're referencing is a state space model. In that paper it is estimated via Bayesian methods, and the Gibbs sampling step essentially requires support for a Markov switching vector autoregression. The current Statsmodels switching models are all univariate, but there should not be any difficulty expanding to a VAR (the Hamilton filter / Kim smoother only requires the computed likelihoods). This is in my todo list (no timeline though, it's whenever I get back to that project); the real impediment isn't writing the switching VAR code, it's that getting unit tests together always takes some time. To implement it, I suggest extending the MarkovSwitching class (see the MarkovRegression and MarkovAutoregression classes for examples) with e.g. a MarkovVAR class. The only thing you really need to implement is the We're not quite set up to perform Gibbs sampling in a state space framework; there is a simulation smoother available in a pull request, that will be merged after v0.8 is released (of course you could use the PR's branch right now). If you want to estimate the state space model by maximum likelihood, then it's a different procedure. You need to use Kim's approximate version of the Hamilton filter; that would more difficult to implement. There was a GSoC project on that subject this last summer, but it was in Python and its performance is not so good yet. I have improved versions in Cython, but they're not ready yet. |
How hard to you think it would be to generalize your model to one where you have multiple time series all sharing the same switching factor (like Equation (1) in http://pages.uoregon.edu/jpiger/research/published-papers/chauvet-and-piger_2008_jour.pdf )
And do you have any tips to someone who might give this a try?
The text was updated successfully, but these errors were encountered: