IDEAS home Printed from https://ideas.repec.org/a/gam/jeners/v18y2025i16p4403-d1727192.html
   My bibliography  Save this article

Forecasting Short-Term Photovoltaic Energy Production to Optimize Self-Consumption in Home Systems Based on Real-World Meteorological Data and Machine Learning

Author

Listed:
  • Paweł Kut

    (Department of Heat Engineering and Air Conditioning, Rzeszow University of Technology, Al. Powstancow Warszawy 6, 35-959 Rzeszow, Poland)

  • Katarzyna Pietrucha-Urbanik

    (Department of Water Supply and Sewerage Systems, Faculty of Civil, Environmental Engineering and Architecture, Rzeszow University of Technology, Al. Powstancow Warszawy 6, 35-959 Rzeszow, Poland)

Abstract

Given the growing number of residential photovoltaic installations and the challenges of self-consumption, accurate short-term PV production forecasting can become a key tool in supporting energy management. This issue is particularly significant in systems without energy storage, where excess production is fed back into the grid, reducing the profitability of prosumer investments. This paper presents an approach to forecasting short-term energy production in residential photovoltaic installations, based on real meteorological data and the use of machine learning methods. The analysis is based on measurement data from a functioning PV installation and a local weather station. This study compares three models: classical linear regression, Random Forest and the XGBoost algorithm. The method of data preparation, the model training process and the assessment of their effectiveness based on real energy production measurements are presented. This paper also includes a practical calculation example and an analysis of selected days in order to compare the forecast results with the actual production. Of the three models compared, the highest accuracy was achieved for XGBoost, with an MAE = 1.25 kWh, RMSE = 1.93 kWh, and coefficient of determination R 2 = 0.94. Compared to linear regression, this means a 66% reduction in MAE and a 41% reduction in the Random Forest model, confirming the practical usefulness of this method in a real-world environment. The proposed approach can be used in energy management systems in residential buildings, without the need to use energy storage, and can support the development of a more conscious use of energy resources on a local scale.

Suggested Citation

  • Paweł Kut & Katarzyna Pietrucha-Urbanik, 2025. "Forecasting Short-Term Photovoltaic Energy Production to Optimize Self-Consumption in Home Systems Based on Real-World Meteorological Data and Machine Learning," Energies, MDPI, vol. 18(16), pages 1-31, August.
  • Handle: RePEc:gam:jeners:v:18:y:2025:i:16:p:4403-:d:1727192
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/1996-1073/18/16/4403/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/1996-1073/18/16/4403/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Voyant, Cyril & Notton, Gilles & Kalogirou, Soteris & Nivet, Marie-Laure & Paoli, Christophe & Motte, Fabrice & Fouilloy, Alexis, 2017. "Machine learning methods for solar radiation forecasting: A review," Renewable Energy, Elsevier, vol. 105(C), pages 569-582.
    2. Liwei Zhang & Lisang Liu & Wenwei Chen & Zhihui Lin & Dongwei He & Jian Chen, 2025. "Photovoltaic Power Generation Forecasting Based on Secondary Data Decomposition and Hybrid Deep Learning Model," Energies, MDPI, vol. 18(12), pages 1-25, June.
    3. Ping Tang & Ying Su & Weisheng Zhao & Qian Wang & Lianglin Zou & Jifeng Song, 2025. "A Hybrid Framework for Photovoltaic Power Forecasting Using Shifted Windows Transformer-Based Spatiotemporal Feature Extraction," Energies, MDPI, vol. 18(12), pages 1-20, June.
    4. Maciej Neugebauer & Jakub d’Obyrn & Piotr Sołowiej, 2024. "Economic Analysis of Profitability of Using Energy Storage with Photovoltaic Installation in Conditions of Northeast Poland," Energies, MDPI, vol. 17(13), pages 1-13, June.
    5. Michał Bernard Pietrzak & Bartłomiej Igliński & Wojciech Kujawski & Paweł Iwański, 2021. "Energy Transition in Poland—Assessment of the Renewable Energy Sector," Energies, MDPI, vol. 14(8), pages 1-23, April.
    6. Goop, Joel & Nyholm, Emil & Odenberger, Mikael & Johnsson, Filip, 2021. "Impact of electricity market feedback on investments in solar photovoltaic and battery systems in Swedish single-family dwellings," Renewable Energy, Elsevier, vol. 163(C), pages 1078-1091.
    7. Bartłomiej Igliński & Michał Bernard Pietrzak, 2025. "Renewable and Sustainable Energy—Current State and Prospects," Energies, MDPI, vol. 18(4), pages 1-8, February.
    8. Yuxiang Guo & Qiang Han & Tan Li & Huichu Fu & Meng Liang & Siwei Zhang, 2025. "Robust Photovoltaic Power Forecasting Model Under Complex Meteorological Conditions," Mathematics, MDPI, vol. 13(11), pages 1-34, May.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Voyant, Cyril & Motte, Fabrice & Notton, Gilles & Fouilloy, Alexis & Nivet, Marie-Laure & Duchaud, Jean-Laurent, 2018. "Prediction intervals for global solar irradiation forecasting using regression trees methods," Renewable Energy, Elsevier, vol. 126(C), pages 332-340.
    2. Trigo-González, Mauricio & Batlles, F.J. & Alonso-Montesinos, Joaquín & Ferrada, Pablo & del Sagrado, J. & Martínez-Durbán, M. & Cortés, Marcelo & Portillo, Carlos & Marzo, Aitor, 2019. "Hourly PV production estimation by means of an exportable multiple linear regression model," Renewable Energy, Elsevier, vol. 135(C), pages 303-312.
    3. Pedro, Hugo T.C. & Lim, Edwin & Coimbra, Carlos F.M., 2018. "A database infrastructure to implement real-time solar and wind power generation intra-hour forecasts," Renewable Energy, Elsevier, vol. 123(C), pages 513-525.
    4. Miguel Ángel Rodríguez López & Diego Rodríguez Rodríguez, 2024. "La aplicación de datos masivos en economía de la energía: una revisión," Working Papers 2024-08, FEDEA.
    5. Agga, Ali & Abbou, Ahmed & Labbadi, Moussa & El Houm, Yassine, 2021. "Short-term self consumption PV plant power production forecasts based on hybrid CNN-LSTM, ConvLSTM models," Renewable Energy, Elsevier, vol. 177(C), pages 101-112.
    6. Mousavi, Navid & Kothapalli, Ganesh & Habibi, Daryoush & Das, Choton K. & Baniasadi, Ali, 2020. "A novel photovoltaic-pumped hydro storage microgrid applicable to rural areas," Applied Energy, Elsevier, vol. 262(C).
    7. Wang, Zhenyu & Zhang, Yunpeng & Li, Guorong & Zhang, Jinlong & Zhou, Hai & Wu, Ji, 2024. "A novel solar irradiance forecasting method based on multi-physical process of atmosphere optics and LSTM-BP model," Renewable Energy, Elsevier, vol. 226(C).
    8. Anna Marciniuk-Kluska & Mariusz Kluska, 2025. "Energy Recovery from Municipal Biodegradable Waste in a Circular Economy," Energies, MDPI, vol. 18(9), pages 1-17, April.
    9. Gao, Datong & Zhao, Bin & Kwan, Trevor Hocksun & Hao, Yong & Pei, Gang, 2022. "The spatial and temporal mismatch phenomenon in solar space heating applications: status and solutions," Applied Energy, Elsevier, vol. 321(C).
    10. Stephan Schlüter & Fabian Menz & Milena Kojić & Petar Mitić & Aida Hanić, 2022. "A Novel Approach to Generate Hourly Photovoltaic Power Scenarios," Sustainability, MDPI, vol. 14(8), pages 1-16, April.
    11. Aleksandra Matuszewska-Janica & Dorota Żebrowska-Suchodolska & Urszula Ala-Karvia & Marta Hozer-Koćmiel, 2021. "Changes in Electricity Production from Renewable Energy Sources in the European Union Countries in 2005–2019," Energies, MDPI, vol. 14(19), pages 1-27, October.
    12. Amanda Balasooriya & Darshana Sedera, 2025. "Top Management Challenges in Using Artificial Intelligence for Sustainable Development Goals: An Exploratory Case Study of an Australian Agribusiness," Sustainability, MDPI, vol. 17(15), pages 1-19, July.
    13. Erik Heilmann & Janosch Henze & Heike Wetzel, 2021. "Machine learning in energy forecasts with an application to high frequency electricity consumption data," MAGKS Papers on Economics 202135, Philipps-Universität Marburg, Faculty of Business Administration and Economics, Department of Economics (Volkswirtschaftliche Abteilung).
    14. Edna S. Solano & Payman Dehghanian & Carolina M. Affonso, 2022. "Solar Radiation Forecasting Using Machine Learning and Ensemble Feature Selection," Energies, MDPI, vol. 15(19), pages 1-18, September.
    15. Szymon Firląg & Abdullah Sikander Baig & Dariusz Koc, 2025. "Historical Analysis of Real Energy Consumption and Indoor Conditions in Single-Family Passive Building," Sustainability, MDPI, vol. 17(2), pages 1-35, January.
    16. Ke Yan & Xudong Wang & Yang Du & Ning Jin & Haichao Huang & Hangxia Zhou, 2018. "Multi-Step Short-Term Power Consumption Forecasting with a Hybrid Deep Learning Strategy," Energies, MDPI, vol. 11(11), pages 1-15, November.
    17. Neethu Elizabeth Michael & Manohar Mishra & Shazia Hasan & Ahmed Al-Durra, 2022. "Short-Term Solar Power Predicting Model Based on Multi-Step CNN Stacked LSTM Technique," Energies, MDPI, vol. 15(6), pages 1-20, March.
    18. Ping-Huan Kuo & Chiou-Jye Huang, 2018. "A Green Energy Application in Energy Management Systems by an Artificial Intelligence-Based Solar Radiation Forecasting Model," Energies, MDPI, vol. 11(4), pages 1-15, April.
    19. Elsinga, Boudewijn & van Sark, Wilfried G.J.H.M., 2017. "Short-term peer-to-peer solar forecasting in a network of photovoltaic systems," Applied Energy, Elsevier, vol. 206(C), pages 1464-1483.
    20. Kanwal, S. & Khan, B. & Ali, S.M. & Mehmood, C.A., 2018. "Gaussian process regression based inertia emulation and reserve estimation for grid interfaced photovoltaic system," Renewable Energy, Elsevier, vol. 126(C), pages 865-875.

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jeners:v:18:y:2025:i:16:p:4403-:d:1727192. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.