Measurement · Experimentation · Causal Inference

Measurement, experimentation, and causal inference for product.

Paid-media measurement, A/B and causal inference case studies, the experiment-toolkit Python package, and short essays on the methods behind each one.

5
paid-media case studies
6
causal-inference case studies
1
Python package on PyPI
10
essays on the methods

Work

Each one is end-to-end, tested, and reviewable.

A compact paid-media measurement lab covering geo lift, attribution, incrementality, MMM, and web-attribution caveats. Synthetic data, recovered ground truth, decision memos.

  • Geo lift · synthetic control
  • MTA · Markov · Shapley
  • Incrementality · conversion lift
  • MMM · adstock + Hill
  • Cookie loss · ATT

demand-forecasting

Forecasting

Daily demand forecasting on public retail data, evaluated like production: a seasonal-naive baseline, ETS / SARIMA / LightGBM, and a leakage-free rolling-origin backtest. SARIMA reaches MASE 0.74 — 18.5% below baseline — plus a difference-in-differences read that recovers a known +15% promo uplift.

Six worked case studies covering A/B with CUPED, propensity-score methods, difference-in-differences (including Callaway-Sant'Anna), synthetic control, sequential testing, and switchback designs. Each paired with a short memo and the diagnostics that back it.

  • A/B + CUPED
  • PSM · AIPW
  • DiD · CS staggered
  • Synthetic control
  • mSPRT

experiment-toolkit

PyPI · v0.3.0

A small, typed, tested Python package. Sample size and MDE (CUPED-aware), sequential testing (mSPRT), ratio-metric delta method, staggered DiD, and observational sensitivity analysis. Each function cites the paper it implements.

  • pip install experiment-toolkit
  • numpy · scipy
  • 28 tests

SQL-first product analytics case studies. Funnels, retention cohorts, engagement segmentation, and a memo proposing a defensible north-star metric under Goodhart's law.

  • SQL-first
  • DuckDB · Spark SQL
  • Cohorts & funnels
  • NSM memo

analytics-sandbox

Reference

Eighteen SQL problems in the style of large consumer-tech interview loops. Windowed aggregations, sessionisation, retention curves, cohort funnels, with notes on pitfalls and dialect differences.

  • Window functions
  • Sessionisation
  • Retention math
  • Interview prep

Side projects

For fun — algorithms and puzzles outside the day job.

games

Play

Twelve classic and logic-puzzle browser games built with vanilla HTML, CSS, and JavaScript. Generators, solvers, daily-seed puzzles, mobile-first retro-terminal aesthetic. No frameworks, no build step.

  • 12 games
  • Constraint solvers
  • Daily puzzles
  • Play →

Writing

Short essays on the methods behind the case studies.

  1. When boosting loses to SARIMA: baselines, MASE, and honest backtests

    Why a LightGBM lost to a plain SARIMA on a daily retail series — and how the right baseline, metric, and backtest made that the trustworthy answer.

  2. Last-touch attribution systematically under-credits upper funnel

    The structural bias in LTA, why it compounds into budget, and what to reach for instead.

  3. Geo holdouts as paid-media A/B

    Cluster randomisation at the DMA level, synthetic control as its observational cousin, and MDE before you commit.

  4. MMM vs incrementality: what each answers and what neither does

    A measurement stack that earns credibility: MMM for allocation, geo for calibration, incrementality for campaigns.

  5. When TWFE lies: staggered rollouts and what Callaway-Sant'Anna buys you

    Why the default DiD regression is biased under staggered adoption, and what to reach for instead.

  6. E-values: a one-number sensitivity check for observational memos

    Quantifying robustness to unmeasured confounding, with Rosenbaum bounds as the matched-pair companion.

  7. CUPED inside sequential testing: two variance reductions that compound

    When and how to combine CUPED with mSPRT without breaking the always-valid guarantee.

  8. Finding (and fixing) a 17% Type-I error bug in an mSPRT implementation

    A case for property-based tests in statistical code.

  9. LaLonde, revisited: what a replication tells you about PSM, IPW, and AIPW

    What overlap, double robustness, and a known experimental benchmark look like on a classic dataset.

  10. Picking a north-star metric when every candidate has a tradeoff

    A framework for metric selection under Goodhart's law.

Contact

The projects above are the fastest way in. Open an issue and I'll see it.