Restricted mean unresolved time is the area under the unresolved-case curve from case creation to a specified horizon; it remains meaningful when the far tail is unobserved.
Restricted mean unresolved time at a business horizon
Set a decision horizon
A support lead may care about case-days spent open during the first six days, not the eventual mean resolution time. Define a horizon τ=6 days before looking at outcomes. The restricted mean is the integral of S(t) from zero to τ, where S(t) is the unresolved-case survival curve. This makes the unit case-days per initially observed case. It is a bounded summary; it does not fill in the unobserved tail after day six. The curve lesson defines S(t).
Integrate the steps exactly
Using the eight-case curve, S is one from day zero to two, 0.875 from two to three, 0.75 from three to five, and 0.60 from five to six. The areas are 2, 0.875, 1.5 and 0.6 case-days. Their sum is 4.975 unresolved case-days through day six. A raw average over only resolved cases would discard open cases and likely understate open time. A raw average of observed durations mixes resolved and censored durations without accounting for their different meanings.
Compare groups on common ground
Two queues need the same time origin, event definition, extraction rule and τ. A queue with newer cases might have little mature follow-up at day six; plotting a day-six estimate from only a few at-risk cases is possible but fragile. Publish the risk set at τ and a defensible uncertainty interval before treating a difference as operational. Cohort entry guards against comparing cases with unequal opportunity to age.
Choose a horizon supported by data
If the final observed follow-up is before τ or the risk set has vanished through censoring without observing a terminal event, do not extrapolate a flat line as though the remaining area were known. Shorten τ, extend follow-up, or state that the comparison is not estimable from this extract. A horizon can reflect a service target, but it must also have observable support in each group. Report the preselected horizon even if a different one looks more favorable.
Distinguish resolution and all-exit time
With cancellations, the area under the all-terminal-event-free curve describes time until either resolution or cancellation. The area under a resolution-only Kaplan–Meier curve that censors cancellations answers a different question and depends on stronger assumptions. Decide which open-time quantity belongs in the operating metric. Competing outcomes should be displayed beside the bounded time summary so a faster exit cannot hide a rise in cancellations.
Implementation
def restricted_open_days(curve, horizon_days):
if horizon_days <= 0:
raise ValueError("horizon must be positive")
previous_day = 0
unresolved_share = 1.0
open_days = 0.0
for event_day, share_after_event in curve:
if event_day < previous_day or not 0 <= share_after_event <= unresolved_share:
raise ValueError("invalid curve")
if event_day >= horizon_days:
return open_days + (horizon_days - previous_day) * unresolved_share
open_days += (event_day - previous_day) * unresolved_share
previous_day = event_day
unresolved_share = share_after_event
if previous_day < horizon_days:
raise ValueError("horizon exceeds observed event support")
return open_days
steps = [(2, 0.875), (3, 0.75), (5, 0.60), (8, 0.40), (10, 0.20)]
assert abs(restricted_open_days(steps, 6) - 4.975) < 1e-12Performance and operating cost
Integrating a sorted U-step curve costs O(U) time and O(1) additional space. Bootstrapping an interval requires repeated cohort-level resampling and should preserve the case as the sampling unit. The horizon-support check is more consequential than micro-optimizing the scan.
Common Mistakes
- Do not call a six-day restricted mean the eventual mean resolution time.
- Do not compare groups at different horizons or time origins.
- Do not extend the final observed step beyond supported follow-up without an explicit model.
Read next
- Event-time risk sets and tied outcomes
- Kaplan–Meier curves for support resolution
- Competing risks and resolution incidence
- Project: audit support resolution time and competing exits
Continue the workflow: Compare queues by restricted mean open time.
Continue the workflow: Calibrate resolution predictions at a fixed horizon.
