Home / Financial Tools / Hidden Markov Regime-Switching Market Detector
Graduate-Level Modeling · Time Series Econometrics & Regime Detection
Hidden Markov Regime-Switching Market Detector
Markets alternate between calm, rising regimes and volatile, falling ones, but no ticker tells you which one you're in. A two-state Hidden Markov Model treats the regime as a genuinely hidden variable and estimates it from data alone, with the same Baum-Welch and Viterbi algorithms behind speech recognition and genomics.
How To Use This Model
Reading This Tool
This tool simulates a return series that secretly switches between a bull regime and a bear regime according to hidden transition probabilities you control, then forgets which regime generated which day and re-estimates everything, the two regimes' means and volatilities, and the transition matrix between them, purely from the observed returns, using Baum-Welch expectation-maximization.
The Viterbi tab then asks a different question: given the fitted model, what is the single most likely sequence of hidden regimes that produced this exact data? That decoded path is compared directly against the true simulated regimes the model never saw, so you can see, concretely, how well regime detection actually works.
True Regime Parameters
What Baum-Welch Recovered, Blind
ConvergedEstimated Bull Mean / Vol
-
Estimated Bear Mean / Vol
-
Estimated Bull Persistence
-
Final Log-Likelihood
-
Log-Likelihood Across EM Iterations (Must Be Non-Decreasing)