outage_survival¶
outage_survival
¶
Empirical survival function of outage durations: the time-to-recovery view.
From the stockout_episodes event table, the empirical survival
:math:S(t) = \Pr(\text{duration} > t) of outage durations, optionally grouped, with the
median and P90 time-to-recovery. Strictly empirical (Kaplan-Meier reduces to the ECDF without
censoring). Episodes still open at the observation window's edge are right-censored in the data;
they are not imputed, so read the longest durations as lower bounds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
episodes
|
DataFrame
|
Output of |
required |
by
|
str
|
A grouping column (e.g. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
|
References
Kaplan and Meier (1958), used here as a descriptive empirical survival estimator.
See Also
station_outage_rates : How often outages occur.
stockout_episodes : The episode table this consumes.
Examples:
>>> import pandas as pd
>>> episodes = pd.DataFrame({"duration_minutes": [10, 20, 20, 60]})
>>> float(outage_survival(episodes)["median_recovery"].iloc[0])
20.0