live: regime-switching Monte Carlo, parameters from my fitted HMM

Anupam Prabhugouda Patil

AI engineer & quantitative finance researcher. I build agent systems that run research autonomously — and test whether popular quant ideas survive honest out-of-sample evaluation, publishing the code either way.

Automation engineering @ GRD Trucking · MS Finance, UC Riverside · 3 working papers · open to forward-deployed / AI engineer & quantitative research roles — global

0
working papers
0
CI-verified tests
0
frozen rules forward-testing daily
0
out-of-sample days
0
years of market data

Working Papers

My research agenda is the honest out-of-sample evaluation of quantitative finance claims: the field produces models faster than it validates them, and the backtest-overfitting literature shows why most published edges are artifacts. I build the evaluation machinery — walk-forward protocols, forecast-comparison tests, tail-risk backtests — and apply it to claims that matter. Every number below reproduces from public data with one command; automated tests re-verify the papers’ results on every commit.

How Many Retail Trading Strategies Survive Honest Evaluation?
A systematic survey: eight classic strategy families, full parameter grids, judged by the backtest-overfitting toolkit

2026 · 8 strategy families × full config grids · 15y daily data, 120 tickers · Deflated Sharpe + PBO/CSCV + OOS holdout + walk-forward

Built a research engine that tests classic retail strategy families — momentum, mean-reversion, trend, turn-of-month, volatility-managed and more — across their entire parameter grids, then judges every one through a pre-registered evaluation gate: Deflated Sharpe Ratio, Probability of Backtest Overfitting, minimum backtest length, and a held-out 70/30 out-of-sample split, net of costs. Hypotheses are frozen in a public registry before running; a scheduled agent re-validates them weekly on newly accrued data and flags any unregistered addition as a mining violation.

Finding: no market-neutral family survives the gate. The apparent survivors are long-only equity beta-timing flattered by a bull-market window and a survivorship-biased universe — and the paper says so. Twelve frozen rules continue forward-testing daily in a public paper-trading arena; the forward record, not the backtest, gets the last word.

Do Hidden Markov Regimes Add Out-of-Sample Value?
Separating fat tails from hidden states in volatility forecasting, density calibration, and tail risk

2026 · 7 models · S&P 500, NASDAQ 1999–2026 · WTI 1986–2026 · 5,600–8,900 OOS days incl. 2008 & COVID

Implemented Gaussian and Student-t hidden Markov models from scratch (Baum–Welch, Viterbi, online filtering) — the mathematics Renaissance Technologies was founded on — and fielded them against GARCH-Normal/t, EWMA, and simpler baselines across three scoring dimensions: variance point forecasts (QLIKE, Diebold–Mariano, Hansen–Lunde–Nason model confidence sets), predictive densities (log score, Berkowitz), and tail risk (VaR at 1/2.5/5% with Kupiec & Christoffersen backtests; expected-shortfall calibration), plus crisis-window analysis and a state-count sweep.

Finding: fat tails — not hidden states — repair VaR/ES calibration (the Student-t HMM and GARCH-t are the only calibrated pair; every Gaussian model over-breaches). Recursive variance, not regime discreteness, provides crisis adaptivity: HMM volatility ceilings estimated on pre-crisis history breached a 1% VaR on 7–8% of days in late 2008 while GARCH-t breached 1.2%. Hidden states earn their keep descriptively — discovering the leverage effect unsupervised.

Do Machine-Learning Filters on Directional-Change Events Survive Out-of-Sample?
A cautionary study across equities and commodities

2026 · walk-forward + transaction costs + block-bootstrap inference · 3 asset classes, 20–33 years

Reproduced a published event-based trading strategy and subjected it to the discipline of the backtest-overfitting literature: expanding-window walk-forward evaluation, realistic transaction costs, and stationary block-bootstrap significance tests. The naive trade-every-event rule is strongly loss-making after costs; an ML filter rescues it but never generates statistically significant excess returns over buy-and-hold.

Finding: an honest null. The strategy’s published edge is an artifact of weak evaluation; its one robust benefit is a roughly halved maximum drawdown. Rigorous null results, transparently established, are genuine contributions.

Method as identity: reproducibility as a first-class result

Every estimator in both papers is implemented from first principles and validated on synthetic data with known properties (known hidden paths, known GARCH dynamics, known quantile coverage) before touching markets. Every number regenerates from public data with one command, and a continuous-integration test suite re-verifies the papers’ anchor results on every commit — the green badges above are live. Results that cannot be re-derived are claims, not findings.

Explore the Hidden States

This is my model running on 27 years of S&P 500 data — a 3-state Gaussian HMM, fitted by Baum–Welch, with each week coloured by its decoded hidden state. Hover to inspect; the lower band is the smoothed probability of the turbulent state. The model was never told what volatility is — it discovered these regimes, and the leverage effect (calm markets drift up, turbulent markets crash down), from raw returns alone.

calm normal turbulent S&P 500, log scale · weekly · 1999–2026

Interactive chart: vanilla JS, no libraries. Data exported directly from the paper’s fitted model.

The Honest Evaluation Game

Think you can beat the market? Prove it — then let my research judge you. You’ll trade a hidden 18-month slice of real S&P 500 history. The tape plays in real time; toggle between LONG and FLAT whenever you like (2 bps cost per switch). When it ends, I run the same statistics on you that my papers run on trading strategies: Sharpe ratio, excess return over buy-and-hold, and a block-bootstrap significance test. Then I reveal when you were trading — and what my model’s hidden states knew about it.

press start

Keyboard: L long · F flat. Real weekly S&P 500 closes; window drawn at random from 1999–2026.

Live Demos

Real-time data apps you can open right now — no login, no API key, running entirely in the browser on live public feeds.

Crypto Self-Learning Forecaster ↗

Coinbase WebSocket · online learning · localStorage

A 15-minute price forecast that makes a point prediction every minute, scores itself against a random-walk baseline 15 minutes later, and adapts by gradient descent. Features include live order-flow and book imbalance. Honest by design — it tends to learn there is no edge, and shows you the scoreboard proving it.

Insider Radar ↗

SEC EDGAR · Form 4 · cluster detection

A live feed of corporate insider open-market purchases — the rare event of an executive spending their own cash on their own stock — with detection of buy clusters (≥2 insiders, same stock, 14 days), the variant of the signal with the strongest academic support. Sales are deliberately ignored as noise.

Live Events Tracker ↗

USGS · ISS · ADS-B · Leaflet

A world map of live earthquakes, the ISS, and aircraft — plus a self-learning seismic module that fits the Gutenberg–Richter b-value (~1.0) live and rate-forecasts against a naive baseline. The instructive contrast: self-learning genuinely beats the baseline here (stationary seismic rates), where it can't for crypto prices.

An AI-Engineered Research Desk That Runs Itself

The research above isn’t run by hand. I build and operate a fleet of LLM-agent and scheduled-automation systems that collect data, take registered paper trades, mark books against live option chains, score their own forecasts, and audit their own inputs — every day, unattended. This is the engineering I want to do professionally: agents deployed against a real, messy domain, with verification designed in.

A pre-registered paper-trading arena

Twelve frozen mechanical rules take paper trades daily on a 120-ticker universe. Every rule is written into a public registry with its thesis before it runs; the full blotter, open book and per-rule record are committed to the repo on every run. A weekly sentinel agent diffs the code against the registry and flags unregistered strategies as mining violations.

The forward record, drawn from the committed blotter

Arena forward record: cumulative excess vs SPY and per-rule averages

Regenerated from reports/arena_trades.csv — equal-weight paper units, not capital returns. Honest caveats apply and are in the paper: few independent entry days, a survivorship-tilted universe, and a mean-reversion family the 15-year backtest already convicted. The forward record decides; this is it accruing in public.

Self-scoring forecast ledgers

Every research agent must file probabilistic forecasts, which are scored later with Brier decomposition (calibration vs resolution) — agents are graded on calibration, not on being right. The crypto forecaster and seismic module below are public examples: each keeps a scoreboard against a naive baseline and shows it, including when the honest answer is “no edge.”

Case study: one wrong price → read it

My own book recorded QBTS at a price it hadn’t traded at for weeks — every one of ~50 automated checks was green. The write-up covers the diagnosis (a stale feed fossilizing into a permanent record), the correction that violated my own audit rule, and the structural fixes, each proven by breaking it first. The most FDE-shaped thing I’ve written.

Input-integrity tooling

Validated analysis on unvalidated inputs is still wrong — so the desk grew its own guards: recorded entry prices are checked against the tape, every published figure carries a provenance stamp naming its inputs, options marks carry a quality flag (stale source, wide book) and untrusted marks are shown struck through rather than silently believed.

Unattended data collectors

Scheduled agents (launchd + GitHub Actions) run an SEC EDGAR Form 4 collector, a Coinbase order-flow recorder, an after-close intraday day-type recorder, and options-chain snapshots — growing datasets that make previously unanswerable questions testable. The insider feed and its Pages viewer deploy automatically on every collection.

The Question I Want to Pursue in a PhD

My results establish two complementary failure modes: mixture models achieve calibrated tails but their state ceilings break under unprecedented stress; recursions adapt instantly but thin tails fail extreme-quantile risk everywhere. The natural hybrid — regime-switching GARCH, persistent hidden states with within-state adaptive variance — has never been put through this evaluation gauntlet. Can it deliver correctly calibrated tail risk through unprecedented crises, out of sample? More broadly: when does model sophistication genuinely improve out-of-sample risk measurement — and how do we detect when it does not?

Experience

Automation Engineer / Analyst — GRD Trucking

Jul 2026 – present · drayage logistics
  • Designing and building the company’s dispatch and billing automation: document ingestion, order entry, rating and invoicing pipelines replacing manual spreadsheet workflows.
  • LLM-assisted document processing for the messy reality of freight paperwork — rate confirmations, PODs, invoices — with human-review checkpoints where accuracy is contractual.
  • Forward-deployed in practice: requirements come from dispatchers mid-shift, and the software has to survive contact with real operations the same week.

Financial Analyst — Friendly Franchisees LLC

Dec 2024 – Jan 2026 · La Palma, CA · $100M+ multi-unit QSR portfolio
  • Led monthly FP&A reporting across 60 operating units — revenue trends, cost structure, operating-margin performance.
  • Prepared monthly and quarterly reporting packages: variance analysis, KPI dashboards, executive summaries for senior leadership.
  • Developed forecasting and budgeting models incorporating operational metrics, improving planning accuracy.
  • Supported lender reporting, covenant-compliance monitoring, and DSCR analysis for refinancing and acquisition transactions.
  • Contributed to a 12% EBITDA improvement through cost tracking, labor-efficiency analysis, and benchmarking.

Real Estate Analyst Intern — Silverstar Real Estate

Jul – Sep 2024 · La Palma, CA
  • Built DCF and scenario models for acquisitions across a $30M+ portfolio.
  • Sensitivity and downside-risk analysis under changing market conditions.

Portfolio Manager — Hylander Student Investment Fund

Sep – Dec 2024 · UC Riverside · ~$275K AUM
  • Co-managed the fund to a 16.8% FY return; directly managed a $28.5K industrial-sector allocation.
  • Pitched Howmet Aerospace (HWM): +33%, the fund’s best performer.

Chief Financial Officer — International Collegiate Business Strategy Competition

Dec 2023 – Apr 2024 · UCR team

Led financial strategy; placed 1st in the presentation category.

Projects & Code

Everything public, at github.com/jarvisss007.

regime-monte-carlo

From-scratch HMMs (Gaussian & Student-t), GARCH benchmarks, regime-switching Monte Carlo, full tail-risk evaluation toolkit. 20 CI-verified tests. Home of working paper #2.

dc-ml-trading

Directional-change event engine, walk-forward ML backtester, block-bootstrap inference. Home of working paper #1. MIT licensed, citable (CITATION.cff).

StockTrak post-mortem

Doubled a $1M simulated portfolio in 8 weeks (+109%) — then wrote the CAPM/Carhart regression showing it was beta 7.5, not alpha. Honest evaluation is the brand.

Option-analysis

Options analytics pipeline: chain data, Black-Scholes Greeks, ML classification, backtests (2024).

Stock-analysis

Early equity-trading experiments: features, ML, PPO reinforcement learning (2024).

backtest-overfitting

Tools for detecting when a backtest is fooling you: Deflated Sharpe Ratio, Probability of Backtest Overfitting (CSCV), minimum backtest length. The honest-evaluation thesis as a reusable library.

strategy-lab

The systematic survey engine: 8 strategy families judged by the deflation+PBO gate, a frozen pre-registration registry, and a 12-rule paper-trading arena whose forward book commits daily. Home of working paper #3.

crypto-microstructure

Live Coinbase order-flow dashboard, self-learning 15-min forecaster, and an honest backtest harness (IC, permutation test, cost-aware). Live ↗

live-events-tracker

No-key world map of earthquakes, the ISS, and flights with a self-learning seismic module (Gutenberg–Richter b-value, rate forecasting). Live ↗

insider-radar

SEC EDGAR Form 4 collector + live feed of insider open-market purchases with buy-cluster detection. Live ↗

this site

Vanilla HTML/CSS/JS, no frameworks; the regime explorer renders my paper’s fitted model.

Publications

How Many Retail Trading Strategies Survive Honest Evaluation? A Systematic Survey

Working paper · Aug 2026 · repo

8 strategy families × full parameter grids; Deflated Sharpe, PBO/CSCV, OOS holdout, pre-registered hypotheses, live forward test.

Do Hidden Markov Regimes Add Out-of-Sample Value? Separating Fat Tails from Hidden States

Working paper · Jul 2026 · repo

7 models × 3 assets × 3 scoring rules; Kupiec/Christoffersen/Berkowitz backtests, model confidence sets, crisis windows.

Do Machine-Learning Filters on Directional-Change Events Survive Out-of-Sample? A Cautionary Study

Working paper · Jul 2026 · repo

Walk-forward, transaction costs, stationary block-bootstrap inference; a reproducible null.

A New Computerized Method of Detecting Leukemia

Turkish Online Journal of Qualitative Inquiry · Nov 2021 · co-authored

Classification of leukemia types from microscopic blood-cell images.

An Automated Detection of Leukemia

IJRASET · Aug 2021 · co-authored

Early-stage disease detection via image analysis of blood samples.

Education

Master’s in Finance — University of California, Riverside

Sep 2023 – Dec 2024

Financial econometrics, quantitative finance, options & futures, fixed-income securities, portfolio theory, risk management.

B.E., Biomedical Engineering — B.M.S. College of Engineering

Sep 2018 – Aug 2022 · Bangalore, India · CGPA 8.08/10

Applied mathematics, programming, signal processing; Operations Research elective (93/100) sparked the turn toward quantitative methods.

Skills & Certifications

Quantitative research
Baum–Welch / HMM (from scratch)GARCH MLE VaR/ES backtestingKupiec · Christoffersen · Berkowitz Diebold–MarianoModel Confidence Sets block bootstrapwalk-forward evaluation
AI engineering
LLM agent systems (Anthropic API / Claude)agentic workflow design scheduled autonomous pipelines (launchd, GitHub Actions)self-scoring / eval harnesses provenance & input-integrity toolingforecast calibration (Brier decomposition)
Programming & data
Python (pandas, scikit-learn, scipy)SQL C++pytest & GitHub Actions CILaTeX advanced Excel
FP&A
budgeting & forecastingvariance analysis KPI dashboardslender & covenant reporting DSCR analysis
Tools & certifications
Capital IQBloomberg Terminal Akuna Capital Options 101