energy_methods.reliability_algorithms#
Competing risks, lifetime uncertainty, redundancy and repairable availability.
These algorithms complement failure_rates and pv_device_reliability.
Inputs must be homogeneous, correctly censored observations or explicit scenario
assumptions. An anomaly score is not a failure count or calibrated probability.
- energy_methods.reliability_algorithms.aalen_johansen(times, event_type)[source]#
First-event cumulative incidence with mutually exclusive verified causes.
One row per device from commissioning: 0=censored, positive integer=cause. At each age,
F_j += S(previous)*d_j/n, thenS *= (1-sum(d_j)/n). Tied events across devices precede censoring; no artificial jitter is used. Independent censoring is assumed, but independent latent failure causes are not required. No delayed entry, recurrent faults or interval censoring. Unknown causes must have their own positive code, not be treated as censored. Outputs point estimates, not confidence intervals or causal effects.- Parameters:
times (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
event_type (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
- Return type:
DataFrame
- energy_methods.reliability_algorithms.bootstrap_weibull_survival(times, failed, evaluation_times, *, resamples=500, confidence=0.95, seed=0, allow_extrapolation=False)[source]#
Paired device bootstrap and percentile pointwise Weibull survival bounds.
Resample (age, event) rows together and refit the right-censored MLE. This assumes iid devices and independent censoring; shared site/weather cohorts require a cluster bootstrap instead. It does not quantify model error. Raises if ANY resample is unidentified: silently dropping failed fits can bias intervals. Sparse cohorts should use KM/rate bounds instead. Tail extrapolation beyond observed follow-up requires explicit opt-in and remains an unvalidated model projection. Intervals are not simultaneous.
- Parameters:
times (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
failed (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
evaluation_times (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
resamples (int)
confidence (float)
seed (int)
allow_extrapolation (bool)
- Return type:
DataFrame
- energy_methods.reliability_algorithms.k_out_of_n_reliability(component_reliability, required)[source]#
Poisson-binomial dynamic program for independent active components.
At one common mission age, the system works if >= required components work. required=n gives series; required=1 gives active parallel redundancy. Probabilities must have matching horizons/definitions. Reusing this for steady availability requires independent component states. No standby, load sharing, common-cause events or proportional-capacity interpretation. Compose disjoint blocks only; shared components must not appear twice.
- Parameters:
component_reliability (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
required (int)
- Return type:
float
- energy_methods.reliability_algorithms.repairable_availability(failure_rate_per_hour, mean_restore_hours, interval_hours, expected_power_kw, *, initial_availability=1.0)[source]#
Exact two-state Markov interval availability and expected energy at risk.
Constant up->down rate lambda and down->up rate mu=1/mean_restore_hours. Both use the SAME clock: this function uses calendar hours while the unit is in each state. Do not pass a daylight operating-hour rate unchanged. Restoration duration is exponential; include logistics in its mean only if this memoryless approximation is defensible. Initial state is explicit. Expected power is the nonnegative, piecewise-constant counterfactual output of the affected capacity when available, in kW. Down means zero output; partial derating and overlapping parent/child losses need another model. Assumes the counterfactual profile is independent of failures/restoration; weather-correlated damage, shared repair crews and ageing are excluded. Returns expectations, not confidence intervals or a stochastic trajectory.
- Parameters:
failure_rate_per_hour (float)
mean_restore_hours (float)
interval_hours (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
expected_power_kw (Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str])
initial_availability (float)
- Return type:
DataFrame