A Regime-Aware Risk Model: What to Validate Before You Trust the Probability
A single risk model that averages across every market environment mispositions risk in both directions: it overstates volatility in calm months and understates it heading into a crisis. The fix: a regime-aware model that estimates a probability of being in a growth or stress regime instead of a single blended distribution. The buyer question underneath that choice is not whether the model runs. It is whether its regime-probability output can be trusted before it changes an allocation.
Why one distribution misprices risk
Standard risk models fit one mean vector and one covariance matrix to a long history of returns. Bull phases carry moderate drift and compressed volatility; bear phases bring negative drift, volatility spikes, and correlations that move toward one. Blending both into a single distribution understates the tail risk that shows up in a crisis and overstates the volatility priced into calm periods.
A regime-switching model replaces that single distribution with one distribution per regime, plus a transition matrix that governs how the market moves between them. Instead of assigning a single label, the model outputs how likely the market is to be in each regime at a given point in time. This framework traces to Hamilton's original Markov-switching model for business-cycle analysis (Hamilton, "Regime-Switching Models," UC San Diego).
Building the model: a Bayesian Hidden Markov Model
A Bayesian Hidden Markov Model (HMM) with two latent states, growth and stress, treats returns as conditionally Normal given the active regime, with a first-order Markov chain governing transitions between regimes. Fitting it means sampling the joint posterior over the transition matrix, regime means, and regime covariances given observed returns.
The discrete regime sequence itself is analytically marginalized via the forward algorithm, because the sampler used here, the No-U-Turn Sampler, requires a continuous, differentiable parameter space and cannot sample discrete states directly (PyMC NUTS documentation). After fitting, a forward-filter backward-sampler pass recovers the latent regime sequence as smoothed posterior probabilities, the model's best retrospective read on which regime was active.
Validating the model before trusting its output
Before any regime-probability output can inform a real allocation decision, it has to be checked against a known answer. The source demonstration does exactly that on synthetic data with known ground-truth regimes: three synthetic equity series were generated from a known two-regime process, and the fitted model recovered the true regime at 94% of months (measured with hindsight against the known generating regimes), a model-validation check rather than a live-market result. All true regime parameters, meaning the generating means, volatilities, and regime persistence, fell inside their posterior credible intervals, and the model's uncertainty concentrated exactly at the regime transition points, where a well-calibrated model should hesitate.
This is the discipline any model output needs before it drives a decision: check it against a known outcome, and report the uncertainty rather than a single point estimate. Subconscious applies that same standard to its own causal outputs, testing them against real-human validation before a team relies on them for a market decision. Explore how that validation loop works.
What the demonstration does not show
The synthetic-data result shows the modeling machinery recovers a known answer, not real-market performance. Several assumptions built into this version of the model matter to anyone considering it for live risk management:
- Gaussian emissions. Returns within a regime are modeled as Normal, which captures regime-level mean and volatility shifts but not the fat tails real returns can show even conditional on regime.
- A time-homogeneous transition matrix. The probability of switching regimes does not depend on observable signals such as the VIX or the yield curve slope; it is treated as constant over time.
- Two regimes, fixed in advance. The choice of two regimes is a modeling decision, not something inferred from the data.
- An in-sample portfolio illustration. The regime-aware allocation example in the source demonstration was fit and evaluated on the same sample, ignoring transaction costs and re-estimation risk. It is a planning illustration of how a regime probability could inform an allocation rule, not an out-of-sample backtest.
Real markets are also non-stationary in ways synthetic data by construction is not: regimes, correlations, and the rules that govern transitions between them can all shift in the underlying process itself.
The next step is proving it, not assuming it
A regime-probability output is only as useful as the check behind it. Before letting one shape a live allocation, a risk team needs to see it validated against a known outcome, its uncertainty reported, not collapsed into a point estimate, and its assumptions, including the time-homogeneous transitions and Gaussian tails above, stated rather than implied. See how Subconscious structures that kind of validation for a causal claim. Teams evaluating whether this is the right layer for their own risk stack can start with a scoped conversation.