energy_analysis.pv_failure_prediction#
Database -> fleet audit -> temporal validation -> failure-event forecasts.
The demonstration uses a real published benchmark and explicitly synthetic fleet observations. Counts concern repeat functional-failure events per at-risk operating hour, not replacement dates or a calibrated OEM health score.
- energy_analysis.pv_failure_prediction.select_benchmark(record_id='baschel_2018:t1-29')[source]#
Choose one unflagged operating-hour rate with attribution; never pool alternatives.
- Parameters:
record_id (str)
- Return type:
dict[str, Any]
- energy_analysis.pv_failure_prediction.benchmark_prior(benchmark, strength=2.0)[source]#
Match the published mean; strength is an assumed pseudo-event count.
A point estimate cannot identify prior uncertainty. Effective prior exposure strength/rate is a modelling assumption, not the paper’s sample exposure.
- Parameters:
benchmark (dict[str, Any])
strength (float)
- Return type:
- energy_analysis.pv_failure_prediction.make_demo_inputs(*, seed=42, devices=200)[source]#
Synthetic 2023-2025 fixed cohort with a known illustrative generating rate.
Rate = 26 events/million at-risk operating hours. Counts are conditional on supplied exposure; timestamps only locate events within each month. This is not a physical uptime/repair simulation. Include all never-failed devices.
- Parameters:
seed (int)
devices (int)
- Return type:
dict[str, DataFrame]
- energy_analysis.pv_failure_prediction.prepare_fleet(inputs, *, device_class)[source]#
Audit a complete fixed-cohort panel and attach verified, deduplicated events.
Exposure windows must be contiguous, nonoverlapping and present for every registered asset. Known zero exposure is allowed; missing rows are rejected. Intervals are [start,end), timestamps UTC. Match the event-observation scope to measured at-risk operating hours, excluding downtime/unobserved time. Timestamp checks cannot prove complete reporting. Staggered commissioning needs explicit known-zero rows or separate cohorts, never guessed exposure.
- Parameters:
inputs (dict[str, DataFrame])
device_class (str)
- Return type:
tuple[DataFrame, DataFrame, dict[str, int]]
- energy_analysis.pv_failure_prediction.split_history(panel, train_end)[source]#
Freeze at an exposure boundary, without prorating counts or future leakage.
- Parameters:
panel (DataFrame)
train_end (str)
- Return type:
tuple[DataFrame, DataFrame]
- energy_analysis.pv_failure_prediction.update_from_panel(prior, panel)[source]#
Update using summed exposure including every zero-event device-period.
- energy_analysis.pv_failure_prediction.forecast_table(model, plan)[source]#
Per-device expected repeat events and probability of at least one event.
- Parameters:
model (GammaRate)
plan (DataFrame)
- Return type:
DataFrame
- energy_analysis.pv_failure_prediction.backtest(prior, fitted, holdout)[source]#
Frozen-origin conditional-event evaluation, using realized holdout exposure.
This does not validate future exposure forecasts. Periods share uncertainty in their common rate, so marginal interval coverage is descriptive only. Neither fitted model is updated with holdout events during evaluation.
- energy_analysis.pv_failure_prediction.run_prediction(inputs, *, train_end='2025-01-01', benchmark_id='baschel_2018:t1-29', prior_strength=2.0, input_origin='user_provided_unverified')[source]#
Run the auditable workflow; refit only after completing holdout scoring.
- Parameters:
inputs (dict[str, DataFrame])
train_end (str)
benchmark_id (str)
prior_strength (float)
input_origin (str)
- Return type:
dict[str, Any]
- energy_analysis.pv_failure_prediction.plot_prediction(study)[source]#
Plot rate learning, frozen holdout, future counts and prior sensitivity.
- Parameters:
study (dict[str, Any])
- Return type:
Figure