Reliability methods and algorithms#
Use the PV evidence database for attributed historical benchmarks and your asset register/CMMS for device exposure and verified outcomes. Choose an estimator by the question and available data. Do not combine all published rates into one fleet average: event definitions, clocks and populations differ. The implementation uses NumPy/SciPy/Pandas with no additional dependency.
Implemented algorithm catalogue#
Algorithm / Python API |
Required data |
Result / PV application |
|---|---|---|
Poisson MLE + exact Garwood interval: |
Confirmed events and summed at-risk device exposure |
Annual or hourly event rate and uncertainty for inverters, CBX or sensors with a valid denominator. |
Zero-event bound: |
Exposure with no observed failures |
One-sided upper rate bound; zero events do not establish zero risk. |
Gamma–Poisson update: |
Comparable prior shape/rate and new event/exposure counts |
Posterior rate, credible interval and predictive event probability. Prior strength must be justified separately. |
Beta–binomial update: |
Failed and successful demands |
Failed-stow or failed-switching probability per demand, not per calendar hour. |
Kaplan–Meier + Greenwood log-log interval: |
First-failure or censor age for every device |
Empirical first-event survival without imposing a lifetime distribution. |
Right-censored Weibull MLE: |
Positive first-event/censor ages and failure flags |
Shape and scale; decreasing, constant or increasing model hazard. |
Conditional lifetime risk: |
A lifetime model, current age and forecast horizon |
Probability of first failure in the horizon given survival to the current age. |
Paired bootstrap: |
Individual first-event/censor histories |
Pointwise percentile uncertainty in the fitted Weibull survival curve. |
Aalen–Johansen: |
First-event ages with mutually exclusive cause codes |
Cause-specific cumulative incidence, accounting for competing first failures. |
Independent k-out-of-n dynamic program: |
Component survival probabilities at the same mission age |
Series, active-parallel and threshold redundancy scenarios. |
Two-state Markov: |
Calendar-up-time failure rate, mean restoration time, time intervals, counterfactual power |
Transient/interval/steady availability, repeated-event expectations and expected lost energy. |
Tracker and sensor observability: |
Complete interval schedule, angles/POA or readings/QC |
Time-weighted availability bounds, coverage and valid-data fraction. |
Component assembly: |
Disjoint part rates, multiplicities and operating exposure |
Expected component events in CBX or other assemblies. |
APIs are in energy_methods.failure_rates, energy_methods.pv_device_reliability
and energy_methods.reliability_algorithms. The
algorithm gallery
demonstrates the whole workflow with explicitly synthetic observations.
Rates and Bayesian updating#
For independent, homogeneous Poisson events with fixed exposure E, the maximum-likelihood rate is k/E. Include never-failed devices and exclude periods when a failed component is no longer at risk. With zero events, the one-sided 95% upper rate is -log(0.05)/E.
With a Gamma(shape=a, rate=b) prior, new data give Gamma(a+k, b+E).
Expected future events in exposure H are H(a+k)/(b+E), while the probability of
at least one is 1 - ((b+E)/(b+E+H))**(a+k). The two quantities differ.
A published point estimate alone does not identify prior strength. Never count
the same underlying field data once as prior evidence and again as new data.
Lifetime fitting, conditional risk and uncertainty#
The Weibull survival model is S(t)=exp(-(t/scale)**shape).
The censored log-likelihood sums event log densities and survivor log survival.
The fitter profiles out scale and optimizes log shape; it rejects unidentified
fits. Conditional first-failure risk is 1-S(age+horizon)/S(age).
Shape below/at/above one corresponds to decreasing/constant/increasing hazard;
it does not by itself identify a physical failure mechanism.
The bootstrap resamples complete (observed_age, failed) pairs, refits, evaluates
the curve and takes percentile bounds. Default 500 resamples and a fixed seed
make examples reproducible; increase resamples and check interval stability for
an actual decision. Percentile bounds are approximate and can have poor coverage
in small samples. They are pointwise, not simultaneous confidence bands, and do
not cover model misspecification. Any unidentified resample stops the calculation
instead of silently selecting only successful fits. Shared-site/weather cohorts
need cluster resampling, which is outside this implementation.
Extrapolating beyond maximum observed follow-up requires explicit opt-in. A plotted 30–50-year Weibull tail remains a model assumption until supported by long-term field data; the two published BFH summary survival points cannot replace individual lifetime observations for fitting.
Competing first-failure causes#
Use 0 for right censoring and positive integer codes for mutually exclusive
first-event causes. An unresolved cause must retain a positive “unknown cause”
code. At each observed event age, the algorithm adds S(previous)*d_cause/n_risk
to that cause’s cumulative incidence, then updates all-cause survival.
Survival plus all cause incidences sums to one. Events precede censoring at ties.
This implements the first-event special case of Aalen–Johansen, not a general
multi-state or recurrent-event model. It requires independent censoring but not
independent latent causes. No cause-specific confidence interval is claimed.
For an inverter, cooling, power-stage and control-board first failures may be
competing causes. Treating the other causes as simple censoring and reporting
1-KM would answer a different question from observed cause incidence.
Redundancy and repair-aware energy loss#
The k-out-of-n algorithm convolves Bernoulli working-state probabilities and sums the probability of at least k working units. k=n is series; k=1 is active parallel. Inputs must describe the same mission and independent components. One working inverter does not imply full plant output; threshold reliability does not calculate proportional generation. Shared wind sensors, supplies, networks, storm damage, load sharing and standby switching need explicit models.
The two-state Markov model uses up-to-down rate lambda and down-to-up rate
mu=1/mean restoration hours. It solves dA/dt=mu*(1-A)-lambda*A and integrates
availability exactly over each supplied interval. For initial availability A0:
A(t)=mu/(lambda+mu) + (A0-mu/(lambda+mu))*exp(-(lambda+mu)*t).
Expected lost energy is the sum of counterfactual interval power times expected down-hours. Counterfactual kW represents only affected capacity and is treated as constant within each interval. Expected repeat events are lambda times expected up-hours. Both transition rates use calendar hours in this API. An operating-hour source rate must not be inserted unchanged. The constant-rate, exponential-restoration, independent-power assumptions exclude ageing, weather-correlated failures, constrained shared repair crews and partial derating. Do not add parent and child outage energy for the same interruption.
Run the examples#
uv sync --locked --all-packages
uv run python examples/methods/plot_reliability_algorithms.py
uv run python -m energy_analysis.pv_device_reliability --output artifacts/pv-device-reliability
The study exports synthetic_repair_sensitivity.csv: an assumed 10 MW fleet,
0.04 events per unit calendar-up-year, a repeated artificial daylight power
profile, and 8/24/72/168-hour mean restoration scenarios. This demonstrates the
energy calculation and is labelled synthetic in the CSV and summary. No repair
time, financial price or production profile is asserted to come from a paper.
Algorithm sources and verification#
NIST series and active parallel reliability assumptions; extended here to threshold redundancy by Bernoulli convolution.
R survival: multi-state models and competing risks, first-event cumulative-incidence specialization of Aalen–Johansen.
SciPy paired percentile bootstrap, used to independently verify resampling and interval calculations.
NASA constant-rate availability, extended here to arbitrary initial availability and interval power integration.
Tests compare bootstrap bounds with SciPy, redundancy with exhaustive state enumeration, and repairable availability with independent numerical ODE integration. Hand-calculated cause risk sets verify ties and probability mass; the single-cause result reduces to Kaplan–Meier. Earlier methods retain their Poisson/Bayesian/censoring tests. No fitted predictor of field failures is claimed without a held-out fleet cohort and calibration assessment.