I am discovering the marvellous world of such called “Hidden Markov Models”, also called “regime switching models”.
I would like to adapt a HMM in R to detect trends and turning points. I would like to build the model as generic as possible so that I can test it on many prices.Can anyone recommend a paper? I have seen (and read) (more than) a few but I am looking for a simple model that is easy to implement.
Also, what R packages are recommended? I can see there is a lot of them doing HMM.
I have bought the book “Hidden Markov models for time series: an introduction using R”, let see what’s in it 😉
Fred
Answer
I think a few methods that can be used, but not designed specifically for you, are as follows:
Modeling approaches:

Topic Models (used to find patters in a set of documents and/or information retrieval)
a. Simplest one is LDA
b. Dynamic topic models (IMHO, most suited for your case, without much domain knowledge)
c. Correlated topic models (IMHO, if 2. is not good, it makes sense to try this)
These approaches are not used in finance (I am not aware, as I don’t work in specifically in finance), but they have very general applicability. They use the latent variable formulation, which is very similar to that of HMM. They have shown to be stateoftheart in topic modeling. You can watch a nice presentation by David Blei (great presenter, apart from his awesome!! research) here. The specific references, the slides for the presentation, and more complicated models can be accessed from his website. He is doing some great work which is very general, so it might not be surprising if he has already done something in finance. Another great reference in the same field is his advisor, Michael Jordan’s, website. Its hard to find specific references there as he publishes so much!

Time series and sequential data models (HMM specifically)
Apart from Jordan and Blei, the other prolific research is Zoubin Ghahramani (and his coauthor Beal). You can find here the specific HMM models that you require. A few impressive ones are: The infinite hidden markov models, Time sensitive Dirichlet Process Mixture Models.

Software
There is a R package called lda and topicmodels for most of the “good” models. Blei and Ghahramani maintain C, Matlab codes on their website as well.
Good Luck!
Attribution
Source : Link , Question Author : RockScience , Answer Author : suncoolsu