Feb 25

## Markov Regime Switching Models

Posted by abiao at 19:46 | Code » Matlab | Comments(5) | Reads(35129)
I am not a fan of Markov Regime switching model, it is hard for me to really define how high is a high regime, or how low is a low regime, let alone the method to detect the regime switch. In case you like it, here is a good package for Markov Regime Switching Models in Matlab, it provides functions for estimation, simulation and forecasting of a general Markov Regime Switching Regression.

Features of the package:
- Support for univariate and multivariate models.
- Support of any number of states and any number of explanatory variables.
- Estimation, by maximum likelihood, of any type of switching setup for the model. This means that you can choose which coefficients in the model, including distribution parameters, are switching states over time.
- A wrapper function for the estimation of regime switching autoregressive models, including multivariate case (MS-VAR) is included in the package.
- The values of standard error for the estimated coefficients can be calculated with 2 different methods.
- Includes a C version of hamilton’s filter that may be used for speeding up the estimation function (see pdf for details).
- Possibility of three distinct distribution assumptions for residual vector (Normal, t or GED).
- Support for reduced/constrained estimation (see pdf document for details).

For instance, as demonstrated here, 3 regimes are simulated as bull, bear and bull markets as
bull1 = normrnd( 0.10, 0.15, 100, 1);
bear  = normrnd(-0.01, 0.20, 100, 1);
bull2 = normrnd( 0.10, 0.15, 100, 1);
returns = [bull1; bear; bull2];

it is not easy to tell from the return series graph below whether there is regime switch or if yes, when or which part is bear

it is, however, possible by looking at the output of the package, (again, here is one of the reasons I don't buy it, I have to specify how many regimes we expect, how can I know it?)

the graph shows clearly when the regime switching starts.

Overall the package is excellent if you are a lover of the model, check it out yourself. For GAUSS users, I shared a regime switching model library in Gaussbefore.

Tags: ,
I've played with this toolbox for a couple of hours, but was not impressed by the achieved results. Maybe it was just me using GIGO (garbage in, garbage out).  Did someonemanage to get something useful (= statistically significant) ?
that's exactly my point, we have to assume there is regime switching and how many regimes are expected in order to use the model effectively, kind of garbage in, gabage out. Anyone trusting this model please educates us.
hi, i'm sara, Phd student of finance, i tried to download the "Markov Regime switching models in matlab", but i couldn't, and i had received this message: "You don't have permission to access "http://www.mathworks.com/matlabcentral/fileexchange/15789-msregress-a-package-for-markov-regime-switching-models-in-matlab" on this server." i really need matlab codes for my thesis. i would be appreciated if you send me this package to my email address: sara_shahryary@yahoo.com