Prism Data Lab

Every analysis here ships its dataset and the code that produced every figure. Nothing on this site is investment advice.

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.