Skip to content
AITroveRead. Build. Understand.
Make this comfortable

Project: audit an interrupted policy series

Last updated: 7 Oct 20265 min read
project
AdvancedBy AITrove Editorial

Build an interrupted-series review packet that separates a visible break from a defensible policy effect and records every timing, comparison and uncertainty decision.

State the decision and missing path

A support team wants to know whether its September routing rule reduced deadline breaches through the following February. The needed counterfactual is the breach-rate path the queue would have followed without the rule. Create a one-page design brief naming the queue, ticket eligibility, launch and training dates, monthly numerator and denominator, and a policy-relevant horizon. Do this before modeling. The clock and data contract is the first gate.

Build two aligned series

Retain the treated monthly outcomes and, if available, an unaffected comparison queue measured by the same rule and calendar. Record why the comparison shares demand shocks yet avoids the routing rule and overflow. If no valid comparison exists, label the design single-series and make the concurrent-event limitation prominent. Keep both raw and modeled paths for inspection. The controlled contrast must be defended, not merely calculated.

Estimate and interrogate

Fit the declared segmented specification, report level and slope changes and calculate the predicted gap at the decision horizon. Inspect pretrend fit, residual runs, seasonal coverage and serial dependence. Use an uncertainty method suitable for the observed dependence; the simple code below checks packet completeness but does not fit regression or produce a valid interval. Level and slope and residual diagnostics provide separate evidence.

Preserve all timing scenarios

Use operational records to define anticipation and transition months. Repeat the planned analysis for credible zero-, one- and two-month lags and retain the post-month count for each. Record every concurrent staffing, billing or product event that could explain the same break. A favorable alternate window is not a reason to discard the preregistered one. Lag sensitivity exposes the tradeoff between delay and follow-up.

Issue a bounded recommendation

The final packet should show observed rates and denominators, fitted counterfactuals, level and slope contrasts, uncertainty, diagnostic failures and plausible alternate explanations. If the measurement changed at launch, the comparison is contaminated or all post months fall in transition, stop at a descriptive trend statement. A clean packet is reviewable evidence, not proof that every other cause has been eliminated. The transfer review addresses a separate question: whether a local effect can inform other branches.

Implementation

python
def interrupted_series_packet_gate(packet):
    required = {"event_ledger", "monthly_numerators", "monthly_denominators",
                "frozen_windows", "level_estimate", "slope_estimate",
                "residual_review", "concurrent_event_log", "lag_scenarios"}
    missing = sorted(required - set(packet))
    if missing:
        raise ValueError("missing packet items: " + ", ".join(missing))
    months = set(packet["monthly_numerators"])
    if months != set(packet["monthly_denominators"]):
        raise ValueError("numerator and denominator months differ")
    if not packet["lag_scenarios"]:
        raise ValueError("no timing sensitivity")
    if not all(packet["monthly_denominators"][month] > 0
               for month in months):
        raise ValueError("nonpositive denominator")
    return {"packet_complete": True, "months": len(months),
            "comparison_available": bool(packet.get("comparison_ledger"))}

packet = {"event_ledger": {"training": 8, "launch": 9},
          "monthly_numerators": {month: 19 for month in range(1, 15)},
          "monthly_denominators": {month: 110 for month in range(1, 15)},
          "frozen_windows": {"pre": list(range(1, 8)),
                             "post": list(range(9, 15))},
          "level_estimate": -.04, "slope_estimate": -.003,
          "residual_review": "recorded", "concurrent_event_log": [],
          "lag_scenarios": [0, 1, 2], "comparison_ledger": ["South"]}
review = interrupted_series_packet_gate(packet)
assert review == {"packet_complete": True, "months": 14,
                  "comparison_available": True}

Performance and operating cost

The packet gate scans M monthly keys in O(M) expected time and O(M) space for the month set. Model fitting, comparison validation and dependence-aware inference have separate costs. Passing the gate confirms inspectable inputs, not a causal effect.

Common Mistakes

  • Do not call packet completeness statistical validity.
  • Do not omit concurrent-event notes because their list is inconvenient.
  • Do not publish a controlled estimate from an indirectly exposed comparison queue.

Read next

Continue the workflow: Project: audit a deadline-breach outcome label.

Continue the workflow: Project: review a refund-delay change with correlated daily outcomes.

ai-data
data-science
Storage details