A Hybrid XGBoost-LSTM Approach to Day-Ahead Solar Forecasting across Diverse Climatic Zones: A Comparative Study of Six Nigerian Cities
Abstract
Accurate day-ahead solar forecasting is essential for integrating photovoltaic generation into Nigeria's power grid. This paper presents the development and evaluation of a hybrid Long Short-Term Memory (LSTM) – Extreme Gradient Boost (XGBoost) model for solar irradiance forecasting across selected Nigerian cities. The study utilizes satellite-based meteorological and solar irradiation datasets obtained from NASA POWER and European commission PVGIS covering the period from 2014-2024. The datasets included Global Horizontal irradiance (GHI), temperature, relative humidity, and wind parameters. The methodology involved data acquisition, preprocessing, normalization, feature engineering, and model training using google Colab. The LSTM network was deployed to capture temporal dependencies and sequential characteristics in solar irradiance data, while the XGBoost algorithm was utilized to model nonlinear relationships among meteorological variables. The outputs of both models were integrated using a weighted average hybrid approach to improve forecasting performance, with the model performance evaluated using the standard metrics. The results showed that the hybrid model outperformed the standalone LSTM and XGBoost models across all selected cities with MAE values between 0.027 and 0.042 across the six cities and R-squared exceeding 0.95 for the four inland locations (Abuja, Enugu, Kano, Maiduguri) and dropping to 0.916 for Lagos and 0.878 for Port Harcourt. XGBoost carried most of the predictive weight (alpha = 0.85–0.95), though the LSTM contributed more in coastal climates where weather variability benefits from temporal memory. The Hybrid model achieved lower forecasting errors and higher prediction accuracy, particularly in northern regions where solar irradiance patterns are more stable. While, Coastal cities recorded relatively higher prediction errors due to cloud variability and cloud cover. The methodology is readily transferable to other data-scarce regions in Sub-Saharan Africa and provides a foundation for grid operators to optimize dispatch scheduling, reduce fossil fuel backup dependence, and accelerate solar integration. The findings of this study demonstrate the proposed framework can significantly enhance solar irradiance forecasting accuracy in Nigeria. The developed model can support solar power generation planning, smart grid management, renewable energy integration, and energy policy development. this research contributes to renewable energy forecasting literature by providing a multi-city hybrid forecasting framework suitable for tropical and developing regions with diverse climatic conditions.
Full Text:
PDFReferences
Abdel-Nasser, M., & Mahmoud, K. (2019). Accurate photovoltaic power forecasting models using deep LSTM-RNN. Neural Computing and Applications, 31(7), 2727–2740. https://doi.org/10.1007/S00521-017-3225-Z/METRICS
Bamisile, O., Oluwasanmi, A., Ejiyi, C., Yimen, N., Obiora, S., & Huang, Q. (2022). Comparison of machine learning and deep learning algorithms for hourly global/diffuse solar radiation predictions. International Journal of Energy Research, 46(8), 10052–10073. https://doi.org/10.1002/ER.6529
Chen, T., & Guestrin, C. (2024). XGBoost: A Scalable Tree Boosting System. https://doi.org/10.1145/2939672.2939785
Choi, S., & Hur, J. (2020). An Ensemble Learner-Based Bagging Model Using Past Output Data for Photovoltaic Forecasting. Energies 2020, Vol. 13, Page 1438, 13(6), 1438. https://doi.org/10.3390/EN13061438
Dai, Y., Wang, Y., Leng, M., Yang, X., & Zhou, Q. (2022). LOWESS smoothing and Random Forest based GRU model: A short-term photovoltaic power generation forecasting method. Energy, 256, 124661. https://doi.org/10.1016/J.ENERGY.2022.124661
Dai, Y., Zhou, Q., Leng, M., Yang, X., & Wang, Y. (2022). Improving the Bi-LSTM model with XGBoost and attention mechanism: A combined approach for short-term power load prediction. Applied Soft Computing, 130, 109632. https://doi.org/10.1016/J.ASOC.2022.109632
Inman, R. H., Pedro, H. T. C., & Coimbra, C. F. M. (2013). Solar forecasting methods for renewable energy integration. Progress in Energy and Combustion Science, 39(6), 535–576. https://doi.org/10.1016/J.PECS.2013.06.002
Isma’il, M., & Aliyu, S. (2023). Daily Solar Radiation Forecasting for Northwest Nigeria Using Long Short-Term Memory. International Journal of Science for Global Sustainability, 9(1), 8. https://doi.org/10.57233/ijsgs.v9i1.407
Lahouar, A., & Ben Hadj Slama, J. (2017). Hour-ahead wind power forecast based on random forests. Renewable Energy, 109, 529–541. https://doi.org/10.1016/J.RENENE.2017.03.064
Okumus, I., & Dinler, A. (2016). Current status of wind energy forecasting and a hybrid method for hourly predictions. Energy Conversion and Management, 123, 362–371. https://doi.org/10.1016/J.ENCONMAN.2016.06.053
Sparks, A. (2018). nasapower: A NASA POWER Global Meteorology, Surface Solar Energy and Climatology Data Client for R. Journal of Open Source Software, 3(30), 1035. https://doi.org/10.21105/JOSS.01035
Šúri, M., Huld, T. A., Dunlop, E. D., & Ossenbrink, H. A. (2007). Potential of solar electricity generation in the European Union member states and candidate countries. Solar Energy, 81(10), 1295–1305. https://doi.org/10.1016/J.SOLENER.2006.12.007
Ugwoke, B., Gershon, O., Becchio, C., Corgnati, S. P., & Leone, P. (2020). A review of Nigerian energy access studies: The story told so far. Renewable and Sustainable Energy Reviews, 120, 109646. https://doi.org/10.1016/J.RSER.2019.109646
Urhuerhi, O. P., Udomboso, C., & Sigauke, C. (2025). Forecasting solar power output in Ibadan: A machine learning approach leveraging weather data and system specifications. http://arxiv.org/abs/2508.07462
Vinayagam, A., Mohandas, R., Jeyabharath, R., Mohan, B. S., Lakshmanan, S., & Bharatiraja, C. (2025). Predictions of solar power using ensemble machine learning techniques. International Journal of Power Electronics and Drive Systems (IJPEDS), 16(4), 2868–2878. https://doi.org/10.11591/IJPEDS.V16.I4.PP2868-2878
Wen, L., Zhou, K., Yang, S., & Lu, X. (2019). Optimal load dispatch of community microgrid with deep learning based solar power and load forecasting. Energy, 171, 1053–1065. https://doi.org/10.1016/J.ENERGY.2019.01.075
Wilson, G. T. (2016). Time Series Analysis: Forecasting and Control, 5th Edition, by George E. P. Box, Gwilym M. Jenkins, Gregory C. Reinsel and Greta M. Ljung, 2015. Published by John Wiley and Sons Inc., Hoboken, New Jersey, pp. 712. ISBN: 978‐1‐118‐67502‐1. Journal of Time Series Analysis, 37(5), 709–711. https://doi.org/10.1111/JTSA.12194
Wisdom Samuel Udo, Jephta Mensah Kwakye, Darlington Eze Ekechukwu, & Olorunshogo Benjamin Ogundipe. (2023). Predictive analytics for enhancing solar energy forecasting and grid integration. Engineering Science & Technology Journal, 4(6), 589–602. https://doi.org/10.51594/estj.v4i6.1394
Ying, C., Wang, W., Yu, J., Li, Q., Yu, D., & Liu, J. (2023). Deep learning for renewable energy forecasting: A taxonomy, and systematic literature review. Journal of Cleaner Production, 384, 135414. https://doi.org/10.1016/J.JCLEPRO.2022.135414
Zafar, R., Vu, B. H., Husein, M., & Chung, I. Y. (2021). Day-ahead solar irradiance forecasting using hybrid recurrent neural network with weather classification for power system scheduling. Applied Sciences (Switzerland), 11(15). https://doi.org/10.3390/app11156738.
Refbacks
- There are currently no refbacks.