An Integrated Framework for PV Power Prediction and Explainability Analysis

Read full text
Authors: Yifan Huang
Cited by: 0

Abstract

The proposed framework consists of four tightly coupled components: (1) identification of PV generation impact factors; (2) a HMM to identify latent operational regimes corresponding to daytime and nighttime PV generation; (3) a hybrid LSTM–Transformer architecture, whose hyperparameters are optimized via particle swarm optimization (PSO), to capture complex temporal dependencies under daytime conditions; and (4) an explainability module combining SHAP analysis and time-lag correlation analysis to quantify feature contributions and temporal response characteristic. A. Identification of PV generation impact factors Meteorological variables relevant to PV power generation are first collected and preprocessed, which are obtained from the ERA5 reanalysis dataset of the European Centre for Medium-Range Weather Forecasts (ECMWF) and downscaled to 15-min resolution to match the PV power observations using physically consistent interpolation schemes. Moreover, solar geometry variables are computed to represent deterministic astronomical drivers of irradiance. The solar zenith angle, solar azimuth angle, and solar elevation angle are calculated based on geographic coordinates and timestamps using standard astronomical equations, which capture diurnal and seasonal variation. To identify the dominant impact factors, correlation analyses are employed to quantify the linear and monotonic associations between each candidate feature and PV output. Variables that exhibit consistently strong correlations across both metrics are retained as the final input to reduce feature redundancy and suppress noisy predictors. All selected variables are subsequently standardized using z-score normalization to eliminate scale disparities among heterogeneous predictors and to improve the stability of the deep learning training process. B. HMM-Based LSTM–Transformer Model To address the regime-dependent chacharacteristics of PV power generation, a Hidden Markov Model–based LSTM–Transformer framework (HLT) is developed. The HMM is employed to identify latent operational regimes corresponding to daytime and nighttime conditions. Based on the inferred regimes, the original time series is partitioned into daytime and nighttime samples. For the daytime regime, a hybrid LSTM–Transformer model is constructed to predict PV power. LSTM layers are used to extract short- and medium-term temporal dependencies from inputs, while a Transformer encoder is adopted to capture long-range dependencies through multi-head attention mechanisms. Residual connections and layer normalization are incorporated to improve training stability and convergence. Considering the distinct physical characteristics of nighttime PV output, nighttime PV power is estimated using a persistence-based strategy, in which the predicted output is set equal to the last observed PV value in the input sequence, thereby avoiding unnecessary model fitting under low-irradiance conditions. To further enhance model robustness and generalization, Particle Swarm Optimization (PSO) is applied to automatically optimize key hyperparameters of the LSTM–Transformer model, including the batch size, epochs, feed-forward network dimension, and embedding dimension.Model performance is evaluated using Mean Absolute Error (MAE) and Mean Relative Error (MRE). C. Interpretability and Statistical Analysis To interpret the internal behavior of the HLT model and to examine the role of input variables in PV power generation, two complementary analytical methods are adopted: Shapley Additive Explanations (SHAP) and time-lag correlation analysis. SHAP analysis is employed to quantify the contribution of each input variable to PV power predictions. SHAP values are computed based on Shapley theory and provide consistent measures of feature influence, including global importance, dependence patterns, and interaction effects. The time-lag correlation analysis evaluates the temporal relationship between input features and PV power output by correlation coefficients across varying lag intervals from 0 to 60 minutes at 15-minute increments. This method identifies the optimal time shift at which each input variable exhibits maximum correlation with PV generation, distinguishing between instantaneous and delayed causal effects

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
2 January 2026
Document type
Dataset