- Introduced by
- James D. Hamilton
- Year
- 1989
- Type
- Markov regime-switching time-series model
What does it do?
The Markov regime-switching model, introduced by James D. Hamilton in 1989, is a hidden-state time-series model in which a series behaves with different parameters across distinct regimes.
In finance it is used for returns or volatility, for example bull/bear or high/low-volatility states. An unobserved Markov state governs which parameter set is active at each point in time. The form shown on this page is a regime-switching autoregression of the kind used in later applications; Hamilton's original paper modelled the growth rate of a nonstationary series.
The intuition behind the method
Markets do not behave the same way all the time: calm bull periods and turbulent bear periods have very different average returns and volatility. Instead of forcing one set of parameters on the whole series, this model assumes the market silently switches between a small number of hidden regimes. You never observe the regime directly, but the data reveal it: when returns suddenly become more volatile, the model infers a switch to the high-volatility state and adjusts its expectations accordingly. A transition matrix captures how sticky each regime is and how likely the market is to flip from one to another.
History
James D. Hamilton introduced the Markov-switching approach in his 1989 Econometrica paper. It modelled occasional discrete shifts in the growth rate of a nonstationary series, with a regime-dependent mean, and gave algorithms for inferring the unobserved shifts together with maximum likelihood estimation. The paper applied the method to U.S. business cycle dynamics. The level-based autoregressive form displayed on this page is a generalisation used in later applications. Ang and Bekaert (2002) later applied regime-switching models to interest rate data from the United States, Germany and the United Kingdom, reporting better out-of-sample forecasts than single-regime models in that setting. The two cited sources cover business cycles and interest rates. The use of the same framework for equity returns and volatility is a later extension in the finance literature, for example the chapter by Savku and Weber on regime-switching models with applications to finance, and is not documented by Hamilton (1989) itself.
When to use it
Choose this model for a continuous financial series when you have a substantive reason to think the data-generating process moves between a small number of recurring states, such as calm and turbulent volatility or bull and bear return regimes. It suits regime classification and forecasting conditional on the current regime. Series of a few hundred observations or more are usually needed. The exact requirement depends on the number of regimes and on how well separated the regime means and variances are. No cited source fixes a minimum, and the figure of about 100 observations listed for this page is only a rough lower bound. Choose the number of regimes by comparing fitted models, not by assumption. AIC and BIC are useful guides, but likelihood-ratio tests for an additional regime do not follow standard chi-square distributions, because some parameters are unidentified under the null. Check the stability and economic plausibility of each candidate. Do not use the model for short series, where regime-specific parameters cannot be estimated reliably, or when there is no theoretical or empirical basis to expect more than one regime. An ordinary single-regime autoregression is the appropriate benchmark in those cases.
Limitations and considerations
- Requires a reasonably long series to estimate the regime-specific parameters with any precision. Roughly a hundred observations is a bare minimum, and a few hundred or more is usually safer.
- The number of regimes is not determined by the estimation itself. It must be chosen using information criteria and judgement, and standard likelihood-ratio tests are not valid for this comparison. Adding regimes that the data do not support produces unstable estimates.
- Maximising the likelihood over the mean, persistence, variance and transition parameters is non-linear and can converge to local optima. The regime labels are also arbitrary up to permutation, so results must be interpreted through the estimated parameters rather than the labels.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Represents abrupt shifts in mean and autoregressive behaviour between regimes, which a single-parameter-set autoregression cannot capture.
- Gives regime-specific parameters (mean, persistence and error variance) and a transition matrix whose diagonal entries show how long each regime tends to last once entered.
- The Hamilton filter produces, for each date, the probability of each regime given the data available up to that date, which can be read as a real-time regime classification.
Applications
- Modelling shifts between bull and bear regimes in asset returns, with regime-specific means and volatilities.
- Identifying high- and low-volatility states for risk assessment and volatility forecasting.
- Analysing regime changes in interest rates, as in Ang and Bekaert (2002).
- Dating business cycle regimes from macroeconomic series, following the original application in Hamilton (1989).
How it works
How it works
Within each regime S_t the series follows its own autoregressive process: a regime-specific mean μ, persistence φ, and error variance σ². When the hidden state changes, these parameters change too, so a bull regime can carry a different average return and a calmer variance than a bear regime.
Formula
y_t = \mu_{S_t} + \phi_{S_t}\, y_{t-1} + \varepsilon_t,\quad \varepsilon_t \sim \mathcal{N}(0,\sigma_{S_t}^2)The hidden regime evolves as a first-order Markov chain. The transition probabilities p_ij give the chance of moving from regime i to regime j between consecutive periods; the diagonal entries measure regime persistence — how long the market tends to stay in the same state once it enters it.
Formula
P(S_t = j \mid S_{t-1} = i) = p_{ij},\quad \sum_{j} p_{ij} = 1Because the regime is never observed, the parameters and the regime probabilities are estimated jointly by maximum likelihood. The Hamilton filter recursively computes the probability of each regime given the data up to time t, and these filtered probabilities are summed into the log-likelihood that is maximised over the mean, variance, autoregressive, and transition parameters.
Formula
\hat{\theta} = \arg\max_{\theta} \sum_{t} \log\!\sum_{S_t} f(y_t \mid y_{t-1}, S_t;\theta)\, P(S_t \mid \mathcal{F}_{t-1};\theta)Common pitfalls
- Fixing the number of regimes in advance instead of comparing models with AIC or BIC.
- Attaching economic meaning to the labels 'bull', 'bear' or 'high volatility' without checking that the estimated mean and variance of each regime actually differ in the way the label implies.
- Trusting a single optimisation run; without several starting values, the estimates may reflect a local optimum and the inferred regimes may change across runs.
- Applying the model to a short series, where the regimes cannot be distinguished from too few observations, and then reading the estimated transition probabilities as stable features of the market.
Frequently asked questions
How many regimes should I use?
There is no fixed answer; the number of regimes should be selected by comparing models with information criteria such as AIC or BIC. Two regimes (for example calm vs. crisis, or bull vs. bear) is a common and interpretable starting point, but the data and theory should justify any larger number.
What is the difference between filtered and smoothed regime probabilities?
Filtered probabilities use only the information available up to time t and represent the model's inference about the regime at that date. Smoothed probabilities use the whole sample and give a more accurate retrospective dating of past regimes. Smoothed probabilities require a separate backward pass after the filter, which is not part of the estimation formula shown on this page.
What does the transition matrix tell me?
The transition probabilities give the chance of moving between regimes from one period to the next. The diagonal entries measure persistence: a high diagonal value means the market tends to stay in a regime once it enters it, while smaller values imply frequent switching.
How is the model estimated when the regime is never observed?
The parameters and regime probabilities are estimated jointly by maximum likelihood. The likelihood sums, over time, the logarithm of each observation's density averaged over the regimes using the probabilities predicted from past data. The Hamilton filter computes these regime probabilities recursively as the sample is processed.
Related methods
Sources
Hamilton, J. D. (1989). A New Approach to the Economic Analysis of Nonstationary Time Series and the Business Cycle. Econometrica, 57(2), 357-384.
Open DOI referenceAng, A., & Bekaert, G. (2002). Regime Switches in Interest Rates. Journal of Business & Economic Statistics, 20(2), 163-182.
Open DOI referenceDynamic Economic Problems with Regime Switches (2021), Chapter 13: A Regime-Switching Model with Applications to Finance (Savku & Weber), p. 295