Estimation of the markov switching model in c++.