Slippage Modeling Under Censoring & Endogeneity

2026-03-27 · finance

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):

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:

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:

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.

Layer B — Conditional Cost Models

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

  1. Inverse-Probability-of-Censoring Weights (IPCW): weight filled outcomes by inverse estimated non-censoring probability.

  2. Deadline-anchored labels: Evaluate all parents at fixed horizon (H) so cancel/retry loops are not silently ignored.

  3. Markout-conditioned attribution: Separate spread capture vs adverse selection vs delay/opportunity components.

  4. Regime stratification: Train/evaluate by volatility, spread state, and participation bucket to avoid Simpson-style masking.

  5. Tail-aware metrics: Track p95/p99 IS error and CVaR error, not only RMSE/MAE.


6) Suggested KPI Set (for live monitoring)

A red flag: stable executed-IS metrics with worsening fill ratio and residual opportunity cost.


7) Deployment Pattern (Safe)

  1. Shadow mode (2–4 weeks): run model side-by-side; no routing authority.
  2. Budget-constrained activation: only on symbols/regimes where calibration is within guardrail.
  3. Regret circuit breaker: if rolling regret > threshold, auto-fallback to conservative baseline tactics.
  4. 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


10) References (starting set)


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.