One investigation, Parts 1 to 12

The case

You are a junior analyst building a risk report on eleven US instruments. The report grows after most sessions, a part at a time, from two stocks compared by hand in Part 1 to every model of the course side by side in Part 12.

How it works

  • A part after most sessions. Parts are numbered by session, so there is no Part 7, 10 or 13: those sessions are case lectures of their own.
  • Each part starts where the last one stopped. From Part 2 on, a quick load cell restores the numbers the earlier parts worked out, so you can start a part even if you skipped the one before.
  • Do the session's exercises first. The exercises teach the moves; the case asks you to choose which move to make.
  • Run all is safe. Every cell runs before you fill in its ..., and hints and solutions are folded under each question.

The report, part by part

What each part asked, what it added to the report, and the number it ended on, as Part 12 sums it up. "Open" starts the part in Colab.

PartThe questionWhat it addedThe number
1Which of Apple and Coca-Cola moved more in 2024?lists, slicing and a first gauge, the price rangeApple 51.22 percent, Coca-Cola 26.15open
2Volatility from every daily returnloops, functions, a dictionary of five stocksNvidia 0.0330 a day, Coca-Cola 0.0080open
3All eleven instrumentspandas: returns, annualised volatility, rankings, figuresNvidia 53 percent a year, the S&P 500 fund 13open
4Which names will be volatile next month?a target, features from the past, a split by date, two baselinesthe average 0.00514, persistence 0.00417open
5The first modellinear regression on vol_20d, chosen on time-ordered folds0.00402, ahead of persistence on 11 of 11open
6Every column the desk hasOLS, ridge, the lasso, pipelines, GridSearchCVridge 0.00460 against 0.00412; ahead on 7 of 11open
8Will next month be busier?logistic regression, the threshold, the AUCAUC 0.797open
9A jump, priceda rare label, costs, a threshold of 0.25, calibration, k-NNAUC 0.889; a cost of 178 against 210open
11Trees and forestsa tree, bagging, a forest tuned on the folds, out-of-bagthe forest 0.00462, level with ridgeopen
12Boosting, and the report as a wholeboosting, XGBoost, importance, every model side by sideboosted stumps 0.00398 and 0.00780; the forecast staysopen

Where it ends

Parts 1 to 3 described a year that had happened. Part 4 turned the report into a question about the next month and set the rules every later part kept: a target that cannot see the future, a split by date, and baselines to beat. Parts 5 to 12 then brought one family of models after another to that question, and each was held to the same test block and the same folds.

The report that goes out holds a volatility forecast, a warning before a jump, and the evidence for both. On the folds, the one-column model from Part 5 was never beaten by enough to replace it.