Capstone — One Market, Every Model

What 74 entries add up to: the findings of the two libraries, and the risk-governed decision system built on them

The synthesis of the whole site: 37 equations and 37 machine-learning models, every one tested against the same Nasdaq-100 data. The consistent verdicts — direction is unpredictable at every level of sophistication, volatility is structured and forecastable — the constructive decision-systems tier built on them, and a reading path through it all.

Between them, the Equation Library and the Machine Learning Library now contain 74 entries — 37 mathematical concepts and 37 machine-learning models and methods, each built to the same standard: explained from first principles, implemented in Python, illustrated with an original figure, and tested honestly against the same real dataset — a decade of daily Nasdaq-100 data. Every number cited anywhere on this site was computed and verified before it was written down.

That shared dataset was a deliberate choice, and it is what makes a synthesis possible. Because every model faced the same market and the same two questions — can you predict tomorrow’s direction? and can you predict tomorrow’s volatility? — the libraries are not a collection of isolated demos but a single controlled experiment, run with escalating firepower from a sample mean to a transformer. Findings one to three are what that experiment measured; finding four is the site’s constructive turn — a ten-entry decision-systems tier that asks what to do about the findings, and proves each component against a known answer before trusting it. A reading path at the end walks through the whole thing in order. This page is what it all adds up to.

Finding one: direction is unpredictable at every level of sophistication

The central empirical result of the entire site. Asked to predict whether the Nasdaq closes up or down tomorrow, every model — from a linear regression to a transformer — lands at a coin flip:

Every model, same market, same two questions. Direction hugs 0.50; volatility sits reliably above it.
Model Direction (test AUC) Volatility (test AUC)
Logistic regression 0.51 0.56
Decision tree (unpruned) ~0.50 0.50
Random forest 0.52 0.57
Gradient boosting / LightGBM 0.57–0.58
Support vector machine 0.51 0.57
Neural network (MLP) 0.48 0.56
1D CNN (41 parameters) 0.49 0.57
RNN / LSTM 0.50–0.52 0.53–0.57
Transformer (self-attention) 0.50 0.56

The pattern is not a failure of any model — it is the models agreeing. The entropy of the daily up/down sequence is ~0.99 of a bit (near-maximal uncertainty); its autocorrelation is negligible; the Hurst exponent sits near 0.5 (random walk); and the most powerful architecture in the library, given every advantage, attends diffusely because there is no relevance structure to find. The deep-learning entries sharpen the point into a cautionary tale: the MLP drove its training accuracy past 80% on direction while its test accuracy fell to 0.50 — a universal approximator’s capacity buys memorisation, not signal. A near-efficient index keeps its secret at every level of model sophistication.

Finding two: volatility is structured, persistent, and forecastable

The same models, asked about risk instead of return, all find signal — and the structure runs deep. Volatility clusters: every capable supervised model extracts roughly the same 0.56–0.58 AUC from it. The unsupervised models discover it without labels: K-means recovers calm, sell-off, and rally day-clusters whose regimes persist (1.8× next-day volatility after a turbulent day); the Gaussian mixture explains the fat tails (excess kurtosis 7.6) as a calm Gaussian plus a crisis Gaussian, rejecting a single Gaussian by 506 BIC points. The hidden Markov model makes it dynamic: a 12%-volatility calm state and a 33%-volatility turbulent state, each persisting for weeks (stay-probabilities 0.98), whose dated turbulent spells are 2018, COVID, and the 2022 bear market — recovered from returns alone.

Two refinements are worth carrying forward. The volatility signal is short-range — the LSTM, with ten times an RNN’s memory and four times its parameters, ties it exactly, because tomorrow’s volatility depends on the last few days. And the best predictors of volatility are trend features, not volatility itself — the moving-average ratio and momentum reach 0.60–0.63 univariate AUC via the leverage effect (volatility rises after prices fall), a fact SHAP confirms day by day: the model’s most turbulent-day flag decomposed into +0.114 from a −4.7% twenty-day drawdown. Volatility knowledge is risk knowledge: the regime-scaled strategy cut maximum drawdown from −23% to −14% — while costing return in a bull window. Regime awareness manages risk; it does not manufacture alpha.

Finding three: the ways a backtest lies — measured

The quant-specific section turned the site’s skepticism on the research process itself, and put numbers on each failure mode. Leakage manufactures signal from nothing: selecting the 20 “best” of 2,000 random features on the full sample produced a cross-validated AUC of 0.81 on pure noise (0.53 done correctly); shuffled k-fold on an overlapping-label task reported 0.87 where honest walk-forward showed 0.60. Multiple testing manufactures Sharpe from luck: the best of 10,000 random, edgeless strategies posts an in-sample Sharpe of 1.63, while in-sample and out-of-sample rank are uncorrelated (r = 0.01) — and a Sharpe of 1.31 that is “significant” for one test is worthless after adjusting for a thousand trials. Even the standard diagnostics mislead: the default impurity importance handed a planted noise feature a 20% share. The defences — point-in-time features, pipelines inside the CV loop, purged and combinatorial cross-validation, deflated Sharpe ratios, permutation importance — are not pedantry. In each demonstration they were the difference between a publishable-looking illusion and the truth.

Finding four: given all this, a decision system — every component checked against a known answer

Findings one through three are, in the end, negative: what you cannot predict, and the ways you can fool yourself into thinking you can. The site’s final arc — a ten-entry decision-systems and reinforcement-learning tier — is the constructive reply to the same evidence. If direction is unpredictable and only risk is structured, the task is not to forecast the market but to make risk-governed decisions under that reality, and to prove each component works before trusting it. That proof took one repeatable form: every learner was validated against a known analytic optimum — the reinforcement-learning counterpart of the verification discipline the empirical libraries applied to measurement. Value iteration converged to the exact optimal value function; Q-learning recovered the same policy model-free; policy gradients and PPO hit the closed-form optimal exposure w^*=\mu/(2\lambda\sigma^2) from samples alone; risk-constrained RL drove a leverage-hungry agent from 6.3× to the exact CVaR cap of 1.41×; Almgren–Chriss execution matched its closed form to twelve decimals; the Hamilton filter and the Shapley efficiency axiom checked out the same way. A learner that cannot recover an answer you already know cannot be trusted with one you don’t.

And the empirical findings survive into the decision tier rather than being wished away. Regime awareness still manages risk without manufacturing alpha — the regime MDP and the risk overlays cut drawdown sharply while costing return in the decade’s bull market, exactly as finding two warned. Honesty still is not skill — a deliberately over-confident direction model was recalibrated from 0.105 to 0.062 calibration error while its AUC stayed pinned at the coin flip of finding one. And naïve intuition still misleads — credit assignment revealed that a reactive drawdown-stop destroys Sharpe, and that a leave-one-out audit gets the most valuable agent’s sign wrong. The tier maps one-to-one onto the proposal’s six agents — regime, news, trading, risk, review and behaviour — giving each a formal, working, verified foundation. The constructive turn does not overturn the thesis; it builds honestly on top of it.

The thesis, in one paragraph

A decade of daily data, 74 entries, and every model from a sample mean to a transformer converge on one statement: the return dimension of a near-efficient market is essentially unpredictable, the risk dimension is genuinely structured, and most apparent exceptions are your own methodology lying to you. The skill this site set out to demonstrate is not finding a magic model — none exists in this data — but building the mathematical foundations, implementing every model honestly, testing each claim against reality, being disciplined enough to report 0.50 as 0.50, and then building a decision system that respects all of it. That discipline — volatility and regimes for risk, deflated skepticism for returns, explanation before trust, and every learner checked against a known optimum — is the foundation the Quant Lab experiments and the PhD research proposal build on.

A reading path

The site is large; here is the order I would read it in.

In ten minutes — read this page (the four findings and the thesis), then the PhD proposal. That is the whole argument.

The empirical case — follow the controlled experiment where it is sharpest: the return/risk split in regime-aware modelling (the HMM), the fat tails in the Gaussian mixture, and the ways a backtest lies in data leakage and overfitting in trading systems — the four entries that most change how you read every other result on the site.

The constructive arc — read the decision-systems tier in build order, because each entry is motivated by the last: MDPsQ-learningpolicy gradientsPPOrisk-constrained RL build the trading and risk agents; change-point detection and Markov-switching regression complete the regime agent; calibration & conformal prediction make its outputs trustworthy; credit assignment and market microstructure add the review and execution layers.

The destination — the PhD proposal ties every entry to a specific agent through its evidence tracker, now complete.

All figures cited here are drawn from the individual library entries, where each is computed, sourced, and verified against the shared multi_daily.csv Nasdaq-100 dataset (yfinance, adjusted closes, ~2,900 daily observations). Minor variation between entries (e.g. RNN volatility 0.53 vs 0.57) reflects independent implementations and feature sets, documented in each entry’s notes.