Skip to main content

Cookies on Macro by Mark.We use essential cookies for sign-in, locale, and security. With your permission, we also use optional cookies for preferences, for analytics, and for advertising measurement with the Meta (Facebook) Pixel. Read our cookie policy.

Macro by MarkMacro by Mark
  • Home
Loading…
Loading…
← Models
MacroConceptsPolicyModels

Markov-switching VAR Model

Regime-switching macro system where latent states govern recession and expansion dynamics through transition probabilities.

OverviewGraphMathReferences

How do you model an economy that periodically switches between expansion and recession, with different dynamics in each state?

Background

Linear VARs treat every quarter the same. Recessions aren't just low-growth quarters on the same linear trajectory as expansions. Output drops faster in downturns than it rises in booms. Volatility spikes during crises. The Phillips curve may steepen. Hamilton (1989) built a model that takes this asymmetry seriously: the economy occupies one of MMM discrete regimes at each date, transitions between regimes follow a first-order Markov chain, and the autoregressive dynamics are regime-specific. His original application to US real GNP growth identified two regimes - expansion and recession - with transition probabilities that closely tracked NBER business-cycle dates. This model extends the reduced-form VAR, already documented in the VAR page of this platform.

The mechanism is a hidden Markov model (HMM) applied to a time-series regression. A latent state variable st∈{1,2,…,M}s_t \in \{1, 2, \ldots, M\}st​∈{1,2,…,M} governs which set of parameters is active at time ttt. The transition between states follows P(st=j∣st−1=i)=pijP(s_t = j | s_{t-1} = i) = p_{ij}P(st​=j∣st−1​=i)=pij​, and the collection of transition probabilities forms the M×MM \times MM×M transition matrix PPP. Conditional on being in regime st=ms_t = mst​=m, the VAR has regime-specific intercepts c(m)c^{(m)}c(m), lag coefficients Aj(m)A_j^{(m)}Aj(m)​, and error covariance Σ(m)\Sigma^{(m)}Σ(m). The econometrician doesn't observe sts_tst​ directly - it must be inferred from the data.

Inference on the latent state uses the Hamilton filter (forward recursion) and the Kim smoother (backward recursion). The Hamilton filter computes the filtered probability P(st=m∣y1:t)P(s_t = m | y_{1:t})P(st​=m∣y1:t​) - the probability of being in regime mmm given data up to time ttt. The Kim smoother computes the smoothed probability P(st=m∣y1:T)P(s_t = m | y_{1:T})P(st​=m∣y1:T​) - the probability given the full sample. Smoothed probabilities are the standard reporting output. When the two-regime model is applied to US GDP growth, the smoothed recession probability spikes above 0.8 during every NBER recession and stays below 0.2 during expansions.

Markov-switching models are standard at central banks for recession-probability monitoring. Hamilton's GDP-based recession-probability index, derived from a Markov-switching model, is published via Econbrowser and FRED. The ECB uses MS-VARs to study asymmetric monetary policy transmission across business-cycle phases. Chauvet and Hamilton (2006) maintain a monthly coincident recession indicator for the US based on a multivariate MS model using employment, income, industrial production, and sales. Academic researchers use MS-VARs for exchange-rate dynamics (Engel and Hamilton 1990), stock-market volatility regimes (Turner et al. 1989), and fiscal policy analysis under regime uncertainty.

Connections to explore

Math ↗The structure and its conditions, step by step.References ↗Academic sources and guidance for using the model.

How the Parts Fit Together

sts_tst​

Latent regime indicator

Unobserved discrete state variable taking values in {1,2,…,M}\{1, 2, \ldots, M\}{1,2,…,M}. Governs which set of VAR parameters is active at time ttt.

The model consists of two interlocking pieces: a regime-specific VAR and a Markov chain governing regime transitions. The regime-specific VAR at time ttt is yt=c(st)+A1(st)yt−1+⋯+Ap(st)yt−p+ut(st)y_t = c^{(s_t)} + A_1^{(s_t)} y_{t-1} + \cdots + A_p^{(s_t)} y_{t-p} + u_t^{(s_t)}yt​=c(st​)+A1(st​)​yt−1​+⋯+Ap(st​)​yt−p​+ut(st​)​ where ut(st)∼N(0,Σ(st))u_t^{(s_t)} \sim N(0, \Sigma^{(s_t)})ut(st​)​∼N(0,Σ(st​)). Intercepts, lag coefficients, and error covariances can all switch, though parsimony often restricts switching to a subset (e.g., intercepts and volatility switch, lag coefficients don't).

The Markov chain is characterized by the transition matrix PPP with pij=P(st=j∣st−1=i)p_{ij} = P(s_t = j | s_{t-1} = i)pij​=P(st​=j∣st−1​=i), where rows sum to one. For a two-regime model, PPP has two free parameters: the probability of staying in expansion p11p_{11}p11​ and the probability of staying in recession p22p_{22}p22​. Expected regime durations are 1/(1−pmm)1/(1 - p_{mm})1/(1−pmm​): if p22=0.8p_{22} = 0.8p22​=0.8, the expected recession duration is 5 quarters. The ergodic probabilities - the unconditional fraction of time spent in each regime - are derived from the left eigenvector of PPP associated with eigenvalue 1.

Estimation by maximum likelihood uses the EM algorithm. The E-step runs the Hamilton filter and Kim smoother to compute smoothed probabilities and regime-conditional expectations of sufficient statistics. The M-step updates the VAR parameters in each regime by weighted OLS (weighted by smoothed probabilities) and updates the transition probabilities from the smoothed transition counts. Convergence is declared when the log-likelihood increment falls below a threshold. Bayesian estimation via MCMC is an alternative: the regime path s1:Ts_{1:T}s1:T​ is drawn from its full conditional using the forward-filtering, backward-sampling (FFBS) algorithm, and the regime-specific parameters are drawn from their conditional posteriors.

Assumptions

Maintained

First-order Markov property

The regime at time ttt depends only on the regime at t−1t-1t−1: P(st∣st−1,st−2,…)=P(st∣st−1)P(s_t | s_{t-1}, s_{t-2}, \ldots) = P(s_t | s_{t-1})P(st​∣st−1​,st−2​,…)=P(st​∣st−1​).

If violated:Higher-order dependence (duration dependence) means the probability of leaving a regime depends on how long you've been in it. The first-order model assumes geometric regime durations, which may be too restrictive for business cycles.

Testable

Fixed number of regimes

The number of regimes MMM is known and fixed. Typically M=2M = 2M=2 (expansion/recession) or M=3M = 3M=3 (expansion/slow growth/recession).

If violated:Too few regimes miss distinct economic states; too many overfit. Standard likelihood-ratio tests don't have standard distributions because the null hypothesis lies on the boundary of the parameter space (the Davies problem). Hansen (1992) and Carrasco, Hu, and Ploberger (2014) provide modified tests.

Testable

Correct specification within each regime

Conditional on the regime, the VAR is correctly specified: the lag length is right, the residuals are Gaussian, and the parameters are constant within the regime.

If violated:Misspecification within a regime (wrong lags, non-Gaussian errors) biases the regime-specific parameters and can cause the filter to misclassify regimes.

Maintained

Constant transition probabilities

The transition probabilities pijp_{ij}pij​ are time-invariant.

If violated:If transition probabilities depend on economic variables (time-varying transition probabilities, as in Filardo 1994), the constant-PPP model averages across different conditional probabilities of regime change.

Testable

Ergodicity of the Markov chain

The transition matrix PPP is irreducible and aperiodic, so the chain has a unique stationary distribution.

If violated:An absorbing regime (pmm=1p_{mm} = 1pmm​=1) means the chain never leaves that regime after entering. This is a structural break, not a recurrent regime.

Testable

Identification from data moments

The regime-specific parameter values are sufficiently different that the data can distinguish the regimes. Identical parameters across regimes produce an unidentified model.

If violated:Near-identical regime parameters make the likelihood nearly flat over the transition probabilities, and the EM algorithm or MCMC converges slowly or not at all.

Applications

Hamilton's (1989) original application estimated a two-regime AR(4) for US real GNP growth from 1951 to 1984. The model identified a high-growth expansion regime (mean growth ≈ 1.2% per quarter, probability of staying ≈ 0.90) and a low-growth recession regime (mean growth ≈ -0.4% per quarter, probability of staying ≈ 0.75). The smoothed recession probabilities lined up with NBER recession dates with striking accuracy, providing the first formal statistical basis for what business-cycle analysts had been doing informally. Hamilton's GDP-based recession indicator (published via Econbrowser and FRED) and the Chauvet-Hamilton (2006) monthly coincident indicator are direct descendants of this work.

MS-VARs are used to study asymmetric transmission. Ehrmann, Ellison, and Valla (2003) estimated a Markov-switching SVAR for the US to test whether monetary policy has different effects in recessions versus expansions. Hubrich and Tetlow (2015) at the ECB used MS-VARs to study financial stress and its nonlinear impact on the real economy. The Bank of Japan uses MS models to date the transitions in and out of the deflationary regime that characterized the 1990s-2010s.

The model breaks down when the number of regimes is uncertain, when the regimes are not recurrent (a one-time structural break doesn't fit the MS framework well), or when the number of variables is large. The parameter count scales as MMM times the VAR parameters per regime plus M(M−1)M(M-1)M(M−1) transition probabilities, which becomes unwieldy for M>3M > 3M>3 or large VARs. For gradual structural change rather than discrete regime switches, TVP-VARs are more appropriate.

Testing for the number of regimes is non-standard because under the null of M=1M=1M=1 (no switching), the transition probabilities are not identified, violating regularity conditions for the likelihood ratio test. Hansen (1992) derived bounds for the test, but they are conservative. Carrasco, Hu, and Ploberger (2014) proposed an optimal test. In practice, researchers often compare 2-regime and 3-regime specifications using information criteria (AIC, BIC) or Bayesian marginal likelihoods, acknowledging that formal tests are imperfect.

Extensions and open questions

Variants

  • MS-I (intercept switching only)
  • MS-H (heteroskedasticity switching only)
  • MS-IH (intercept + heteroskedasticity)
  • MS-IA (intercept + autoregressive coefficient switching)
  • MS-IAH (all parameters switch)
  • Time-varying transition probability MS (Filardo 1994; Diebold, Lee, and Weinbach 1994)

Open questions

  • How to test for the number of regimes without relying on non-standard test distributions
  • Whether time-varying transition probabilities (TVTP) are needed for real-time recession dating, or whether constant-PPP models suffice
  • How to combine Markov switching with structural identification (sign restrictions, proxy instruments) in a tractable framework

Keep going

Read next

Continue with a related concept, model, or example.

Theory model

IS-LM Model

a well-connected theoretical model two steps from here

New angle: theoretical model →
Macro by Mark
Help
Privacy PolicyTerms of UseEthics and Compliance

© 2026 Mark Jayson Nation LLC