Regime-Aware Reinforcement Learning for Dynamic Multi-Asset Portfolio Allocation Under Non-Stationary Market Conditions

Master's Thesis Project
Indian Institute of Technology Patna (IIT Patna)
GitHub Repository: sour-d/MS-Thesis


1. Project Overview

Dynamic portfolio allocation under non-stationary market conditions represents a fundamental challenge in quantitative finance. Traditional models (Markowitz Mean-Variance, Risk Parity) assume stationary asset return distributions and suffer massive drawdowns during sudden market crashes.

This project implements a decoupled continuous control architecture:

  1. Unsupervised Market Regime Detection: A Gaussian Hidden Markov Model (HMM) calibrated on rolling realized volatility and return indicators to infer latent macroeconomic market regimes (Bull, Sideways, Crisis Shock) without look-ahead bias.
  2. Custom OpenAI Gymnasium Environment: PortfolioEnv enforcing the probability simplex via Softmax projection, proportional transaction costs (10 bps), slippage (2 bps), and Conditional Value-at-Risk (CVaR at 95%) reward shaping.
  3. Continuous Control Deep RL Agent: Stable-Baselines3 PPO/SAC policy networks conditioned on the real-time HMM posterior regime probability vector.
  4. Walk-Forward Cross-Validation: Institutional benchmarking against Equal-Weight (1/N), Markowitz MVO, and Regime-Blind DRL agents.

2. Multi-Asset Indian Market Universe

  • Equity: NIFTYBEES.NS (Nippon India ETF Nifty 50 BeES)
  • Precious Metals / Safe Haven: GOLDBEES.NS (Nippon India ETF Gold BeES)
  • Cash / Debt: LIQUIDBEES.NS (Nippon India ETF Nifty 1D Rate Liquid BeES)
  • Benchmark: ^NSEI (NSE Nifty 50 Index)

3. Usage & Local Reproduction

git clone https://github.com/sour-d/MS-Thesis.git
cd MS-Thesis
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt

# Run complete pipeline
make data
make regime
make train
make evaluate

4. Citation

@mastersthesis{regime_aware_rl_thesis_iitp,
  author       = {Das, Sourav},
  title        = {Regime-Aware Reinforcement Learning for Dynamic Multi-Asset Portfolio Allocation Under Non-Stationary Market Conditions},
  school       = {Indian Institute of Technology Patna},
  year         = {2025}
}
Downloads last month
38
Video Preview
loading