RPubs will retire in June 2027. Your existing documents will stay accessible through December 31, 2031
and Connect Cloud is the recommended home for new publishing. Read the blog post

Recently Published

Document
Document
Assignment 6 Q4
Discussion14_GARCH
Document
Market Regime Detection using Hidden Markov Models
This research models the S&P 500’s underlying volatility states using a 2-State Hidden Markov Model (HMM). By assuming the market operates in hidden, non-stationary regimes, we can mathematically isolate periods of low-volatility “bull” markets from high-volatility “panic” phases without relying on lagging moving averages. Three strategies are evaluated out-of-sample using a walk-forward framework: Strategy A (Baseline): Hard binary switching with an expanding training window Strategy B (Rolling Window): Hard binary switching with a fixed 3-year rolling training window, preventing over-indexing on historical crises Strategy C (Soft Allocation): Probability-weighted exposure using the posterior normal-regime probability as a continuous position size, eliminating abrupt switches
codealong9