Instacart's Marketplace team explains why standard OLS regression becomes computationally intractable with high-cardinality fixed effects, and how PyFixest solves this using the Frisch-Waugh-Lovell (FWL) theorem combined with the Method of Alternating Projections (MAP). The post covers geo:time switchback and static-geo experiment designs used to handle treatment spillage, walks through the math of why matrix inversion scales as O(k³), and benchmarks PyFixest against statsmodels and scikit-learn. In a real Marketplace experiment, using high-cardinality fixed effects yielded a 4.1x reduction in standard error — equivalent to having ~17x more observations.
Table of contents
Experimentation on MarketplaceThe High-Cardinality BottleneckApplying the Frisch-Waugh-Lovell TheoremMethod of Alternating Projections (MAP)Get Benjamin Knight ’s stories in your inboxApplicationsConclusionReferences512 Impressions