Basic Prerequisites: 04 · Hidden Markov Models and Mean–Variance (or Risk Parity).
1. Intuition & Practical Objective
Regime detection is not an end in itself - its payoff is deciding what to do differently given the regime you are probably in. This page extends the models three ways: (1) regime-based tactical allocation (shift equity weight with the filtered bull probability), (2) richer regime dynamics (regime-dependent volatility - Tsay Ch 12’s Markov-switching GARCH-M; multivariate regimes), and (3) the Bayesian/MCMC estimation frontier (Gibbs, Metropolis–Hastings, FFBS) as the alternative to EM.
The practical claim (Ang & Timmermann 2012; Kritzman, Page & Turkington 2012): returns in different regimes have different means, vols, and correlations, so a static allocation is wrong in every regime by construction - it is a compromise tuned to no state. A regime-aware allocation tilts toward risky assets when the bull probability is high and de-risks when it collapses, targeting the conditional opportunity instead of the unconditional one.
2. Mathematical Ground Truth & Derivations
Regime-conditional risk. In a 2-regime world the unconditional return distribution is the regime-weighted mixture
so the unconditional variance mixes the two volatilities and the squared mean gap:
The last term is the volatility of the regime itself - the reason regime models explain fat tails and vol clustering that a single Gaussian cannot (Ang & Timmermann’s survey frames this as the economics of regime switches).
Allocation policy. A natural regime-aware rule: hold equity weight when the filtered bull probability exceeds a threshold, otherwise,
using the one-period-lagged filtered probability (only causal information). This is exactly the Ang–Timmermann portfolio-choice setting: the conditional mean/variance used in a mean-variance (or risk-parity) objective is regime-weighted, so the optimizer’s inputs - and hence its weights - move with the filtered state.
Estimation frontier - MCMC (Tsay Ch 12, verified). EM gives point estimates; the Bayesian alternative samples the full posterior. The pieces (all verified against tsay_ch10-12.md):
- Gibbs sampling: iterate draws of each parameter from its full conditional given the others and the data; discard burn-in , treat the rest as an approximate iid posterior sample. Point estimate .
- Metropolis–Hastings: for intractable conditionals, accept a candidate with probability .
- FFBS (forward-filtering–backward-sampling, Ch 12.8): run the forward filter, then draw the whole latent state sequence jointly backward - the natural sampler for regime/state-space latent variables.
- Markov-switching GARCH-M (Ch 12.9): regimes drive both the mean and the conditional volatility, with the GARCH coefficients themselves regime-dependent; estimated via Gibbs with Griddy-Gibbs on the nonlinear coefficients.
3. Computational Implementation - regime-based tactical allocation vs static
Simulate a 2-regime equity market (bull: mean , vol ; bear: mean , vol ) plus a low-risk bond, run a Hamilton filter to get the live bull probability, and compare a static 60/40 against a regime-tactical rule (95% equity when , 20% otherwise). Stdlib only.
On this synthetic path the regime-aware rule raises the Sharpe by ~70% ( vs ) and cuts the worst drawdown by about three-quarters ( vs ) by cutting equity weight the periods the filter judged bearish. (The wealth figures are compounding artifacts of the synthetic per-period returns - compare the Sharpe and drawdown, not the terminal wealth.) This is the concrete payoff of regime detection: it converts a static compromise into a state-conditional bet.
4. Failure Modes & First-Principles Breakdowns
- The allocation inherits the detection lag. You trade on the filtered (causal) probability, which lags the true regime - exactly the cost that quantifies how regime-aware allocation must be. The smoothing accuracy of 04 · HMM is not available to a live trader; the causal filter is weaker.
- Parameter estimates are load-bearing. The allocation trusts estimated under a specific regime count and identification. Feed it a label-switched or over-fit model (05 · Failure Modes) and the “bull/bear” tilt is noise. Penalize (BIC) and constrain (ordering) before allocating.
- Turnover / whipsaw cost. Switching weights with a noisy filtered probability churns the portfolio and pays transaction costs; the tactical rule above ignores these. A persistence filter (only switch after stays above/below the threshold) trades latency for turnover.
- Regime homogeneity is an assumption. A “bull” equity regime may coexist with different bond/credit/correlation behavior; univariate regime detection says nothing about the joint structure. Multivariate regime models (Tsay Ch 10) are needed for that.
5. References
- Ang, Andrew & Timmermann, Allan: Regime Changes and Financial Markets, Annual Review of Financial Economics 4, 313–337 (2012)
- Kritzman, Mark, Page, Sébastien & Turkington, David: Regime Shifts: Implications for Dynamic Strategies, Financial Analysts Journal 68(3) (2012)
- Tsay
- Hamilton (1989)
6. Connected Graph Bridges
- Back: 04 · HMM · 05 · Failure Modes · Index Hub
- Portfolio: Risk Parity (vol targeting) · Mean–Variance · Black–Litterman (views meet regime estimates)
- Risk: ES) · Stress Testing & Scenario Analysis (regimes as scenarios)
- Bayesian/MCMC base: Bayesian Statistics · ML cross-link: Regime Classification: HMM & GMM