CausalSolar

Causal effect of advanced weather on solar forecast error

Methods

Documentation

Methods & interpretation

Formal setup, estimators, robustness checks, and how to read the live results.

1. Research question

What is the causal effect of incorporating advanced weather information into renewable energy forecasting, and does this effect vary across weather regimes?

Richer NWP inputs often improve predictive accuracy. The decision question is causal: does advanced weather information cause lower forecast error, and for which regimes is the product worth buying?

2. Causal design

Let indicate access to advanced weather features, the absolute percentage forecast error, and confounders (lags, calendar, regime, site). Potential outcomes are and .

Negative values mean advanced weather reduces error. Because operational A/B assignment of weather products is rare, we use a semi-synthetic design with known so estimators can be scored against ground truth.

Directed acyclic graph: regime, history, and site confound T and Y; T affects forecast error.
Treatment T
T=1: GHI, DNI, cloud, clear-sky index. T=0: basic meteorology + calendar + lags.
Outcome Y
Hourly absolute percentage forecast error.
Covariates X
Historical production, calendar, weather regime, site indicators.
Ground truth
τ* = Y(1) − Y(0) from paired basic vs advanced forecasts.

3. Pipeline

End-to-end flow from weather/PV data to interactive dashboard.
  1. Fetch multi-site hourly weather; synthesize PV with pvlib (Seville, Munich, Phoenix).
  2. Train RF, LightGBM, XGBoost, LSTM on basic and advanced feature sets.
  3. Construct causal table: .
  4. Estimate ATE / HTE; run overlap, bootstrap, placebo, sensitivity, temporal PEHE.
  5. Serve artifacts; Playground re-samples T under adjustable confounding.

4. Estimators

Inverse-propensity weighting uses propensity :

Doubly robust combines outcome regression with IPW residuals. Meta-learners (S/T/X) and Causal Forests target for regime-level HTE.

FamilyMethodsTarget
ClassicalRegression, IPW, doubly robust
Meta-learnersS-, T-, X-learner
Causal MLCausal ForestHTE by regime

ATE recovery vs ground truth

Best in this run: doubly robust (bias 0.084 pp). Green reference ≈ -10.26%.

Figure: estimated ATE by method (published study run).

5. Validation

Precision in estimation of heterogeneous effects (PEHE) on known :

  • Overlap — propensity histograms; watch mass near 0/1.
  • Bootstrap CIs — resampling intervals for DR / T-learner.
  • Placebo — shuffle ; estimate → 0.
  • Sensitivity — γ-tilt on propensity weights.
  • Temporal PEHE — time-split holdout vs .

6. Interpreted findings

True ATE ≈ -10.26% — advanced weather cuts absolute % error by ~10.3 pp on average.

Heterogeneity dominates: clear ≈ -2.8%, extreme ≈ -20.9%. Policy: target hard regimes rather than buying high-res weather uniformly.

Heterogeneous effects by weather regime

Causal Forest vs ground-truth τ*

Figure: treatment effect τ by regime (negative = helps).

7. Limitations

  • Semi-synthetic is not an operational NWP A/B trial.
  • Spatial resolution and forecast latency are abstracted.
  • Future: plant SCADA + commercial forecast products; policy learning for when to purchase high-resolution weather.

8. API & reproducibility

EndpointPurpose
GET /results/*ATE, HTE, forecasts, robustness
POST /experimentPlayground under confounding / seed
POST /whatifScenario τ under weather inputs
POST /trainFull GPU pipeline (local only)

Open-source repository: github.com/AvoCahDoe/causal-solar-energy. Author: Farid Elboubkraoui.