This is a set of procedure files for setting up Markov Switching univariate linear regressions, with either the full coefficient vector switching or part of the coefficient vector is switching and part fixed. The residual variance can be either switching or fixed. This was revised (May 2012) to allow for time-varying transition probabilities. You also need a matching version of @MSSETUP (http://www.estima.com/forum/viewtopic.php?f=7&t=1207)
If you want to do a linear autoregression using the "Hamilton" model with switching means, use @MSVARSETUP instead (http://www.estima.com/forum/viewtopic.php?f=7&t=512).
@MSRegression( options ) depvar
# list of regressors (if you don't use the EQUATION option)
Options
STATES=# of states [2]
SWITCH=[C]/CH/H
C means that coefficients are switching, H indicates variances are switching.
EQUATION=equation for the regressors
NFIX=# of explanatory variables which are fixed across regimes [0 or all]
If SWITCH=C or CH, the default is 0, if SWITCH=H, it's all. The fixed coefficients must be placed first in the supplementary card for regressors.
Example
This does an AR(4) model on GNP, similar to Hamilton's model, but with all coefficients and variance switching between states (rather than the Hamilton model where only the process mean switches). It's quite a bit faster than the Hamilton model since the likelihood depends only on the current state.
