Markov-Switching VAR

vartime-varying-parametermarkov-switchingbayesian

Definition

A Markov-Switching VAR (MS-VAR) is a Vector Autoregression in which some parameters switch over time according to a discrete Markov chain. Introduced by Sims and Zha (2005a) as a principled alternative to continuous random-walk coefficient drift models, it restricts time variation to a finite number of states while preserving structural shock interpretability.

Key Ideas

How It Works

Motivation: The Overfitting Problem in TVP-VARs

Standard time-varying parameter (TVP) VARs let all coefficients drift as a random walk:

θt=θt1+ηt,ηtN(0,Q)\theta_t = \theta_{t-1} + \eta_t, \quad \eta_t \sim \mathcal{N}(0, Q)

This is over-parameterized: the dimension of time variation in QQ equals the number of parameters, far exceeding the effective dimension of variation in the data. It also conflates changes in structural coefficients with changes in shock variances, making structural shock identification ambiguous.

Discretization of a Latent AR(1)

Suppose a scalar parameter ztz_t evolves as:

zt=ρzt1+νt,νtN(0,σ2)z_t = \rho\, z_{t-1} + \nu_t, \quad \nu_t \sim \mathcal{N}(0, \sigma^2)

Discretize the support [2σz,2σz][-2\sigma_z, 2\sigma_z] (two unconditional standard deviations) into mm states using thresholds τ1<τ2<<τm1\tau_1 < \tau_2 < \cdots < \tau_{m-1}. State ii corresponds to zt[τi1,τi]z_t \in [\tau_{i-1}, \tau_i] (with τ0=\tau_0 = -\infty, τm=+\tau_m = +\infty). The transition probability from state jj to state ii is:

πij=Pr(zt[τi1,τi]zt1[τj1,τj])\pi_{ij} = \Pr(z_t \in [\tau_{i-1}, \tau_i] \mid z_{t-1} \in [\tau_{j-1}, \tau_j])

=Ψ ⁣(τiρτˉj1ρ2σ)Ψ ⁣(τi1ρτˉj1ρ2σ)= \Psi\!\left(\frac{\tau_i - \rho\, \bar{\tau}_j}{\sqrt{1 - \rho^2}\,\sigma}\right) - \Psi\!\left(\frac{\tau_{i-1} - \rho\, \bar{\tau}_j}{\sqrt{1 - \rho^2}\,\sigma}\right)

where τˉj\bar{\tau}_j is the midpoint of interval jj and Ψ()\Psi(\cdot) is the standard normal cumulative distribution function (CDF). This analytical form means the transition matrix Π=[πij]\Pi = [\pi_{ij}] is fully determined by (ρ,σ,m)(\rho, \sigma, m).

For m=9m = 9 states, Zha (2005) uses thresholds τ1=2,τ2=1.5,,τ8=1.5,τ9=2\tau_1 = -2, \tau_2 = -1.5, \ldots, \tau_8 = 1.5, \tau_9 = 2 (in units of σz\sigma_z).

Model Structure

The MS-VAR allows different blocks of parameters to switch independently. For example:

This permits a direct test of whether the post-WWII moderation of US business cycles reflects a change in policy behavior or a lucky reduction in external shock variances.

Key Results (Sims-Zha 2005a, 2005b)

Bayesian Estimation via Data Augmentation — Albert and Chib (1993)

Albert and Chib (1993) provide the first fully Bayesian estimator for a univariate Markov-switching AR model, and the approach generalizes directly to MS-VARs. The model is:

yt=xtβ+γst+εt,εtN(0,σ2(1+ωst)),st{0,1}y_t = x_t'\beta + \gamma s_t + \varepsilon_t, \quad \varepsilon_t \sim \mathcal{N}(0,\, \sigma^2(1 + \omega s_t)), \quad s_t \in \{0, 1\}

where xt=(1,yt1,,ytr)x_t = (1, y_{t-1}, \ldots, y_{t-r})', γ>0\gamma > 0 identifies state 1 as the high-mean state, and ω>0\omega > 0 identifies state 1 as the high-variance state.

Data augmentation key. The full likelihood p(Yθ)p(Y \mid \theta) requires summing over all 2T2^T state paths — Hamilton's filter. Albert and Chib instead treat ST=(s1,,sT)S_T = (s_1, \ldots, s_T)' as missing data. The augmented posterior p(θ,STY)p(\theta, S_T \mid Y) factors into tractable conditionals:

  1. States {st}\{s_t\} — backward pass (single sweep, O(T)): draw sTs_T from p(sTY,θ)p(s_T \mid Y, \theta), then for t=T1,,1t = T-1, \ldots, 1: p(st=jst+1,Y,θ)p(st+1st=j)p(ytst=j,Yt1,θ)p(s_t = j \mid s_{t+1}, Y, \theta) \propto p(s_{t+1} \mid s_t = j)\, p(y_t \mid s_t = j, Y_{t-1}, \theta) Each draw is a binary Bernoulli.

  2. Regression block (β,γ)(\beta, \gamma) — truncated multivariate Normal (truncation: γ>0\gamma > 0), with precision σ2t(1+ωst)1xtxt\sigma^{-2}\sum_t (1+\omega s_t)^{-1} x_t x_t' and conditional mean from generalized least squares (GLS).

  3. Error variance σ2\sigma^2 — Inverse-Gamma with shape n/2n/2 and scale 12t(1+ωst)1(ytxtβγst)2\tfrac{1}{2}\sum_t (1+\omega s_t)^{-1}(y_t - x_t'\beta - \gamma s_t)^2.

  4. Variance scale ω\omega — Inverse-Gamma truncated to ω>0\omega > 0.

  5. AR coefficients ϕ\phi — Normal, drawn conditional on the stationary region.

  6. Transition probabilities — independent Beta draws from transition counts nijn_{ij} (number of iji \to j transitions in STS_T): aSTBeta(u01+n01,  u00+n00),bSTBeta(u10+n10,  u11+n11)a \mid S_T \sim \mathrm{Beta}(u_{01} + n_{01},\; u_{00} + n_{00}), \qquad b \mid S_T \sim \mathrm{Beta}(u_{10} + n_{10},\; u_{11} + n_{11})

Empirical results (interest rates, 1953:3–1990:4). State 1 precisely identifies 1979:4–1982:3 (Volcker Fed tightening): posterior mean ω^2.8\hat\omega \approx 2.8, so state-1 variance is 3.8×\approx 3.8\times state-0. Bayes Factors strongly favor switching over constant-parameter AR. Gross National Product (GNP) growth prefers AR(0) switching with modest variance change.

See James H. Albert, Siddhartha Chib, and Gibbs Sampler.

Joint State Sampling — Chib (1996)

Albert and Chib (1993) and McCulloch-Tsay (1994) drew each state sts_t individually from its full conditional — requiring nn extra Gibbs blocks and producing high autocorrelation when nn is large. Chib (1996) shows the entire state sequence Sn=(s1,,sn)S_n = (s_1, \ldots, s_n) can be drawn jointly in one Gibbs block via a two-pass algorithm.

Forward filter. Maintain an n×mn \times m matrix FF where row tt stores the (unnormalized) filtered probabilities p(stYt,θ)p(s_t | Y_t, \theta):

Ft(Ft1P)dtF_t \propto (F_{t-1}\, P) \odot d_t

where PP is the current transition matrix, \odot is element-wise multiplication, and dtd_t is the row vector of component densities f(ytYt1,θst)f(y_t | Y_{t-1}, \theta_{s_t}) across all mm states. Initialize row 1 from the chain's stationary distribution. The forward pass costs O(nm2)O(nm^2).

Backward sampler. Draw sns_n from the last row of FF. For t=n1,,1t = n-1, \ldots, 1:

p(stYn,St+1,θ)p(stYt,θ)Pst,st+1(eq. 7)p(s_t \mid Y_n, S^{t+1}, \theta) \propto p(s_t \mid Y_t, \theta) \cdot P_{s_t,\, s_{t+1}} \tag{eq. 7}

(row tt of FF, element-wise multiplied by column st+1s_{t+1} of PP, then normalized). One draw per period; backward cost O(nm)O(nm).

Full Gibbs cycle. Three blocks: (1) SnS_n jointly via the above; (2) transition matrix PP — Dirichlet conjugate with updated counts nijn_{ij} of iji \to j transitions in the sampled SnS_n (eq. 10); (3) component parameters, conjugate conditional on SnS_n. This is the discrete-state analogue of the Carter-Kohn (1994) simulation smoother for continuous Gaussian state-space models.

See Chib (1996) and Gibbs Sampler.

Stochastic Segmented Trends — Engel and Hamilton (1990)

Before MS-VARs became standard, Engel and Hamilton (1990) applied the simplest Markov-switching model — a two-state switching mean — to quarterly dollar exchange rates. This is a univariate special case with no autoregressive lags:

Δyt=μst+σstεt,st{1,2}\Delta y_t = \mu_{s_t} + \sigma_{s_t}\varepsilon_t, \qquad s_t \in \{1, 2\}

with Markov transition matrix (p111p221p11p22)\begin{pmatrix}p_{11} & 1-p_{22}\\ 1-p_{11} & p_{22}\end{pmatrix}.

German mark estimates (1973 Q3–1983 Q4): μ^1=1.25%\hat\mu_1 = -1.25\%/qtr (depreciation state), μ^2=+3.3%\hat\mu_2 = +3.3\%/qtr (appreciation state); p^11=0.922\hat{p}_{11} = 0.922, p^22=0.850\hat{p}_{22} = 0.850 — regimes last 13\approx 13 and 7 quarters on average.

Testing. Under the null μ1=μ2\mu_1 = \mu_2 (random walk), the parameters p11p_{11}, p22p_{22} are unidentified — nuisance parameters disappear under the null. This makes classical likelihood-ratio asymptotics invalid. Engel-Hamilton use Wald tests on moment conditions and reject the random walk for Germany, France, and the UK at 5%.

Forecasting. The smoothed regime probabilities (Hamilton filter) correctly identify the dollar appreciation episode of the early 1980s and the preceding depreciation. In-sample MSE improvement over the random walk: 9–14% at 4-quarter horizon. Post-sample (1984–1987) gains are similar.

UIP failure. A key result: interest rate differentials have essentially no predictive content for which regime the exchange rate occupies. During the dollar appreciation episode (state 2), U.S. interest rates were often lower than foreign rates — the wrong sign for uncovered interest parity. See Uncovered Interest Parity.

Permanent/Transitory Decomposition — Engel and Kim (1999)

Engel and Kim (1999) apply a Markov-switching state-space model to 106 years (1890–1995) of monthly U.S./U.K. real exchange rate data. The model decomposes the real exchange rate qtq_t into two unobserved components with independent Markov chains governing their variances:

qt=yt+xtq_t = y_t + x_t yt=yt1+ηt,ηtN(0,ση2(stP)),stP{1,2}y_t = y_{t-1} + \eta_t, \quad \eta_t \sim \mathcal{N}(0, \sigma_\eta^2(s_t^P)), \quad s_t^P \in \{1,2\} xt=ϕxt1+εt,εtN(0,σε2(stT)),stT{1,2,3}x_t = \phi x_{t-1} + \varepsilon_t, \quad \varepsilon_t \sim \mathcal{N}(0, \sigma_\varepsilon^2(s_t^T)), \quad s_t^T \in \{1,2,3\}

Estimated by Gibbs sampling using the Kim (1994) filter/smoother for the latent permanent component yty_t.

Key findings: (1) The permanent component's innovation variance dominates the transitory component's — the real exchange rate has a large permanent component, rejecting purchasing power parity (PPP). (2) The transitory variance states align with the international monetary regime: state 1 (gold standard / Bretton Woods) is nearly zero, state 3 (post-1973 float) is high. (3) Augmented Dickey-Fuller (ADF) unit root tests have actual size of 19% at the nominal 5% level under this data-generating process (DGP) — Markov-switching heteroskedasticity severely distorts classical unit root inference. See Purchasing Power Parity and Structural Break Testing.

Unobserved-Components with Independent MS Variances — Kim and Kim (1996)

Kim and Kim (1996) embed Markov-switching heteroscedasticity within a structural unobserved-components (UC) decomposition of stock prices. The model is:

pt=qt+utp_t = q_t + u_t

where qtq_t is a permanent AR(2) component (qt=ϕ1qt1+ϕ2qt2+vtq_t = \phi_1 q_{t-1} + \phi_2 q_{t-2} + v_t) and utu_t is a transient "fad" AR(1) component (ut=ρut1+etu_t = \rho u_{t-1} + e_t). The innovation variances switch independently:

Var(vt)=σv,Svt2,Svt{0,1}\mathrm{Var}(v_t) = \sigma_{v,S_{vt}}^2, \quad S_{vt} \in \{0,1\} Var(et)=σe,Set2,Set{0,1}\mathrm{Var}(e_t) = \sigma_{e,S_{et}}^2, \quad S_{et} \in \{0,1\}

Independent chains. The two Markov chains are independent of each other, so there are 22=42^2 = 4 combined variance states at each period. An exact filter would require tracking 24=162^4 = 16 Gaussian mixtures across consecutive periods. Kim's (1993, 1994) collapsing approximation retains only 22=42^2 = 4 by collapsing the lagged mixture to a product of marginals, maintaining tractable maximum likelihood (ML) estimation.

Empirical results (monthly real S&P 500, 1952:1–1992:12). ϕ^1=1.168\hat\phi_1 = 1.168, ϕ^2=0.294\hat\phi_2 = -0.294 (near-random-walk permanent component); ρ^=0.045\hat\rho = -0.045 (fad is nearly serially uncorrelated). The high-variance fad state has p^e1=0.647\hat{p}_{e1} = 0.647 (mean duration 2.8{\sim}2.8 months); the low-variance state has p^e0=0.980\hat{p}_{e0} = 0.980 (mean duration 50{\sim}50 months). Only two fad episodes are statistically significant: OPEC 1973–74 and the October 1987 crash. Both are negative fad realizations — unwarranted pessimism, not speculative bubbles.

Model comparison. Log-likelihoods: UC-MS 1383.29-1383.29 > Turner-Startz-Nelson (1989) 1387.72-1387.72 > GARCH(1,1) (generalized autoregressive conditional heteroskedasticity) 1395.05-1395.05. The GARCH near-unit-root persistence (α^+β^0.99\hat\alpha + \hat\beta \approx 0.99) is reinterpreted as a high-persistence low-variance Markov state rather than true I(GARCH) behavior.

See Chang-Jin Kim, Myung-Jig Kim, and Kalman Filter.

Dynamic Factor Model with Regime Switching — Kim and Nelson (1998)

Kim and Nelson (1998) operationalize the synthesis proposed by Diebold and Rudebusch (1996): embed Hamilton's (1989) regime-switching mechanism directly inside the Stock-Watson (1989, 1991) linear dynamic factor model. The result is a model that captures both key features of the business cycle identified by Burns and Mitchell (1946) — comovement among indicators and nonlinearity at turning points — within a single framework.

Model structure. Each of n=4n = 4 monthly coincident indicators ΔYit\Delta Y_{it} depends on current and lagged values of an unobserved common factor ΔCt\Delta C_t (the coincident index) plus an idiosyncratic AR component eite_{it}:

ΔYit=λi(L)ΔCt+Di+eit,i=1,2,3,4\Delta Y_{it} = \lambda_i(L)\Delta C_t + D_i + e_{it}, \quad i = 1,2,3,4

The common factor evolves as an AR process whose mean switches between regimes:

ϕ(L)(ΔCtμStδ)=vt,vtN(0,1)\phi(L)(\Delta C_t - \mu_{S_t} - \delta) = v_t, \quad v_t \sim \mathcal{N}(0,1)

with μSt=μ0+μ1St\mu_{S_t} = \mu_0 + \mu_1 S_t, μ1>0\mu_1 > 0, so μ0<0\mu_0 < 0 in recessions (St=0S_t = 0) and μ0+μ1>0\mu_0 + \mu_1 > 0 in booms (St=1S_t = 1). The transition probabilities are:

Pr[St=1St1=1]=p,Pr[St=0St1=0]=q\Pr[S_t = 1 \mid S_{t-1} = 1] = p, \qquad \Pr[S_t = 0 \mid S_{t-1} = 0] = q

Gibbs sampling: three latent vectors. The model is cast in state-space form. Three unobserved vectors are treated as missing data and sampled in turn:

  1. Common factor path ΔC~T=(Δc1,,ΔcT)\Delta\tilde{C}_T = (\Delta c_1, \ldots, \Delta c_T)' — Conditional on S~T\tilde{S}_T and parameters θ~\tilde\theta, the model is linear Gaussian, so the Carter-Kohn (1994) multimove Gibbs algorithm draws the entire path in one block via the Kalman filter forward pass and backward simulation smoother.

  2. Regime path S~T=(S1,,ST)\tilde{S}_T = (S_1, \ldots, S_T)' — Conditional on ΔC~T\Delta\tilde{C}_T and θ~\tilde\theta, the unobserved index AR(1) in equation (9) is Gaussian, so Hamilton's (1989) basic filter provides p(STΔC~T)p(S_T \mid \Delta\tilde{C}_T); the full path is then drawn backward via: p(StΔC~T,St+1)p(St+1St)p(StΔc~T)p(S_t \mid \Delta\tilde{C}_T, S_{t+1}) \propto p(S_{t+1} \mid S_t)\, p(S_t \mid \Delta\tilde{c}_T)

  3. Parameters θ~\tilde\theta — Conditional on both latent paths, the model factorizes into independent Normal-IG posteriors for each equation's AR coefficients and noise variances, plus Beta conjugate posteriors for pp and qq.

The composite coincident index Ct=Δct+Ct1+δC_t = \Delta c_t + C_{t-1} + \delta is recovered at each Gibbs iteration from the sampled factor path.

Empirical results. Estimated on U.S. data 1960:1–1995:1. Posterior regime probabilities from the multivariate model match the National Bureau of Economic Research (NBER) business cycle dates precisely; the univariate model's regime probabilities are substantially noisier. The new model-based coincident index correlates 0.9825 with the Department of Commerce (DOC) index in first differences, but shows sharper drops during recessions.

Duration dependence extension. The base model's fixed transition probabilities are replaced by a probit specification for the regime indicator, where the probability of a transition depends on how long the current phase has lasted (duration Nj,t1N_{j,t-1}). Coefficients γ2,d2\gamma_{2,d_2} (recession duration effect) and γ3,d3\gamma_{3,d_3} (boom duration effect) are given spike-and-slab priors: γj=0\gamma_{j} = 0 with probability pjp_j (no duration dependence) or drawn from a truncated Normal (positive/negative duration dependence). Posterior probabilities of no duration dependence are read directly from the fraction of Gibbs draws in which the indicator dj=0d_j = 0. Strong evidence of positive duration dependence in recessions (posterior Pr[no dependence] ≈ 0.01–0.19 across prior configurations); weak and prior-sensitive evidence for booms.

See Chang-Jin Kim, Charles R. Nelson, Kim-Nelson (1998), and Variable Selection.

Plucking Model as UC-MS — Kim and Nelson (1999a)

Kim and Nelson (1999a) provide the first formal econometric model of Friedman's (1964) "plucking" hypothesis: that output cannot exceed a trend ceiling and is occasionally plucked downward by transitory recessions that always rebound. The model decomposes output yt=τt+cty_t = \tau_t + c_t into a stochastic trend ceiling and a transitory cycle with an asymmetric Markov-switching shock:

ut=πSt+ut,utN(0,σu,St2),St{0,1}u_t^* = \pi S_t + u_t, \quad u_t \sim \mathcal{N}(0, \sigma_{u,S_t}^2), \quad S_t \in \{0, 1\}

where π<0\pi < 0 during recessions (St=1S_t = 1) and π=0\pi = 0 otherwise. The trend evolves as a random walk with stochastic drift: τt=gt1+τt1+vt\tau_t = g_{t-1} + \tau_{t-1} + v_t, gt=gt1+wtg_t = g_{t-1} + w_t. Setting π=0\pi = 0 and homoskedasticity recovers Clark (1987)'s linear UC; the asymmetry is uniquely placed in the transitory component rather than the trend (unlike Hamilton 1989 / Lam 1990).

Estimation uses the Kim (1994) approximate maximum likelihood estimator (MLE) filter: Kalman updates are run conditional on all (St=j,St1=i)(S_t = j, S_{t-1} = i) pairs, and the resulting 2×22 \times 2 Gaussian mixture is collapsed back to 2 components via Harrison-Stevens (1976) approximations at each step. This contrasts with the exact Gibbs-sampling approach in Kim-Nelson (1998).

Empirical results (U.S. real gross domestic product (GDP) and unemployment, 1951:1–1995:3):

See Chang-Jin Kim, Charles R. Nelson, Kim-Nelson (1999a), and Plucking Model.

Structural Break in MS Model — Kim and Nelson (1999b)

Kim and Nelson (1999b) ask whether Hamilton's (1989) Markov-switching business-cycle model itself underwent a structural break. They augment the model with a latent absorbing state DtD_t (Pr[Dt=1Dt1=1]=1\Pr[D_t=1|D_{t-1}=1]=1) that allows a one-time permanent shift in the regime-dependent mean growth rates μSt\mu^*_{S_t} and/or the innovation variance σ2\sigma^2: μSt,t=μSt+μSt,postDt,σt2=(1Dt)σ02+Dtσ12\mu^*_{S_t,t} = \mu_{S_t} + \mu_{S_t,\text{post}}D_t, \qquad \sigma^2_t = (1-D_t)\sigma^2_0 + D_t\sigma^2_1

Four models compared via Bayes factors (Chib 1995/1998 reduced-run marginal likelihood):

Model Break type ln mm
I None (Hamilton benchmark) −267.63
II Shift parameters only −247.01
III Variance only −253.70
IV Both −260.19

Key findings: Model II wins under all three prior specifications. The dominant source of the Great Moderation (break at 1984:Q1) is a narrowing boom–recession gap, not a pure decline in shock variance. Pre-break: recession mean 1.025-1.025, boom mean 0.4860.486. Post-break: recession mean 0.195-0.195, boom mean 0.1370.137. Within a linear model, regime-gap narrowing is observationally equivalent to variance decline; the MS framework is necessary to identify both separately.

See Great Moderation, Chang-Jin Kim, Charles R. Nelson, Kim-Nelson (1999b).

Why It Matters

MS-VARs provide a middle ground between constant-parameter VARs (too rigid) and random-walk TVP-VARs (too flexible). The discrete-state structure enables:

Open Questions

Related