Time Series Analysis and Forecasting of Solar Generation in Spain Using eXtreme Gradient Boosting: A Machine Learning Approach
Abstract
:1. Introduction
2. Related Work
3. Methods
3.1. Dataset and Preprocessing
3.2. Training and Testing Data
3.3. Exploratory Data Analysis (EDA)
3.4. Time Series Modeling with XGBoost
3.5. Model Evaluation and Validation
- 1.
- Root mean squared error (RMSE) stands as a sentinel of predictive accuracy, gauging the extent of discrepancies between predicted and observed values. A low RMSE value signifies a model that closely tracks the actual solar generation, while higher values reveal areas for improvement. The formula for RMSE is as follows:
- 2.
- Mean absolute error (MAE) provides insights into the average magnitude of errors between predictions and actual data points. It complements RMSE by offering a more intuitive understanding of forecasting accuracy. The formula for MAE is as follows:
- 3.
- R-squared (R2) often regarded as the coefficient of determination; it unveils the proportion of variance in the target variable captured by our model. A value of 1.00 signifies a perfect fit, while values closer to 0 indicate diminishing predictive power. The formula for the R2 score is as follows:
- 4.
- Mean absolute percentage error (MAPE) allows us to assess the relative magnitude of errors as a percentage of the actual solar generation values. This metric is particularly valuable in understanding the proportional accuracy of our predictions. The formula for MAPE is as follows:
3.6. Temporal Analysis
4. Results and Discussion
4.1. Temporal Patterns of Solar Generation
4.2. XGBoost Modeling and Forecasting
4.3. Learning Curves
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Dhabi, A.; Irena. Renewable Energy Statistics. 2020. Available online: http://www.evwind.es/2020/06/05/renewable-energycosts-plummet-according-toirena/75021 (accessed on 3 September 2023).
- Nassar, N.T.; Wilburn, D.R.; Goonan, T.G. Byproduct metal requirements for U.S. Wind and solar photovoltaic electricity generation up to the year 2040 under various clean power plan scenarios. Appl. Energy 2016, 183, 1209–1226. [Google Scholar] [CrossRef]
- Vita, V.; Fotis, G.; Pavlatos, C.; Mladenov, V. A New Restoration Strategy in Microgrids after a Blackout with Priority in Critical Loads. Sustainability 2023, 15, 1974. [Google Scholar] [CrossRef]
- Soto, E.A.; Bosman, L.B.; Wollega, E.; Leon-Salas, W.D. Analysis of Grid Disturbances Caused by Massive Integration of Utility Level Solar Power Systems. Eng 2022, 3, 236–253. [Google Scholar] [CrossRef]
- ElNozahy, M.S.; Salama, M.M.A. Technical impacts of grid-connected photovoltaic systems on electrical networks—A review. J. Renew. Sustain. Energy 2013, 5, 032702. [Google Scholar] [CrossRef]
- Buwei, W.; Jianfeng, C.; Bo, W.; Shuanglei, F. A Solar Power Prediction Using Support Vector Machines Based on Multi-Source Data Fusion. In Proceedings of the 2018 International Conference on Power System Technology (POWERCON), Guangzhou, China, 6–8 November 2018; pp. 4573–4577. [Google Scholar]
- Paska, J.; Surma, T.; Terlikowski, P.; Zagrajek, K. Electricity Generation from Renewable Energy Sources in Poland as a Part of Commitment to the Polish and EU Energy Policy. Energies 2020, 13, 4261. [Google Scholar] [CrossRef]
- Yin, L.; Cao, X.; Liu, D. Weighted fully connected regression networks for one-day-ahead hourly photovoltaic power forecasting. Appl. Energy 2023, 332, 120527. [Google Scholar] [CrossRef]
- Alaraj, M.; Kumar, A.; Alsaidan, I.; Rizwan, M.; Jamil, M. Energy Production Forecasting from Solar Photovoltaic Plants Based on Meteorological Parameters for Qassim Region, Saudi Arabia. IEEE Access 2021, 9, 83241–83251. [Google Scholar] [CrossRef]
- Khatib, T.; Mohamed, A.; Mahmoud, M.M.; Sopian, K. Modeling of Daily Solar Energy on a Horizontal Surface for Five Main Sites in Malaysia. Int. J. Green Energy 2011, 8, 795–819. [Google Scholar] [CrossRef]
- Andrade, C.H.T.d.; Melo, G.C.G.d.; Vieira, T.F.; Araújo, Í.B.Q.d.; Medeiros Martins, A.d.; Torres, I.C.; Brito, D.B.; Santos, A.K.X. How Does Neural Network Model Capacity Affect Photovoltaic Power Prediction? A Study Case. Sensors 2023, 23, 1357. [Google Scholar] [CrossRef]
- Khademi, M.; Moadel, M.; Khosravi, A. Power Prediction and Technoeconomic Analysis of a Solar PV Power Plant by MLP-ABC and COMFAR III, considering Cloudy Weather Conditions. Int. J. Chem. Eng. 2016, 2016, 1031943. [Google Scholar] [CrossRef]
- Li, G.; Wei, X.; Yang, H. Decomposition integration and error correction method for photovoltaic power forecasting. Measurement 2023, 208, 112462. [Google Scholar] [CrossRef]
- Trabelsi, M.; Massaoudi, M.; Chihi, I.; Sidhom, L.; Refaat, S.S.; Huang, T.; Oueslati, F.S. An Effective Hybrid Symbolic Regression–Deep Multilayer Perceptron Technique for PV Power Forecasting. Energies 2022, 15, 9008. [Google Scholar] [CrossRef]
- Icel, Y.; Mamis, M.S.; Bugutekin, A.; Gursoy, M.I. Photovoltaic Panel Efficiency Estimation with Artificial Neural Networks: Samples of Adiyaman, Malatya and Sanliurfa. Int. J. Photoenergy 2019, 2019, 6289021. [Google Scholar] [CrossRef]
- Khilar, R.; Suba, G.M.; Kumar, T.S.; Samson Isaac, J.; Shinde, S.K.; Ramya, S.; Prabhu, V.; Erko, K.G. Improving the Efficiency of Photovoltaic Panels Using Machine Learning Approach. Int. J. Photoenergy 2022, 2022, 4921153. [Google Scholar] [CrossRef]
- Zhu, T.; Guo, Y.; Li, Z.; Wang, C. Solar Radiation Prediction Based on Convolution Neural Network and Long Short-Term Memory. Energies 2021, 14, 8498. [Google Scholar] [CrossRef]
- Cabezón, L.; Ruiz, L.G.B.; Criado-Ramón, D.; Gago, E.J.; Pegalajar, M.C. Photovoltaic Energy Production Forecasting through Machine Learning Methods: A Scottish Solar Farm Case Study. Energies 2022, 15, 8732. [Google Scholar] [CrossRef]
- Son, J.; Park, Y.; Lee, J.; Kim, H. Sensorless PV Power Forecasting in Grid-Connected Buildings through Deep Learning. Sensors 2018, 18, 2529. [Google Scholar] [CrossRef]
- Fadare, D. Modellingof solar energy potential in Nigeria using an artificial neural network model. Appl. Energy 2009, 86, 1410–1422. [Google Scholar] [CrossRef]
- Dellino, G.; Laudadio, T.; Mari, R.; Mastronardi, N.; Meloni, C.; Vergura, S. Energy production forecasting in a PV plant using transfer function models. In Proceedings of the 2015 IEEE 15th International Conference on Environment and Electrical Engineering (EEEIC), Rome, Italy, 10–13 June 2015; pp. 1379–1383. [Google Scholar]
- Nia, M.; Chegaar, M.; Benatallah, M.F.; Aillerie, M. Contribution to the quantification of solar radiation in Algeria. Energy Procedia 2013, 36, 730–737. [Google Scholar] [CrossRef]
- Li, H.; Ma, W.; Wang, X.; Lian, Y. Estimating monthly average daily diffuse solar radiation with multiple predictors: A case study. Renew. Energy 2011, 36, 1944–1948. [Google Scholar] [CrossRef]
- Şen, Z. Simple nonlinear solar irradiation estimation model. Renew. Energy 2007, 32, 342–350. [Google Scholar] [CrossRef]
- Şen, Z. Angström equation parameter estimation by unrestricted method. Sol. Energy 2001, 71, 95–107. [Google Scholar] [CrossRef]
- Mellit, A.; Benghanem, M.; Bendekhis, M. Artificial neural network model for prediction solar radiation data: Application for sizing stand-alone photovoltaic power system. In Proceedings of the 2005 IEEE Power Engineering Society General Meeting, San Francisco, CA, USA, 12–16 June 2005; Volume 1, pp. 40–44. [Google Scholar]
- Amrouche, B.; Le Pivert, X. Artificial neural network based daily local forecasting for global solar radiation. Appl. Energy 2014, 130, 333–341. [Google Scholar] [CrossRef]
- Chugh, A.; Chaudhary, P.; Rizwan, M. Fuzzy logic approach for short term solar energy forecasting. In Proceedings of the 12th IEEE International Conference Electronics, Energy, Environment, Communication, Computer, Control: (E3-C3) INDICON, Piscataway, NJ, USA, 17–20 December 2015. [Google Scholar]
- Monís, J.I.; López-Luque, R.; Reca, J.; Martínez, J. Multistage Bounded Evolutionary Algorithm to Optimize the Design of Sustainable Photovoltaic (PV) Pumping Irrigation Systems with Storage. Sustainability 2020, 12, 1026. [Google Scholar] [CrossRef]
- Lateko, A.A.H.; Yang, H.-T.; Huang, C.-M.; Aprillia, H.; Hsu, C.-Y.; Zhong, J.-L.; Phuong, N.H. Stacking Ensemble Method with the RNN Meta-Learner for Short-Term PV Power Forecasting. Energies 2021, 14, 4733. [Google Scholar] [CrossRef]
- Erduman, A. A smart short-term solar power output prediction by artificial neural network. Electr. Eng. 2020, 102, 1441–1449. [Google Scholar] [CrossRef]
- Bhatti, A.R.; Bilal Awan, A.; Alharbi, W.; Salam, Z.; Bin Humayd, A.S.; Praveen, R.P.; Bhattacharya, K. An Improved Approach to Enhance Training Performance of ANN and the Prediction of PV Power for Any Time-Span without the Presence of Real-Time Weather Data. Sustainability 2021, 13, 11893. [Google Scholar] [CrossRef]
- Meng, M.; Song, C. Daily Photovoltaic Power Generation Forecasting Model Based on Random Forest Algorithm for North China in Winter. Sustainability 2020, 12, 2247. [Google Scholar] [CrossRef]
- Zazoum, B. Solar photovoltaic power prediction using different machine learning methods. Energy Rep. 2022, 8, 19–25. [Google Scholar] [CrossRef]
- Elsaraiti, M.; Merabet, A. Solar Power Forecasting Using Deep Learning Techniques. IEEE Access 2022, 10, 31692–31698. [Google Scholar] [CrossRef]
- Obiora, C.N.; Hasan, A.N.; Ali, A.; Alajarmeh, N. Forecasting Hourly Solar Radiation Using Artificial Intelligence Techniques. IEEE Can. J. Electr. Comput. Eng. 2021, 44, 497–508. [Google Scholar] [CrossRef]
- Akhter, M.N.; Mekhilef, S.; Mokhlis, H.; Almohaimeed, Z.M.; Muhammad, M.A.; Khairuddin, A.S.M.; Akram, R.; Hussain, M.M. An Hour-Ahead PV Power Forecasting Method Based on an RNN-LSTM Model for Three Different PV Plants. Energies 2022, 15, 2243. [Google Scholar] [CrossRef]
- Kalogirou, S.A. Artificial neural networks in renewable energy systems applications: A review. Renew. Sustain. Energy Rev. 2001, 5, 373–401. [Google Scholar] [CrossRef]
- Elsaraiti, M.; Merabet, A. A comparative analysis of the ARIMA and LSTM predictive models and their effectiveness for predicting wind speed. Energies 2021, 14, 6782. [Google Scholar] [CrossRef]
- Young, S.R.; Rose, D.C.; Karnowski, T.P.; Lim, S.-H.; Patton, R.M. Optimizing deep learning hyper-parameters through an evolutionary algorithm. In Proceedings of the Workshop on Machine Learning in High-Performance Computing Environments, Austin, TX, USA, 15 November 2015; pp. 1–5. [Google Scholar]
- Raza, M.Q.; Khosravi, A. A review on artificial intelligence-based load demand forecasting techniques for smart grid and buildings. Renew. Sustain. Energy Rev. 2015, 50, 1352–1372. [Google Scholar] [CrossRef]
- Kalogirou, S.A. Solar thermal power systems. In Solar Energy Engineering; Academic Press: New York, NY, USA, 2009; pp. 521–552. [Google Scholar]
- Azadeh, A.; Babazadeh, R.; Asadzadeh, S.M. Optimum estimation and forecasting of renewable energy consumption by artificial neural networks. Renew. Sustain. Energy Rev. 2013, 27, 605–612. [Google Scholar] [CrossRef]
- Rabehi, A.; Guermoui, M.; Lalmi, D. Hybrid models for global solar radiation prediction: A case study. Int. J. Ambient Energy 2020, 41, 31–40. [Google Scholar] [CrossRef]
- Xiaoyun, Q.; Xiaoning, K.; Chao, Z.; Shuai, J.; Xiuda, M. Shortterm prediction of wind power based on deep long short-term memory. In Proceedings of the 2016 IEEE PES Asia-Pacific Power and Energy Engineering Conference (APPEEC), Xi’an, China, 25–28 October 2016; pp. 1148–1152. [Google Scholar]
- Olabi, A.G.; Abdelkareem, M.A.; Semeraro, C.; Radi, M.A.; Rezk, H.; Muhaisen, O.; Al-Isawi, O.A.; Sayed, E.T. Artificial neural networks applications in partially shaded PV systems. Therm. Sci. Eng. Prog. 2023, 37, 101612. [Google Scholar] [CrossRef]
- Das, U.K.; Tey, K.S.; Seyedmahmoudian, M.; Mekhilef, S.; Idris, M.Y.I.; Van Deventer, W.; Horan, B.; Stojcevski, A. Forecasting of photovoltaic power generation and model optimization: A review. Renew. Sustain. Energy Rev. 2018, 81, 912–928. [Google Scholar] [CrossRef]
- Zhong, J.; Liu, L.; Sun, Q.; Wang, X. Prediction of Photovoltaic Power Generation Based on General Regression and Back Propagation Neural Network. Energy Procedia 2018, 152, 1224–1229. [Google Scholar] [CrossRef]
- Yucong, W.; Bo, W. Research on ea-xgboost hybrid model for building energy prediction. J. Phys. Conf. Ser. 2020, 1518, 012082. [Google Scholar] [CrossRef]
- Manikanta, C.; Mamatha Jadav, V. Evaluation of modified PLS regression method to fill the missing values in training dataset. In Proceedings of the 2015 International Conference on Smart Sensors and Systems (IC-SSS), Bangalore, India, 21–23 December 2015. [Google Scholar]
- Chai, T.; Draxler, R.R. Root mean square error (rmse) or mean absolute error (mae)? Arguments against avoiding rmse in the literature. Geosci. Model Dev. 2014, 7, 1247–1250. [Google Scholar] [CrossRef]
- Di Bucchianico, A. Coefficient of Determination (r2). In Encyclopedia of Statistics in Quality and Reliability; Wiley: Hoboken, NJ, USA, 2007. [Google Scholar]
Refs | Machine Learning Algorithm | Parameters Used | Metrics Output |
---|---|---|---|
[30] | Recurrent neural network (RNN) | Temperature, humidity, wind speed | MRE (%) = 3.87; MAE (kW) = 7.75; nRMSE (%) = 5.69 |
[31] | Artificial neural network (ANN) | Temperature, wind speed, humidity, radiation | 97.53% |
[32] | Artificial neural network (ANN) | Temperature, wind speed, wind pressure, irradiance | MAPE (%) = 1.8; MSE = 3.19 × 10−10 |
[33] | Gradient boosting decision tree (GBDT) | Temperature, wind speed, atmospheric pressure, relative humidity, Total solar radiation | RMSE (MWh) = 6.73; MAE (MWh) = 6.02; MAPE (%) = 3.30 |
[34] | Support vector machine (SVM) and Gaussian process regression (GPR) models | Module temperature, ambient temperature, solar flux, time of the day, relative humidity | RMSE = 7.967; MAE = 5.302; R2 = 0.98 |
[35] | Long short-term memory (LSTM) | Ambient temperature and mean solar radiation | RMSE = 317.4; MAE = 236.35; MAPE = 2.17 |
[36] | Time-series long short-term memory (LSTM) network, convolutional LSTM | Historical hourly solar radiation | nRMSE = 4.05% |
[37] | RNN-LSTM model | Module and ambient temperature Solar radiation | RMSE = 19.78; R2 = 0.9943 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Saigustia, C.; Pijarski, P. Time Series Analysis and Forecasting of Solar Generation in Spain Using eXtreme Gradient Boosting: A Machine Learning Approach. Energies 2023, 16, 7618. https://doi.org/10.3390/en16227618
Saigustia C, Pijarski P. Time Series Analysis and Forecasting of Solar Generation in Spain Using eXtreme Gradient Boosting: A Machine Learning Approach. Energies. 2023; 16(22):7618. https://doi.org/10.3390/en16227618
Chicago/Turabian StyleSaigustia, Candra, and Paweł Pijarski. 2023. "Time Series Analysis and Forecasting of Solar Generation in Spain Using eXtreme Gradient Boosting: A Machine Learning Approach" Energies 16, no. 22: 7618. https://doi.org/10.3390/en16227618
APA StyleSaigustia, C., & Pijarski, P. (2023). Time Series Analysis and Forecasting of Solar Generation in Spain Using eXtreme Gradient Boosting: A Machine Learning Approach. Energies, 16(22), 7618. https://doi.org/10.3390/en16227618