Markov Switching Linear Regression

Use this forum for posting example programs or short bits of sample code.

Markov Switching Linear Regression

This is an example of the use of the MSREGRESSION procedure (http://www.estima.com/forum/viewtopic.php?f=7&t=1208) for a Markov switching linear regression. While this is the same basic regression equation (and data set) as in Hamilton's work, it is, in fact, quite different because it switches the full coefficient vector (intercept and lag coefficients) and the variance, while Hamilton fixes the variance and lag coefficients and switches the process mean. Hamilton's model is actually quite a bit more complicated because switching the mean creates a dependence of the likelihood at entry t on p+1 lags of the regime where p is the number of lags in the autoregression. Switching everything in the regression means that the likelihood at t depends only upon the regime at t.

When so many things change between regimes, it is much more likely that there will be multiple modes (for instance, high intercept/low intercept; high variance/low variance). Switching variance can also produce problems because the likelihood is theoretically unbounded. (Make one regime isolate a single point and drive its variance to zero). Issues like this are discussed in much greater detail in our course materials:
http://www.estima.com/forum/viewtopic.php?f=24&t=1185

fruehp366b.RPF
Example program

GNP.DAT
Data file