notes · paper walkthroughs · from-scratch

The Notebook

Papers I find interesting, read closely, and rebuild: a plain-language summary, the math reimplemented from scratch in TypeScript, live charts, and — where the idea maps onto a 2D toy — a link to poke at it on the model pages. Same rules as the rest of the site: no ML libraries, every number computed in your browser.

Jul 14, 202612 min

Meta-labeling, read closely

A trading paper bolts a second model onto the first: keep its direction, learn which of its calls to trust. We rebuild the filter from scratch — and find it only adds value when it sees something the first model never did.

paper walkthrough
Jul 13, 202613 min

Training a strategy to maximise Sharpe, read closely

A 2019 paper throws away the hand-tuned momentum rule and trains a network to maximise the Sharpe ratio directly. We rebuild the Sharpe loss from scratch — and find the number it optimises is the one it never has to pay for.

paper walkthrough
Jul 12, 202612 min

When a model says 90%, read closely

A 2017 paper shows modern nets are confidently wrong — and that dividing the logits by one number fixes it. We rebuild ECE and temperature scaling from scratch, then find the one knob can make calibration worse.

paper walkthrough
Jul 11, 202612 min

Extended isolation forest, read closely

Isolation Forest scores anomalies by how fast random cuts fence a point off — but its axis-parallel cuts smear a coordinate-frame bias across the score map. We rebuild it from scratch, expose the phantom corridors, and watch one tilted-cut change erase them.

paper walkthrough
Jul 10, 202612 min

Order flow imbalance, read closely

A microstructure paper shows the mid-price move over a few seconds is a near-linear function of order-flow imbalance — and integrating the whole book explains ~84% of it. We rebuild OFI from scratch, then watch it forecast almost none of the next move.

paper walkthrough
Jul 9, 202612 min

Hierarchical risk parity, read closely

A 2016 paper builds a diversified portfolio without ever inverting the covariance matrix — and beats the textbook optimiser out-of-sample. We rebuild it from scratch and find its edge is all estimation error, not a better objective.

paper walkthrough
Jul 8, 202612 min

Conformal prediction for portfolios, read closely

A 2024 paper turns return forecasts into intervals with a distribution-free coverage guarantee, then picks portfolios from them. We rebuild it from scratch — and watch the guarantee quietly break the moment the market changes regime.

paper walkthrough
Jul 7, 202611 min

Why trees beat deep nets on tables — until you rotate

A NeurIPS 2022 paper explains why gradient-boosted trees still beat neural nets on tabular data. We reproduce its sharpest test from scratch: a random rotation flips the ranking, because a tree lives in its coordinate frame.

paper walkthrough
Jul 7, 202612 min

The virtue of complexity, read closely

A Journal of Finance paper times the market with more parameters than data points — and wins. We rebuild its random-feature ridge from scratch, watch double descent appear, and find where the money actually comes from.

paper walkthrough
Jul 7, 20269 min

LGBM for stock returns, read closely

A gradient-boosting paper predicts next-day S&P 500 returns and builds a portfolio. We reproduce its indicators from scratch, chart its results — and read the Kelly number it buries.

paper walkthrough