A policy may be announced, trained, launched and adopted at different times; a lag sensitivity audit shows how the estimated post-policy gap changes under declared exposure windows.
Transition windows and lag sensitivity for policy series
Map the actual adoption process
A routing rule is announced in July, taught in August and enabled in September. Staff may alter triage before the switch, and the queue may need two months to reach steady use. A model with a clean September step can be misleading. Define a clearly untreated window, one or more transition months, and a stable post-policy window from operational logs. The clock lesson fixes these dates.
Ask whether effect timing is plausible
An immediate level change implies an abrupt impact at the first treated observation. A gradual rollout may appear as a slope change or delayed level shift. If the outcome is measured at ticket closure, tickets opened before launch may close afterward and blur the boundary. The lag should follow the workflow and measurement delay, not just the month that produces the largest estimated benefit.
Freeze a small set of alternatives
The fixture compares lags of zero, one and two months after the launch, treating the intervening months as transition rather than baseline. For each lag it averages the observed minus predicted untreated rate over the remaining stable post months. The resulting means can differ because the included months differ. They are descriptive sensitivity results; a full study should refit its declared model for each alternative and show uncertainty and fit.
Preserve the denominator of every scenario
A two-month lag leaves fewer stable post months than a zero-month lag. Report that count alongside the mean gap. Do not compare a six-month estimate and a one-month estimate as though equally informed. If all post months are labeled transition, the effect is not estimable in the available follow-up. Segmented estimates also need enough points on each side to estimate a slope.
Interpret disagreement rather than hiding it
If the sign reverses between plausible lag choices, investigate rollout logs, closure delay and unrelated events. If the gap begins before training, anticipation or pre-existing trend is possible. Stable signs over a few handpicked windows still do not establish causality; the same shared shock can affect every window. The review packet should retain each declared scenario and its exclusion rules.
Implementation
def post_gap_by_lag(observed_rate, untreated_prediction,
launch_month, candidate_lags):
if set(observed_rate) != set(untreated_prediction):
raise ValueError("observed and predicted months differ")
results = {}
for lag in candidate_lags:
if lag < 0:
raise ValueError("negative lag")
stable_months = sorted(month for month in observed_rate
if month >= launch_month + lag)
if not stable_months:
raise ValueError("no stable post-policy months")
gaps = [observed_rate[month] - untreated_prediction[month]
for month in stable_months]
results[lag] = {"months": len(gaps),
"mean_gap": sum(gaps) / len(gaps)}
return results
observed = {9: .19, 10: .17, 11: .14, 12: .13, 13: .12}
prediction = {month: .20 for month in observed}
lag_audit = post_gap_by_lag(observed, prediction, 9, (0, 1, 2))
assert [lag_audit[lag]["months"] for lag in (0, 1, 2)] == [5, 4, 3]
assert lag_audit[2]["mean_gap"] < lag_audit[0]["mean_gap"]Performance and operating cost
For L lag scenarios and T available months, the direct scan costs O(L × T) time and O(T + L) transient/output space. Re-fitting a model for every lag costs more; the analytic limitation is shrinking post-period support.
Common Mistakes
- Do not choose a lag solely because it maximizes the policy gap.
- Do not count training months as clean baseline without an exposure argument.
- Do not report a delayed estimate without its remaining post-month count.
