Researcher course in quantitative foundations
Hidden Markov Models for Market Regimes
Regime-switching models for markets: hidden Markov models, their algorithms and estimation, and how to use inferred regimes without fooling yourself.
Markets behave differently in different periods: calm rising markets, volatile falling ones, and long sideways stretches. A hidden Markov model treats these as unobserved states that switch according to fixed probabilities, and infers from returns which state the market is likely in.
What is a hidden Markov model used for in trading?
Detecting volatility regimes for risk scaling, switching between strategies that work in different conditions, and modelling the dynamics of spreads and interest rates. The most common mistake is using smoothed probabilities, which use future data, in a backtest; the course spends a module on avoiding it.
Who is this course for?
Researchers and quantitative traders who want regime models built properly. It is part of the Fellowship in Computational Finance.
What you will be able to do
- Specify a hidden Markov model for returns and explain each parameter.
- Implement the forward-backward and Viterbi algorithms.
- Estimate an HMM with the expectation-maximisation algorithm and choose the number of states.
- Distinguish filtered from smoothed regime probabilities and explain why only one can be traded.
- Build and test a regime-aware allocation rule.
Syllabus, module by module
Regimes in markets
Evidence for distinct market states and Hamilton's 1989 regime-switching model.
Markov chains
Transition matrices, stationary distributions and expected regime duration.
Hidden Markov models
The model, its likelihood and why the states cannot be observed directly.
Forward-backward
Filtering and smoothing probabilities, derived and implemented.
Viterbi
The most likely state path and when to use it.
EM estimation
The Baum-Welch algorithm, local optima and choosing the number of states.
Look-ahead traps
Why smoothed probabilities leak the future and how to backtest a regime model honestly.
Regime-aware allocation
Switching exposures by regime and measuring whether it helps after costs.
How the certificate is earned
A written, paper-style assessment: derive and implement the estimation, fit a regime model to a market of your choice and test whether a regime-based rule survives out of sample. On a pass you receive the Course certificate in Hidden Markov Models for Market Regimes, issued by the Institute with a verification code. Read how certification works.
Before you start
Probability with conditioning, maximum likelihood, and working Python.
This course counts toward
Questions applicants ask
Can a hidden Markov model detect a bear market in advance?
No model knows in advance. An HMM estimates the probability that the market is already in a given regime, using data up to today. The course measures how quickly that estimate reacts, which is the honest test.
Is this course mainly mathematics or code?
Both. The algorithms are derived, then written from scratch in Python before any library is used.