home/posts notes projects archive

A blog on technical topics I like, written from first principles. Each essay leans on plots and figures you can move, because an idea only lands once you have seen it.

Posts

In progressRead the essay →

Deriving Gradient Boosting from a Single Decision Tree

From the best constant to one tree to boosting: what a gradient means for a function, the second-order leaf and split score, and what separates XGBoost, LightGBM and CatBoost.

In progressRead the essay →

Endogeneity in Media Mix Models: Why a Budget Is Not an Experiment

Why a media mix model can credit advertising with demand that was coming anyway: endogeneity derived from a covariance identity, three ways it arises, and what controls and instruments repair.

In progressRead the essay →

Deriving Matching and Difference-in-Differences from Potential Outcomes

Potential outcomes, causal graphs, matching for the effect on the treated and difference-in-differences, derived from the missing half of every customer, with a playbook and two worked cases.

DraftRead the draft →

A/B Tests and Quasi-Experiments from First Principles

A coin flip, a pre-test covariate, a nudge, a cutoff and a before-and-after comparison, derived from potential outcomes with one trick: subtract what the groups share, divide by how far the design moved the treatment.

DraftRead the draft →

Deriving the Distributions from a Coffee Shop, Part 1: The Customers

One shop, one coin and one clock: binomial, Poisson, exponential, gamma, beta and negative binomial derived from them, then used to decide how many baristas to staff and how many croissants to bake.

DraftRead the draft →

Deriving the Distributions from a Coffee Shop, Part 2: The Money

The normal, lognormal and compound Poisson from sums, products and random counts of baskets, and the range for tomorrow's revenue.

DraftRead the draft →

Deriving the Distributions from a Coffee Shop, Part 3: The Promotion

What a discount does to the clock, the coin, the queue and the margin, and what a short trial says about whether it pays.

DraftRead the draft →

Deriving the Prior-Data Fitted Network

From Bayesian prediction to tabular in-context learning, Do-PFN, and time-series forecasting. With figures you can move.