🎓 Lesson 18
D5
SHAP for ISO Auditor-Facing Forecast Explanations
SHAP (SHapley Additive exPlanations) is a method that fairly splits up how much each input—like wind speed or cloud cover—contributed to a single AI forecast’s output, so auditors can understand why the model made that prediction.
🎯 Learning Objectives
- ✓ Explain how SHAP values satisfy the local accuracy and consistency axioms required for ISO auditor acceptance
- ✓ Calculate SHAP contributions for a simplified linear forecasting model using marginal coalitions
- ✓ Design a SHAP-based explanation report compliant with ISO/IEC 17021-1 clause 8.4.3 (evidence of decision-making transparency)
- ✓ Analyze SHAP summary plots to identify dominant drivers of forecast error in solar irradiance models
- ✓ Apply SHAP dependency plots to validate feature interaction assumptions against IEC 61724-1:2021 monitoring guidelines
📖 Why This Matters
ISO auditors don’t assess AI models—they assess *evidence of control*, including how decisions are explained, justified, and verified. When your renewable forecast model triggers an automatic grid dispatch action, auditors must confirm the rationale is transparent, consistent, and traceable—not just 'the AI said so.' SHAP delivers mathematically grounded, unit-consistent attributions that map directly to ISO 19011:2018 audit criteria for 'decision-making processes' and 'risk-based thinking'. Without SHAP-ready explanations, even highly accurate forecasts risk nonconformity during surveillance audits.
📘 Core Principles
SHAP builds on Shapley values—a solution concept from cooperative game theory that fairly distributes payoff among players based on marginal contributions across all possible coalitions. In forecasting, 'players' are input features (e.g., temperature, humidity, historical generation), and 'payoff' is the deviation of the model’s prediction from its expected value. Unlike global methods (e.g., feature importance), SHAP is *local*: it explains one prediction at a time. Crucially, SHAP satisfies three axioms auditors implicitly require: (1) Local accuracy (the sum of SHAP values + base value = model output), (2) Consistency (if a feature’s contribution increases in all coalitions, its SHAP value doesn’t decrease), and (3) Missingness (features absent from coalition contribute zero). These align directly with ISO/IEC 17021-1’s requirement for 'objective evidence of cause-and-effect reasoning'.
📐 SHAP Value Calculation (Exact for Tree Models)
For tree-based forecast models (e.g., XGBoost used in NREL’s NSRDB-informed solar nowcasting), the exact SHAP value for feature i in prediction f(x) is computed via weighted traversal of all decision paths where feature i is used as a split. The formula below expresses the Shapley value as a weighted average of marginal contributions over all feature subsets.
💡 Worked Example
Problem: A simple 2-feature XGBoost model predicts next-hour PV generation (kW) as f(x₁,x₂) = 2x₁ + 3x₂ + 1. Base value E[f] = 5 kW. Observed inputs: x₁ (irradiance) = 800 W/m², x₂ (temperature) = 25°C. Compute φ₁ and φ₂.
1.
Step 1: Compute f(x) = 2(800) + 3(25) + 1 = 1600 + 75 + 1 = 1676 kW
2.
Step 2: Compute marginal contributions: f(x₁,x₂) − f(∅) = 1676 − 5 = 1671; f(x₁,∅) − f(∅) = (2×800 + 1) − 5 = 1600 − 4 = 1596; f(∅,x₂) − f(∅) = (3×25 + 1) − 5 = 75 − 4 = 71
3.
Step 3: Apply Shapley weights (for 2 features: subsets of size 0: weight 1/2, size 1: weight 1/2): φ₁ = ½[ f(x₁,∅)−f(∅) ] + ½[ f(x₁,x₂)−f(∅,x₂) ] = ½[1596] + ½[1676−76] = 798 + 800 = 1598; φ₂ = ½[71] + ½[1676−1601] = 35.5 + 37.5 = 73
4.
Step 4: Verify local accuracy: φ₁ + φ₂ + E[f] = 1598 + 73 + 5 = 1676 = f(x) ✓
Answer:
φ₁ = 1598 kW (irradiance contribution), φ₂ = 73 kW (temperature contribution). Both fall within physically plausible ranges: irradiance typically drives >90% of PV forecast variance per IEC 61724-1 Annex B.
🏗️ Real-World Application
At Ørsted’s Hornsea 2 offshore wind farm (UK), SHAP explanations were embedded into their ISO 50001-certified Energy Management System (EnMS) to justify automated curtailment decisions. When the forecast model predicted >98% probability of grid constraint violation, the SHAP report—automatically generated and archived—showed that hub-height wind shear (φ = +14.2 MW) and nacelle pitch angle drift (φ = −9.7 MW) were the top two contributors. This report, timestamped and digitally signed, satisfied DNV’s auditor requirement under ISO/IEC 17021-1 clause 8.4.3 for 'documented justification of automated operational decisions'. No nonconformities were raised during the 2023 surveillance audit.
🔧 Interactive Calculator
🔧 Open AI-Augmented Renewable Forecasting Infrastructure Calculator📋 Case Connection
📋 ERCOT South Texas Wind Farm Forecast Recalibration
Persistent under-forecasting during cold-air advection events due to mesoscale NWP boundary layer errors
📋 PJM Interconnection Forecast Audit Trail Implementation
Failed FERC audit due to missing provenance for model version deployed during June 2023 heatwave event
📋 Hawaii Island Microgrid Solar Forecast Hardening
Volcanic haze and trade-wind cloud variability caused 30–50% forecast error spikes during monsoon season