ML Propensity Scores and Weight Clipping
Using flexible machine-learning models instead of logistic regression to estimate the probability of treatment — and why the resulting weights need to be clipped before you trust anything built on top of them.
Prerequisites: Propensity Score Methods
A propensity score is just the probability that a given observation received treatment rather than control, given what you know about it — did this order get routed to venue A, did this customer get the new pricing model, did this trade get flagged for extra scrutiny. Classic propensity-score work estimates this probability with logistic regression. But logistic regression assumes a simple, roughly linear relationship between covariates and treatment, and real assignment rules — a routing algorithm, a compliance filter, a human trader's discretion — are rarely that tidy. Swapping in a gradient-boosted tree or random forest to estimate the propensity score lets the model pick up thresholds, interactions, and non-linearities the linear model would miss entirely.
The catch is what flexible models do at the extremes. A model that can carve out sharp decision boundaries will happily assign some observations a propensity of 0.99 and others 0.01, because it can fit the training data that precisely — even where the true underlying probability is nowhere near that extreme. Propensity scores feed directly into inverse-propensity weights, for treated units, and a score of 0.01 produces a weight of 100. A handful of such observations can dominate an entire downstream average, blowing up the variance of any estimate built on top of them even though the point estimate might still be roughly unbiased.
Weight clipping (also called trimming) caps the weight at some threshold — say 20 — before it's used anywhere downstream. Any propensity score that would produce a larger weight gets pulled back to the cap. This deliberately introduces a small amount of bias (extreme observations are now down-weighted relative to their "true" influence) in exchange for a large reduction in variance, which is almost always the right trade when a handful of near-zero propensities would otherwise dominate every estimate.
Worked example
A trading desk models whether a parent order gets routed to a dark pool using a gradient-boosted tree over order size, spread, and time of day. For a typical mid-sized order the model outputs , giving a weight of — unremarkable. For one unusually small, illiquid order the tree has learned a sharp rule that almost always sends orders like it elsewhere, giving and a weight of . If ten such orders appear in a dataset of a few thousand, their weights alone can outweigh the rest of the sample combined in any weighted average. Clipping weights at, say, 20 caps that observation's influence at a fixed multiple of a typical order's, and the analyst reports the clipping threshold used so the bias/variance trade-off is transparent to anyone reading the result.
What this means in practice
Any pipeline that uses ML-estimated propensity scores — inverse-propensity weighting, doubly-robust estimators, off-policy evaluation of a trading policy — should report both the raw distribution of estimated propensities and the clipping threshold applied, since the choice of cap materially changes the answer. A common diagnostic is simply histogramming before doing anything else: if it's packed against 0 and 1, weighting-based methods are on shaky ground regardless of clipping, and doubly-robust or matching-based alternatives deserve a look instead.
Flexible ML models estimate propensity scores more accurately in the middle of the distribution but push more mass toward 0 and 1 than the truth warrants, and inverse-propensity weights are extremely sensitive to that — clipping the weights at a fixed cap trades a small, known bias for a large reduction in variance.
Clipping only the weight, without asking why an observation got a near-zero or near-one propensity in the first place, can paper over a positivity violation — a region of covariate space where one treatment arm essentially never occurs. In that case no amount of clipping fixes the underlying problem; it just hides it.
Related concepts
Practice in interviews
Further reading
- Lee, Lessler, Stuart, Weight Trimming and Propensity Score Weighting