Long-term Electricity Price Forecasting Using a Random Forest-based Machine Learning Approach

Authors

  • Jaya Shukla Research Scholar
  • Rajnish Bhasker

DOI:

https://doi.org/10.22399/ijcesen.3879

Keywords:

Electricity Price Forecasting, Time Series Analysis, Random Forest, MATLAB, Yearly Price Variation, RMSE

Abstract

Electricity price forecasting are important in optimizing energy trading, consumption scheduling, and operational planning within smart grid infrastructures. This study proposes a data-driven approach using a Random Forest (RF) regression model implemented in MATLAB for accurate electricity price prediction. Unlike conventional models, the RF model is evaluated under both open-loop and closed-loop forecasting scenarios to assess its short-term accuracy and long-term stability. The model is trained on time-series electricity pricing data enriched with lagged variables and temporal features, allowing it to learn from past behaviors and predict future price fluctuations. Open-loop forecasting utilizes actual historical values at each time step, enabling the model to demonstrate its pattern recognition capabilities with minimal cumulative error. Conversely, the closed-loop approach relies on recursive self-generated predictions to simulate real-world deployment, where future data is unavailable. Despite expected error propagation, the model maintains trend fidelity and captures peak patterns effectively across all three data channels. Performance evaluation using RMSE (0.534), MAE (~0.0276), and R² (~0.783) confirms the model’s accuracy, robustness, and generalization ability across multiple channels. Additionally, the consistent sensitivity score highlights the model’s responsiveness to price changes. The results underscore the RF model’s suitability for reliable electricity price forecasting, offering a balance between predictive accuracy and computational efficiency. This research supports the advancement of intelligent forecasting tools for dynamic electricity markets and reinforces the feasibility of integrating RF-based prediction systems in both academic research and industrial energy management applications.

 

References

[1] P. Wang, K. Xu, Z. Ding, Y. Du, W. Liu, B. Sun et al., "An online electricity market price forecasting method via random forest," IEEE Transactions on Industry Applications, vol. 58, no. 6, pp. 7013–7021, 2022.

[2] A. Ashraf, M. Rady, and S. Y. Mahfouz, "Price prediction of residential buildings using random forest and artificial neural network," HBRC Journal, vol. 20, no. 1, pp. 23–41, 2024.

[3] J. Wang, X. Sun, Q. Cheng, and Q. Cui, "An innovative random forest-based nonlinear ensemble paradigm of improved feature extraction and deep learning for carbon price forecasting," Science of the Total Environment, vol. 762, p. 143099, 2021.

[4] D. Li, Y. Li, and C. Ma, "Research on project cost prediction based on random forest algorithm," in Proc. 4th Int. Conf. Smart City Eng. Public Transp. (SCEPT 2024), SPIE, vol. 13160, pp. 152–157, May 2024.

[5] S. F. M. Alazawy, M. A. Ahmed, S. H. Raheem, H. Imran, L. F. A. Bernardo, and H. A. S. Pinto, "Explainable machine learning to predict the construction cost of power plant based on random forest and Shapley method," CivilEng, vol. 6, no. 2, pp. 21, 2025.

[6] V. Sessa, E. Assoumou, M. Bossy, and S. G. Simões, "Analyzing the applicability of random forest-based models for the forecast of run-of-river hydropower generation," Clean Technologies, vol. 3, no. 4, pp. 858–880, 2021.

[7] L. Qijie, Y. Zhifei, and J. Yuliang, "Cost analysis of power engineering based on improved random forest algorithm," in 2024 Int. Conf. Power, Electr. Eng., Electron. Control (PEEEC), pp. 1172–1177, IEEE, 2024

[8] G. F. Fan, M. Yu, S. Q. Dong, Y. H. Yeh, and W. C. Hong, "Forecasting short-term electricity load using hybrid support vector regression with grey catastrophe and random forest modeling," Utilities Policy, vol. 73, p. 101294, 2021.

[9] I. Khan, "Efficiency analysis and a random forest based trading strategy for heteroscedastic electricity market data," in 2022 IEEE Power & Energy Society General Meeting (PESGM), pp. 1–5, IEEE, July 2022.

[10] Z. Zheng, L. Zhou, H. Wu, and L. Zhou, "Construction cost prediction system based on random forest optimized by the Bird Swarm Algorithm," Mathematical Biosciences and Engineering, vol. 20, no. 8, pp. 15044–15074, 2023.

[11] G. F. Fan, L. Z. Zhang, M. Yu, W. C. Hong, and S. Q. Dong, "Applications of random forest in multivariable response surface for short-term load forecasting," International Journal of Electrical Power & Energy Systems, vol. 139, p. 108073, 2022..

[12] B. Han, H. Xiao, L. Yu, Z. Xu, W. Chen, and X. Sun, "Construction progress prediction of substation infrastructure project based on random forest," in 2023 18th Int. Conf. Intell. Syst. Knowl. Eng. (ISKE), pp. 324–330, IEEE, Nov. 2023.

[13] A. Tohry, S. C. Chelgani, S. S. Matin, and M. Noormohammadi, "Power-draw prediction by random forest based on operating parameters for an industrial ball mill," Advanced Powder Technology, vol. 31, no. 3, pp. 967–972, 2020.

[14] H. Zhai and J. Che, "Combining PSO-SVR and random forest based feature selection for day-ahead peak load forecasting," Engineering Letters, vol. 30, no. 1, 2022.

[15] K. Li, Y. Xing, H. Zhu, and W. Nai, "A short-term hybrid forecasting approach for regional electricity consumption based on grey theory and random forest," in 2020 5th Int. Conf. Comput. Intell. Appl. (ICCIA), pp. 194–198, IEEE, June 2020.

[16] Mei, J., He, D., Harley, R., Habetler, T., & Qu, G. (2014, July). A random forest method for real-time price forecasting in New York electricity market. In 2014 IEEE PES general meeting| conference & exposition (pp. 1-5). IEEE.

[17] Shirzadi, N., Nizami, A., Khazen, M., & Nik-Bakht, M. (2021). Medium-term regional electricity load forecasting through machine learning and deep learning. Designs, 5(2), 27.

[18] Li, C., Tao, Y., Ao, W., Yang, S., & Bai, Y. (2018). Improving forecasting accuracy of daily enterprise electricity consumption using a random forest based on ensemble empirical mode decomposition. Energy, 165, 1220-1227.

[19] Xu, K., Sun, B., Wang, P., Zhu, Z., & Tang, H. (2022, May). Electricity market price forecasting for a high renewable penetrated power system via random forest. In 2022 IEEE/IAS 58th Industrial and Commercial Power Systems Technical Conference (I&CPS) (pp. 1-7). IEEE.

[20] Hanif, M., Shahzad, M. K., Mehmood, V., & Saleem, I. (2023). EPFG: electricity price forecasting with enhanced Gans neural network. IETE Journal of Research, 69(9), 6473-6482.

Downloads

Published

2025-09-10

How to Cite

Shukla , J., & Bhasker , R. (2025). Long-term Electricity Price Forecasting Using a Random Forest-based Machine Learning Approach. International Journal of Computational and Experimental Science and Engineering, 11(3). https://doi.org/10.22399/ijcesen.3879

Issue

Section

Research Article