Slippage Modeling Under Censoring & Endogeneity
A Practical Playbook for Fill-Conditional Bias, Counterfactual Evaluation, and Safe Deployment
Why this note: Most live slippage models are biased because they are trained on what got filled, not on what was attempted. In stressed tapes, this bias grows exactly when you need accurate cost forecasts most.
1) The Core Failure Mode
In production execution, labels are MNAR-like (missing-not-at-random in practice):
- Passive child orders that do not fill are often canceled/repriced and disappear from “executed-slippage” datasets.
- Aggressive children fill quickly and dominate observed cost labels.
- Routing/tactic choice is policy-driven, so actions are endogenous to expected conditions.
Result: naive models understate true implementation shortfall (IS) and overfit to easy-fill regimes.
2) Decompose the Objective Correctly
For a parent order over horizon (H):
[ \text{IS}{\text{total}} = w{\text{fill}},\text{IS}{\text{exec}} + (1-w{\text{fill}}),\text{OC}_{\text{unfilled}} + \text{fees/rebates} ]
Where:
- (w_{\text{fill}}): fill ratio by deadline.
- (\text{IS}_{\text{exec}}): realized execution shortfall on filled quantity.
- (\text{OC}_{\text{unfilled}}): opportunity cost of residual not executed by deadline.
If you only model (\text{IS}_{\text{exec}}) on filled children, you are optimizing the wrong objective.
3) Data Schema You Actually Need
At child-order granularity, keep both attempts and outcomes:
- Decision context: side, urgency, alpha signal, volatility regime, spread, queue depth, microprice tilt, venue state.
- Action: order type, limit offset, participation cap, venue, size slice.
- Exposure path: queue position proxy, quote age, cancellation intensity, local event-time clock.
- Outcome:
filled_qty,time_to_fill,cancel_reason,expiry,markout_1s/5s/30s,deadline_residual. - Policy propensities/logging: probability or score used by router/tactic chooser (critical for OPE).
No propensities/logging → no reliable counterfactual evaluation.
4) Modeling Stack (Production-Ready)
Layer A — Fill/Censoring Model (Competing Risks)
Model hazard for {fill, cancel, timeout} in event-time buckets.
- Baseline: discrete-time survival (logit hazard).
- Better: cause-specific hazards with shared embeddings for microstructure state.
- Output: (\hat p_{\text{fill}}(t|x,a)), (\hat p_{\text{cancel}}(t|x,a)), (\hat p_{\text{timeout}}(t|x,a)).
Layer B — Conditional Cost Models
- (\hat c_{\text{exec}}(x,a) = E[\text{IS}_{\text{exec}} \mid \text{fill}, x,a])
- (\hat c_{\text{opp}}(x,a) = E[\text{OC}_{\text{unfilled}} \mid \text{not filled by }H, x,a])
Use robust loss (Huber/quantile) for heavy tails.
Layer C — Policy Value / Counterfactual Estimator
Use doubly robust (DR) evaluation:
[ \hat V_{DR} = \frac{1}{n}\sum_i \left[ \hat q(x_i,\pi(x_i)) + \frac{\mathbb{1}[a_i=\pi(x_i)]}{\hat e(a_i|x_i)}\left(y_i-\hat q(x_i,a_i)\right) \right] ]
Where (\hat e(a|x)) is behavior propensity (from router logs or calibrated surrogate).
This reduces bias if either outcome model or propensity model is approximately right.
5) Practical Bias Controls
Inverse-Probability-of-Censoring Weights (IPCW): weight filled outcomes by inverse estimated non-censoring probability.
Deadline-anchored labels: Evaluate all parents at fixed horizon (H) so cancel/retry loops are not silently ignored.
Markout-conditioned attribution: Separate spread capture vs adverse selection vs delay/opportunity components.
Regime stratification: Train/evaluate by volatility, spread state, and participation bucket to avoid Simpson-style masking.
Tail-aware metrics: Track p95/p99 IS error and CVaR error, not only RMSE/MAE.
6) Suggested KPI Set (for live monitoring)
- Fill calibration: Brier + reliability slope by horizon bucket.
- IS calibration: mean error + p90/p99 absolute error by regime.
- Opportunity-cost calibration: residual-vs-forecast deciles.
- Policy regret proxy: realized IS − DR-estimated IS under incumbent policy.
- Selection-drift alarm: PSI/KL drift on filled-vs-attempted population.
A red flag: stable executed-IS metrics with worsening fill ratio and residual opportunity cost.
7) Deployment Pattern (Safe)
- Shadow mode (2–4 weeks): run model side-by-side; no routing authority.
- Budget-constrained activation: only on symbols/regimes where calibration is within guardrail.
- Regret circuit breaker: if rolling regret > threshold, auto-fallback to conservative baseline tactics.
- Champion/challenger with DR gate: promote only if both realized and DR-counterfactual metrics improve.
8) Minimal Implementation Blueprint
Step 1: Build attempted-order dataset (not execution-only).
Step 2: Train competing-risks fill/cancel/timeout model.
Step 3: Train conditional cost models for fill and unfilled residuals.
Step 4: Assemble horizon-level expected cost:
E[cost|x,a] = p_fill*E[IS_exec|fill] + (1-p_fill)*E[OC_unfilled|no fill] + fees
Step 5: Run off-policy DR evaluation for candidate tactic policy.
Step 6: Ship with guardrails (regime allowlist + regret breaker + rollback).
9) Common Mistakes
- Treating canceled passive orders as “no label” instead of censored observations.
- Backtesting only child-level fills and claiming parent-level improvement.
- Ignoring behavior propensities, then over-trusting counterfactual uplift.
- Optimizing average IS while tail risk and miss-rate explode.
- Mixing regimes (open/close/event windows) into one global calibration curve.
10) References (starting set)
- Perold, A. (1988), The Implementation Shortfall.
- Almgren, R. & Chriss, N. (2001), Optimal Execution of Portfolio Transactions.
- Huang, Lehalle, Rosenbaum et al. (2013/2014), Queue-Reactive Model (arXiv:1312.0563).
- Said et al. (2022), Market Impact: Empirical Evidence, Theory and Practice (arXiv:2205.07385).
- Szymanski et al. (2023), Two Square Root Laws of Market Impact (arXiv:2311.18283).
- Dudík et al. (2011), Doubly Robust Policy Evaluation and Learning (arXiv:1103.4601).
- Heckman, J. (1979), Sample Selection Bias as a Specification Error.
TL;DR
If your slippage model is trained on fills only, it is almost certainly optimistic in live trading. Model fill/censoring explicitly, include opportunity cost of residuals, and gate policy changes with doubly robust counterfactual checks plus live regret guardrails.