Hidden Markov Model Regime Conditioning for Deep Learning Stock Forecasting
Abstract
Stock forecasting remains difficult because financial time series data are known to be noisy, volatile, and affected by market regimes. As the number of retail investors increases, providing accessible forecasting tools to support their decisions under volatile market conditions becomes an increasingly relevant challenge. To algorithmically infer underlying market regime, Hidden Markov Models (HMMs) are commonly used, while deep learning models are used to capture complex patterns in time-series data. However, the effect of adding HMM regime information to different deep learning forecasting models remains unclear. This study evaluates HMM conditioning for deep learning stock forecasting using Long Short-Term Memory (LSTM), Temporal Fusion Transformer (TFT), and Patch Time-Series Transformer (PatchTST) models. This study used historical daily stock data from 12 diverse large-cap U.S. equities, spanning six major Global Industry Classification Standard (GICS) sectors. A three-state Gaussian HMM was used to infer market regimes, which are added as input feature covariates for each model. Results show that regime integration yields architecture dependent results. HMM conditioning severely degraded PatchTST across all metrics and resulted in marginal shifts for LSTM, while enhancing TFT’s statistical accuracy and financial utility. These findings suggest that forecasting frameworks using discrete HMM regime conditioning rely on model capability to process discrete data without interfering with the continuous temporal data.