Methods
Time series, risk measures, backtesting discipline, and the statistics that keep an analysis honest.
Methods covers the arithmetic and statistics that keep an analysis honest: returns, risk measures, backtesting discipline, bonds, deflators and curve fitting. Each note works the method by hand in Python on a public series, checks it wherever a check exists, and names the mistakes it invites.
Start with log returns and simple returns, the choice every later calculation depends on. Sharpe, Sortino and max drawdown by hand makes each decision behind those numbers explicit on ten years of S&P 500 data, and Value at Risk three ways computes historical, normal and Cornish-Fisher VaR, then backtests each day by day with the Kupiec test. Backtest overfitting shows with a simulation why the best of many backtests looks good even when every strategy is noise, and applies the deflated Sharpe ratio. Bond math from first principles derives price, yield, duration and convexity, checks each derivative against a finite difference and applies them to the Treasury par curve; Nelson-Siegel on the Treasury curve fits that curve on 5,171 days and shows where three numbers miss. Real versus nominal explains how to deflate a series and six ways to get it wrong; from January 2021 to August 2026, real hourly pay fell by the CPI and rose by the PCE price index.
Multiple-testing corrections are applied in two notes filed under Data Analysis, the FOMC event study and the month-of-year tests.
-
Nelson-Siegel on the Treasury curve: where three numbers miss
Nelson-Siegel fitted to 11 Treasury yields on 5,171 days misses by 9.4 bp on a median day; since May 2020 the 20-year sits above a curve fitted without it daily.
-
Real versus nominal: deflating a series correctly, and six mistakes
From January 2021 to August 2026, real hourly pay fell 0.8% by the CPI and rose 1.7% by the PCE price index. How to deflate, checked against the BLS, and six traps.
-
Bond math from first principles: price, yield, duration, convexity
Price, yield to maturity, Macaulay and modified duration, and convexity derived and coded from scratch, then applied to the Treasury par curve of 2026-09-09.
-
Value at Risk three ways, backtested on the S&P 500
Historical, parametric normal, and Cornish-Fisher VaR computed on ten years of FRED's S&P 500 series, then backtested day by day with the Kupiec coverage test.
-
Log returns, simple returns, and the compounding errors people make
Simple and log returns on ten years of FRED's S&P 500 series: the sum identity, variance drag, the size-of-move gap, and the mistakes each choice invites.
-
Sharpe, Sortino, and max drawdown computed by hand on the S&P 500
Sharpe, Sortino, and maximum drawdown worked step by step in Python on ten years of FRED's S&P 500 series, with a 3-month Treasury risk-free rate, year by year.
-
Backtest overfitting: the deflated Sharpe ratio and a simulation
Why the best of many backtests looks good on pure noise, then the deflated Sharpe ratio and PBO tested on 200 moving-average rules on Treasury yields.