1. Introduction
Forecasting photovoltaic (PV) power generation is a vital element in the planning and operation of an electric power grid. Renewable energy resources are rapidly integrated into smart grids [
1,
2,
3]. The variability and uncertainty of PV power output and availability must be considered in the complex decision-making processes required to balance supply and demand for the power system. A solar generator at the ground level is affected by cloud cover, atmospheric aerosol levels, and other atmospheric parameters, so solar power is intermittent and variable [
4]. Meteorological features, such as solar irradiance, air temperature, relative humidity, and wind speed, directly or indirectly affect the power generated by a PV [
5]. The intermittent nature of power generation from solar PV systems means that maximizing power output and connecting to the utility grid is difficult. Forecasting is critical to the efficient use of solar power for grid operations.
PV power forecasting involves very short-term, short-term, medium-term, or long-term forecasting horizons. Very short-term forecasting has prediction periods from 1 min to several hours and is useful for the electricity market, power smoothing, and real-time electricity dispatch. Short-term forecasting is widely used in the electricity market to ensure economic load dispatch, and the time horizons range from one day to a week. Medium-term forecasting ranges from one week to a month and is used for maintenance planning. Long-term forecasting forecasts for a month to a year ahead and is used to determine plans for long-term power generation, transmission, distribution, and solar energy rationing [
6].
A previous study [
7] used a univariate data-driven approach to increase the accuracy of very short-term solar power forecasting. The forecasting horizon is 15 min ahead, and the real solar power dataset is the only input for the model. The performance indices are MAE, mean relative error (MRE), and RMSE. Another study [
8] performed medium- and long-term PV power forecasting using LSTM. The MAE and RMSE are used as evaluation metrics.
Current methods to forecast PV power generation are categorized as physical, statistical, or machine-learning, as well as hybrid methods that integrate two or more methods [
9,
10]. A physical approach generates PV forecasts using solar and PV models and a statistical approach uses past data to train models. A physical model uses satellite images and numerical weather predictions (NWP) to predict PV power generation [
11,
12].
A previous study [
13] used a statistical approach to forecast photovoltaic power generation using autoregressive moving average (ARMA) models. These models are simple and give good forecasting results for one-step-ahead predictions using a resolution of one hour, but forecast errors increase proportionally with forecast times. Support vector machines (SVM), artificial neural networks (ANN), deep neural networks (DNN), random forest (RF), and metaheuristic methods are used in machine learning [
14,
15,
16,
17,
18]. A previous study [
19] used the Random forest to forecast solar power using principal component analysis (PCA)-K-means clustering together with the differential evolution grey-wolf algorithm. However, the calculation time increases if the algorithm is used to optimize parameters because the number of iterative operations increases.
The most commonly used machine-learning technique is deep learning. Deep learning uses neural networks with more than three layers. A previous study [
20] compared various deep learning neural networks for short-term PV power forecasting: long short-term memory (LSTM), bidirectional LSTM (Bi-LSTM), a gated recurrent unit (GRU), bidirectional GRU (Bi-GRU), a convolutional neural network (CNN), and other hybrid configurations such as CNN-LSTM and CNN-GRU. Another study [
21] used a hybrid implementation of physical models and an ANN. Hybrid models give accurate forecasts for photovoltaic production but there are significant forecasting errors due to inaccurate weather forecasts.
A metaheuristic method is used to optimize the hyperparameters for a forecasting model. One study [
22] used a metaheuristic method called differential evolution and a particle swarm optimization (DEPSO) algorithm to optimize the forecasting model for short-term PV power output forecasting. Another study [
23] used a metaheuristic method called a CNN-salp swarm algorithm (SSA) with a deep learning method. To allow predictions for different weather types, five CNN regression models were created and the hyperparameters were optimized using a salp swarm algorithm (SSA). Another study [
24] used an LSTM with four hidden layers and Bayesian optimization to select the best combination of features. The simulation gives an accurate forecast in sunny and cloudy weather in terms of the mean squared error (MSE), the mean absolute error (MAE), the coefficient of determination (R
2), and the root mean squared error (RMSE).
Clustering and classification improve forecasting accuracy. One study [
25] used K-means clustering to define the different types of sky for each hour using different levels of irradiance and weather features, such as solar irradiance, temperature, wind speed, and relative humidity, as inputs. This produces a 33–44.6% improvement in accuracy compared to the benchmark method. Another study [
26] compared classification methods, such as K-nearest neighbor (KNN) and SVM models, in terms of performance. The results show that an SVM performs well on a small sample scale.
An ensemble learning method is used to increase the accuracy of PV power forecasting, which involves combining multiple models to make predictions. One study [
27] developed a stacked generalization ensemble model for short-term PV power generation forecasting. This uses base learners such as extreme learning machines (ELM), extremely randomized trees, K-nearest neighbor (KNN), and the Mondrian forest model. A deep belief network is used as a meta learner to generate the final outputs from meteorological features such as global horizontal irradiance (GHI), diffuse horizontal irradiance (DHI), relative humidity, wind direction, and temperature. The MAE, RMSE, mean absolute percentage error (MAPE), and R
2 values are used as evaluation criteria. The proposed model gives a MAPE that is 2.30% more than that for the benchmark and a single model.
One study [
28] used a seasonal time series model to develop a regression-based ensemble forecasting combination. Seasonal time series models use a seasonal autoregressive integrated moving average (SARIMA), exponential smoothing (ETS), multilayer perceptron (MLP), seasonal trend decomposition, a TBATS model, and a theta model. Eight ensemble forecasting combination methods were used to combine the forecasting results. The normalized root mean squared error (nRMSE), normalized mean bias error (nMBE), forecast skill, and Kolmogorov–Smirnov test integral (KSI) are used to calculate the accuracy. Sometimes the best individual model is more accurate than the ensemble model.
Another study [
29] used the bagging ensemble method with Random forest (RF) and extra trees (ET) to predict hourly PV generation, and an SVR was used as the benchmark model. The inputs for the model are solar radiation, air temperature, relative humidity, wind speed, and the previous hourly value for PV output. The RMSE and MAE values are used for error validation. ET outperforms RF and SVR, with an MAE of 1.0851 kWh. However, this study did not involve different weather conditions, such as sunny, cloudy, or rainy.
One study [
30] blended forecasting results from multiple feedforward neural network (FNN) predictors using the RF model. Meteorological measurements, such as solar irradiance, ambient temperature, and wind speed, were used as model inputs. The method for this study outperforms six benchmark models in terms of persistence, SVR, linear regression (LR), RF, gradient boosting (GB), and extreme GB (XGBoost) by 40%, but the method only uses one-hour-ahead forecasts for very short-term PV power forecasting.
Table 1 shows the previous researches on PV power forecasting using the ensemble method. Many studies show that the use of the ensemble method can increase the accuracy of the single forecasting method. In fact, the weight coefficients in every weather condition, such as sunny, cloudy, or rainy, are different from one another. The suitable weights must be implemented in the proper weather conditions to increase the accuracy. This study proposed an ensemble-based model for short-term PV power forecasting to increase the accuracy of the short-term PV power output predictions. The proposed model incorporates five RF models for five weather types: sunny, light-cloudy, cloudy, heavy-cloudy, and rainy. It also uses regression-based methods such as linear regression (LR) and support vector regression (SVR) and uses LASSO and Ridge regularization for weighting to combine the forecasting results. A previous study implemented a stacked generalization ensemble method for short-term PV power forecasting using an RNN meta learner [
31]. The stacking RNN method is used as a benchmark for the ensemble forecasting method for this study. The goal of this study is to improve the accuracy and performance of the individual forecasting models for day-ahead PV power forecasting by implementing a regression-based ensemble method. This study makes the following significant contributions to this field of study:
A new PV forecasting structure that incorporates K-means clustering, RF models, and the regression-based method with LASSO and Ridge regularizations is used to increase forecasting accuracy.
A regression-based ensemble learning with Bayesian optimization is used with LASSO and Ridge regularization to calculate the five optimal sets of weight coefficients, which allows us to determine which predictors in the model are significant.
The regression-based method is easier to implement and has fewer hyperparameters compared to the stacking RNN method. The results show that the proposed regression-based method outperforms the benchmark stacking RNN by 2%.
The remainder of the paper is structured as follows.
Section 2 briefly describes the proposed methodology and setup modeling.
Section 3 explains the ensemble forecasting strategy.
Section 4 details the proposed PV power forecasting simulation results, and
Section 5 details the conclusions and future applications.
3. Ensemble Forecasting Strategy
The clustering method, classification techniques, RF models, and the regression-based ensemble model are used for the proposed PV power ensemble forecasting strategy.
Figure 3 shows the overall structure of the ensemble PV power generation forecast. The general framework consists of three steps: model training, optimal set of weights creation, and model testing. In step 1, K-means clustering uses the daily average historical PV power output for
k different weather conditions using the optimal number of
k. The optimal number of
k is calculated using the elbow method, which is five in this case. The five clusters are labeled as rainy, heavy-cloudy, cloudy, light-cloudy, and sunny. Then an RF model was trained on each cluster using the historical hourly weather data as input and PV power generation as output. In addition, an SVM classification model was also trained using the historical daily average weather data as input and the label defined by K-means clustering as output. There were five RF models (RF
1, RF
2, RF
3, RF
4, and RF
5) and an SVM classification model obtained in this step.
Figure 4 shows the detailed process of step 1.
In step 2, the dataset for each cluster was trained using RF models that we obtained from the first step. Then, the PV power output of each Random forest model is used as an input to the regression-based method to construct the set of weights. The hyperparameters for the regression-based method are learner (LR or SVR), regularization (LASSO or Ridge), and
λ (penalty coefficient for regularization). Bayesian optimization is performed to find the optimal value of these three hyperparameters. The optimal set of weights is obtained in this step and each set of weights contains five weight coefficients and a bias. Different weather conditions have different sets of weights to ensure accurate forecasting results.
Figure 5 shows the detailed process of step 2.
In order to simulate weather forecasting inaccuracies, random errors of 10%, 20%, 30%, 40%, 50%, and 60% are applied to the actual weather value in load forecasting [
49]. In step 3, we assumed that a random error of ±20% is added to the actual weather data to allow it to be used as forecasting data due to insufficient weather forecasting data. The weather forecasting data for the target day is used as input for five RF models. The average daily weather forecasting data is also used as input for the SVM classification model obtained in step 1. The SVM output selects the weather conditions, and the corresponding set of weight coefficients from step 2 is combined with the output from each RF model to obtain the final forecasting results by using (17):
where
is the final forecasting results,
, , …,
are the weight coefficients,
,
, …,
are the forecasting results of RF models, and
b is the bias.
Figure 6 shows the detailed process of step 3.
4. PV Power Forecasting Simulation Results
The software package, MATLAB 2021b edition, with an Intel Core i7 CPU at 3.60 GHz and an 8 GB RAM computer, is used for the simulation. The stacking RNN ensemble method is used as a benchmark model to compare the results for one-day-ahead PV power forecasting. The stacking RNN ensemble method is proven to give accurate short-term PV power forecasts [
31].
4.1. Test System
A case study used a 2000 kWp PV farm in Zhangbin Industrial Area, Taiwan, as a test system to determine the accuracy of PV power output forecasting. The actual irradiance and weather features from Solcast are used to train the model. There is a lack of weather prediction data, so a ±20% random error is generated in the actual data to simulate the weather forecast. The measured PV power generation for this study was obtained from the Zhangbin Industrial Area’s PV site in Taiwan.
The test system includes historical data for PV power output and hourly average values for irradiance, temperature, precipitation, relative humidity, and wind speed. The data for 2020 is used as a dataset for the system. The data preprocessing that is described in
Section 2.5.1 gives 300 days of good data that is used for the simulation. This study uses twelve points for each PV power output and corresponding weather variables on one day: the PV power output and weather variables from 06:00–17:00.
The collected data is classified into five weather conditions using K-means clustering, and the elbow method is used to determine the optimal number of clusters. The weather conditions are sunny, light-cloudy, cloudy, heavy-cloudy, and rainy.
The training and testing datasets for various weather conditions that are used to train and test the RF model and the ensemble method are shown in
Table 3. From the 300-day dataset, 223 days (75%) are used to train a single RF model, and 77 days (25%) are used to test the model. The test results for the single RF model are used as datasets to train and test the ensemble learner. Sixty days (80%) are used to train the ensemble learner, and 17 days (20%) are used for testing. A total of 10 days of the ensemble learner’s testing data are used to test the proposed method for each model, and the proposed method is tested using the ensemble learner’s testing data for seven consecutive days from 14 May to 20 May 2020.
Figure 7 shows a detailed illustration of the RF model and the data preparation for the ensemble learner.
4.2. Hyperparameters Setting for the RF and Ensemble Models
The hyperparameters for the RF model are the number of trees and the minimum leaf size. The search spaces are 100, 200, 500, and 1000 trees, with minimum leaf sizes of 1, 3, and 5.
Table 4 shows the parameters for each single RF model, as determined by the experiment.
The penalty coefficient (lambda), a learner, and regularization are used to tune the optimal hyperparameters for the proposed ensemble model. Lambda is a positive coefficient. The regression-based learners are linear regression using ordinary least square (OLS) and support vector regression (SVR), and the regularization methods are LASSO and Ridge regression.
The ensemble model uses Bayesian optimization to optimize the hyperparameters. “Bayesian optimization” is a global optimization problem [
50]. The benchmark method is a stacking RNN, which has the same structure as that of a previous study [
31].
Table 5 shows the parameters for the benchmark model and the optimal hyperparameters for the proposed ensemble model that are determined using the optimization process.
4.3. Short-Term PV Power Output Forecasting
K-means clustering is used to label the data. The elbow method is used to determine the optimal number of clusters (
k). The plot with the best number of clusters is shaped like an arm. The elbow method gives the results that are shown in
Figure 8. The optimal value for
k is 3–5 clusters. Ensemble forecasting requires diverse models [
51] so different individual models use different datasets [
32], or the same dataset uses different parameters [
52] so a maximum value must be assigned for
k, which in this case is 5.
The results of a previous study [
31] show that an ensemble of five models outperforms an ensemble of three models in terms of accuracy. The five weather conditions for this study are sunny, light-cloudy, cloudy, heavy-cloudy, and rainy. The RF models are trained using these five weather conditions, and five RF models are produced: RF
1, RF
2, RF
3, RF
4, and RF
5, for rainy, heavy-cloudy, cloudy, light-cloudy, and sunny, respectively. The dataset for each weather condition is trained using these five RF models in order to calculate a set of weights. Each set contains five weight coefficients and a bias. Regression-based ensemble learning with Bayesian optimization is then used to calculate five optimal sets of weight coefficients and a bias for each weather condition, and Equation (17) is used to calculate the final ensemble forecasting results for each weather condition.
The SVM classification gives the weather conditions for the target day, and an appropriate weight set is used. The SVM classification model receives weather forecasts as input and weather conditions as output. To simulate weather forecasting, a ±20% random error is added to the real weather value.
Figure 9 shows the results for the RF models and the proposed regression-based ensemble forecasting method for sunny weather conditions. The RF
5 model has the lowest MRE value of 7.91% compared to other RF models. The stacking RNN shows that the ensemble method gives more accurate PV power forecasting, with an MRE value of 4.49%. However, the proposed ensemble method provides the most accurate results, with an MRE of 3.49%.
Figure 10 shows the results for the RF models and the proposed regression-based ensemble forecasting method for light-cloudy weather conditions. Compared to other RF models, the RF
5 model has the lowest MRE value of 5.83%. With an MRE value of 5.61%, the stacking RNN demonstrates that the ensemble model provides more accurate PV power forecasting. On the other hand, the proposed ensemble method produces the most accurate results with an MRE of 5.22%.
The results for the RF models and the proposed regression-based ensemble forecasting method for cloudy conditions are shown in
Figure 11. The RF
3 model has the lowest MRE value of 6.19% compared to the other RF models. In terms of forecasting PV power, the stacking RNN outperforms the best RF model, with an MRE value of 5.49%. However, the proposed ensemble method has the lowest MRE of 4.19%.
The results for the RF models and the proposed regression-based ensemble forecasting method for heavy-cloudy weather conditions are shown in
Figure 12. The RF
3 model has the lowest MRE value of 4.62% compared to the other RF models. With an MRE value of 4.4%, the stacking RNN outperforms the best RF model in forecasting PV power. However, the proposed ensemble method has the lowest MRE of 3.93% compared to all other models.
Figure 13 shows the results for the RF models and the proposed regression-based ensemble forecasting method for rainy conditions. The RF
3 has the lowest MRE value of 1.87% compared to the other RF models, but the stacking RNN outperforms the best RF model with an MRE value of 1.76%. Nevertheless, the proposed ensemble method has the best MRE value of 1.59%.
Table 6 compares the proposed method to the RF model and benchmark method in terms of one-day-ahead observations. The proposed method produces the lowest MRE and MAE values. The MRE for sunny weather conditions is 3.492%, and the MRE values for the stacking RNN and the best RF model are 4.495% and 7.905%, respectively. The proposed method gives an MAE of 69.833 kW, and the best RF and stacking RNN models give MAE values of 158.1 kW and 89.893 kW, respectively. The proposed method achieves a 5.222% MRE and a 104.434 kW MAE for light-cloudy weather conditions. The best RF and stacking RNN models give MRE values of 5.833% and 5.607%, respectively, and MAE values of 116.651 kW and 112.13 kW.
For cloudy weather conditions, the proposed method gives an MRE of 4.195% and an MAE value of 83.902 kW, values that are lower than those for the stacking RNN model with a 5.497% MRE and a 109.935 kW MAE. The best RF model is less accurate than the stacking RNN model, which gives a 6.189% MRE and a 123.781 kW MAE. The proposed method is more accurate than the best RF and stacking RNN methods for heavy-cloudy conditions, with a 3.934% MRE and an MAE value of 78.688 kW. The proposed method gives a 1.599% MRE and a 31.976 kW MAE for rainy conditions, and the best RF method performs worse, with a 1.871% MRE and an MAE of 37.42 kW. The MRE value for the stacking RNN method is 1.76% and the MAE value is 35.199 kW.
The proposed method is more accurate than the best RF and benchmark methods in terms of the coefficient of determination (R2). It has a higher R2 value for all weather conditions than the best RF and benchmark methods and the lowest R2 value is for rainy conditions. The benchmark model stacking RNN is an ensemble method and is much more accurate than a single forecasting method such as the RF model. However, the proposed ensemble method is more accurate than the benchmark stacking RNN model, as demonstrated by the results for the sunny, light-cloudy, cloudy, heavy-cloudy, and rainy datasets.
The proposed regression-based ensemble method for short-term PV power forecasting performance was also tested using the data for seven consecutive days to represent a real industrial application.
Figure 14 shows a 7-day comparison of the proposed method, and
Figure 15 compares the MRE, MAE, and R
2 for the best RF model, the stacking RNN, and the proposed method. The best single RF model has an MRE of 5.611%, an MAE of 112.223 kW, and an R
2 of 0.903. The benchmark method with stacking RNN has an MRE of 4.457%, an MAE of 89.130 kW, and an R
2 of 0.93, so it is more accurate than the best RF model. The proposed method has an MRE of 4.362%, an MAE of 87.242 kW, and an R
2 of 0.933, so it is the most accurate method. In terms of the MRE, the proposed method is 22% better than the best RF model and 2% better than the benchmark method.