Daily Peak-Valley Electric-Load Forecasting Based on an SSA-LSTM-RF Algorithm
Abstract
:1. Introduction
2. Methods and Algorithms
2.1. Single Algorithm Description of SSA-LSTM-RF
2.1.1. Long-Term and Short-Term Memory Network (LSTM)
2.1.2. Sparrow Search Optimization Algorithm (SSA)
2.1.3. Random Forest Algorithm
2.2. Combined SSA-LSTM-RF Forecasting Algorithm
2.2.1. SSA-LSTM-RF Model Framework
- (1)
- Data process: Miss load data elimination, detect outlier data, process the data with wavelet smoothing and denoising, and select a time window of the load data.
- (2)
- Feature engineer: Create an alternative feature set of the load data and build a feature vector with influence factors.
- (3)
- Initialization: Initialize and train LSTM and determine the sparrow population size, the number of iterations, and the initial safety threshold based on the object to be optimized to initialize the SSA algorithm.
- (4)
- Fitness value: Determine the fitness value of each sparrow using the RMSE of the model forecasting value and sample data.
- (5)
- Update: Update the sparrow position, obtain the fitness value of the sparrow population, and save the optimal individual position and the global optimal position values in the population.
- (6)
- Iteration: Determine the iteration based on the loop conditions. If the conditions are met, exit the loop and return the individual optimal solution, which is the optimal parameter of the network structure. Otherwise, continue with step (5) of the loop.
- (7)
- Optimization result output: Assign values to the optimization object based on the optimal particles output by the SSA algorithm and use random forest optimal network parameters to classify and reconstruct the LSTM.
2.2.2. The SSA-LSTM Model Realizes Daily Peak and Valley Value Forecasting
2.2.3. RF-LSTM Realizes Peak and Valley Time Forecasting
- A.
- Peak forecasting
- B.
- Valley forecasting
2.3. Evaluation Indicators
3. Analysis and Results
3.1. Data Preprocessing
3.1.1. Handling Outlier Data
3.1.2. Filling in Missing Values
3.1.3. Data Processing by Type
3.2. Characteristic Engineering
3.2.1. Creating an Alternative Feature Set
- (1)
- Time series factors included the month, the day ordinal of a month, the hour, the day ordinal of a year, the week ordinal of a year, the working day, holidays, the time period ordinal (divided by 3 h), the season ordinal (converted into a unique code), the beginning of a month, the end of a month, etc.
- (2)
- Meteorological factors included the maximum temperature, the minimum temperature, the temperature difference, the wind force, illumination, precipitation, etc.
- (3)
- Trend factors (historical load data) included the maximum (minimum) load of the previous day and the maximum (minimum) load of the previous week.
3.2.2. Feature Selection
- (1)
- Linear correlation analysis: Pearson correlation coefficient
- (2)
- Nonlinear correlation analysis: random forest
- (1)
- Peak value forecasting: The difference between the charge peaks and valleys of the previous day, the maximum temperature, the minimum temperature, the season, the light, the precipitation, the weekend/workday/holiday time point, the peak value of the previous day, the peak value of the previous 2 days, the peak value of the previous 5 days, the peak value of the previous 6 days, the peak value of the previous 7 days, and the peak value of the previous 30 days.
- (2)
- Valley value forecasting: The difference between the charge peaks and valleys of the previous day, the maximum temperature, the minimum temperature, the season, the valley value of the previous day, the valley value of the previous 2 days, the valley value of the previous 3 days, the valley value of the previous 7 days, and the valley value of the previous 30 days.
- (3)
- Forecasting of peak time: The forecasted peak, the maximum temperature, the minimum temperature, the light, the precipitation, whether it was a holiday, the season, the time point of the first day, the time point of the first 2 days, the time point of the first 5 days, the time point of the first 6 days, the time point of the first 7 days, and the time point of the first 30 days.
- (4)
- Forecasting of valley time: The time point of the first day, the time point of the first 2 days, the time point of the first 5 days, the time point of the first 6 days, the time point of the first 7 days, and the time point of the first 30 days.
3.3. Data Process Results of the SSA-LSTM-RF Algorithm
- (1)
- The number of neurons in the hidden layer of LSTM, included first hidden nodes L1, the second hidden nodes L2, the iterations number iter, and the learning rate lr were taken as the optimization objects, and constructed the parameter optimization range.
- (2)
- The individual fitness of sparrows was determined, and MSE was regarded as the fitness-evaluation function, which was the fitness curve value of the SSA algorithm.
- (3)
- The position information of sparrow individuals was calculated and updated to obtain fitness values. If the result was the global optimal fitness, then the optimal fitness in the current sparrow population of the individual position was saved; if not, update sparrow position was updated.
- (4)
- It was determined whether the number of iterations reached the upper limit. If so, the optimization process was exited and the returned optimal solution was saved. Otherwise, loop 3 was continued.
- (5)
- The optimized L1, L2, iter, and lr were substituted into the LSTM model with a random number.
- (6)
- The optimized model was used for forecasting.
3.4. Forecast Results of Minimum and Maximum Daily Loads
3.5. Forecast Results of Daily Load with Different Algorithms and Steps
3.6. Forecast Evaluation of Minimum and Maximum Daily Load in the Future
3.7. Forecast Evaluation of Minimum and Maximum Daily Load in Great Industry
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Nomenclature
LSTM | Long short-term memory |
SSA | Sparrow search algorithm |
RF | Random forest |
PSO | Particle swarm optimization |
MAE | Mean absolute error |
MAPE | Mean absolute percentage error |
MSE | Mean squared error |
RMSE | Root mean squared error |
R2 | Coefficient of determination |
References
- Erol-Kantarci, M.; Mouftah, H.T. Energy-efficient information and communication infrastructures in the smart grid: A survey on interactions and open issues. IEEE Commun. Surv. Tutor. 2015, 17, 179–197. [Google Scholar] [CrossRef]
- Boroojeni, K.G.; Amini, M.H.; Bahrami, S.; Iyengar, S.S.; Sarwat, A.I.; Karabasoglu, O. A novel multi-time-scale modeling for electric power demand forecasting: From short-term to medium-term horizon. Electr. Power Syst. Res. 2017, 142, 58–73. [Google Scholar] [CrossRef]
- Hong, T.; Fan, S. Probabilistic electric load forecasting: A tutorial review. Int. J. Forecast. 2016, 32, 914–938. [Google Scholar] [CrossRef]
- 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]
- Gupta, V. An overview of different types of load forecasting methods and the factors affecting the load forecasting. Int. J. Res. Appl. Sci. Eng. Technol. 2017, 4, 729–733. [Google Scholar] [CrossRef]
- Yildiz, J.; Bilbao, I.; Sproul, A.B. A review and analysis of regression and machine learning models on commercial building electricity load forecasting. Renew. Sustain. Energy Rev. 2017, 73, 1104–1122. [Google Scholar] [CrossRef]
- Hippert, H.S.; Pedreira, C.E.; Souza, R.C. Neural networks for short-term load forecasting: A review and evaluation. IEEE Trans. Power Syst. 2001, 16, 44–55. [Google Scholar] [CrossRef]
- Singh, P.; Dwivedi, P. Integration of new evolutionary approach with artificial neural network for solving short term load forecast problem. Appl. Energy 2018, 217, 537–549. [Google Scholar] [CrossRef]
- Moon, J.; Park, J.; Hwang, E.; Jun, S. Forecasting power consumption for higher educational institutions based on machine learning. J. Supercomput. 2018, 74, 3778–3800. [Google Scholar] [CrossRef]
- Song, K.B.; Baek, Y.S.; Hong, D.H.; Jiang, G. Short-term load forecasting for the holidays using fuzzy linear regression algorithm. IEEE Trans. Power Syst. 2005, 20, 96–101. [Google Scholar] [CrossRef]
- Ceperic, E.; Ceperic, V.; Baric, A. A strategy for short-term load forecasting by support vector regression machines. IEEE Trans. Power Syst. 2013, 28, 4356–4364. [Google Scholar] [CrossRef]
- Wang, R.; Zhang, S.; Xiao, X.; Wang, Y. Short-term Load Forecasting of Multi-layer Long Short-term Memory Neural Network Considering Temperature Fuzziness. Electr. Power Autom. Equip. 2020, 40, 181–186. [Google Scholar]
- Lahouar, A.; Slama, J.B.H. Day-ahead load forecast using random forest and expert input selection. Energy Convers. Manag. 2015, 103, 1040–1051. [Google Scholar] [CrossRef]
- Abdoos, A.; Hemmati, M.; Abdoos, A.A. Short term load forecasting using a hybrid intelligent method. Knowl. Based Syst. 2015, 76, 139–147. [Google Scholar] [CrossRef]
- Dong, J.-R.; Zheng, C.-Y.; Kan, G.-Y.; Zhao, M.; Wen, J.; Yu, J. Applying the ensemble artificial neural network-based hybrid data-driven model to daily total load forecasting. Neural Comput. Appl. 2015, 26, 603–611. [Google Scholar] [CrossRef]
- Cecati, C.; Kolbusz, J.; Różycki, P.; Siano, P.; Wilamowski, B.M. A novel RBF training algorithm for short-term electric load forecasting and comparative studies. IEEE Trans. Ind. Electron. 2015, 10, 6519–6529. [Google Scholar] [CrossRef]
- Rutkowski, L.; Jaworski, M.; Pietruczuk, L.; Duda, P. The CART decision tree for mining data streams. Inf. Sci. 2014, 266, 1–15. [Google Scholar] [CrossRef]
- Han, M.; Tan, A.; Zhong, J. Application of Particle Swarm Optimization Combined with Long and Short-term Memory Networks for Short-term Load Forecasting. In Proceedings of the 2021 International Conference on Robotics Automation and Intelligent Control (ICRAIC 2021), Wuhan, China, 26–28 November 2021. [Google Scholar]
- Zhao, B.; Wang, Z.; Ji, W.; Gao, X.; Li, X. A Short-term power load forecasting Algorithm Based on Attention Mechanism of CNN-GRU. Power Syst. Technol. 2019, 43, 4370–4376. [Google Scholar]
- Lu, J.; Zhang, Q.; Yang, Z.; Tu, M.; Lu, J.; Peng, H. Short-term Load Forecasting Algorithm Based on CNN-LSTM Hybrid Neural Network Model. Autom. Electr. Power Syst. 2019, 43, 131–137. [Google Scholar]
- Xue, J. Research and Application of a Novel Swarm Intelligence Optimization Technique: Sparrow Search Algorithm. Master’s Thesis, Donghua University, Shanghai, China, 2020. [Google Scholar]
- Mao, Q.; Zhang, Q. Improved Sparrow Algorithm Combining Cauchy Mutation and Opposition-based Learning. J. Front. Comput. Sci. Technol. 2021, 15, 1155–1164. [Google Scholar]
- Zhu, J.; Liu, S.; Fan, N.; Shen, X.; Guo, X. A Short-term power load forecasting Algorithm Based on LSTM Neural Network. China New Telecommun. 2021, 23, 167–168. [Google Scholar]
- Tan, M.; Yuan, S.; Li, S.; Su, Y.; Li, H.; He, F. Ultra-short-term industrial power demand forecasting using LSTM based hybrid ensemble learning. IEEE Trans. Power Syst. 2019, 35, 2937–2948. [Google Scholar] [CrossRef]
- Tian, H.; Zhang, Z.; Yu, D. Research on Multi-load Short-term Forecasting of Regional Integrated Energy System Based on Improved LSTM. Proc. CSU-EPSA 2021, 33, 130–137. [Google Scholar]
- Qing, X.; Niu, Y. Hourly day-ahead solar irradiance prediction using weather forecasts by LSTM. Energy 2018, 148, 461–468. [Google Scholar] [CrossRef]
- Zhang, J. Research and Analysis of Short-term Load Forecasting Based on Adaptive K-means and DNN. Electron. Meas. Technol. 2020, 43, 58–61. [Google Scholar]
- Liu, B. Research of Short-Term Power load Forecasting Based on PSO-LSTM Algorithm. Master’s Thesis, Jilin University, Changchun, China, 2020. [Google Scholar]
- Liu, K.; Ruan, J.; Zhao, X.; Liu, G. Short-term Load Forecasting Algorithm Based on Sparrow Search Optimized Attention-GRU. Proc. CSU-EPSA 2022, 34, 1–9. [Google Scholar]
- Huang, Z.; Huang, J.; Min, J. SSA-LSTM: Short-Term Photovoltaic Power Prediction Based on Feature Matching. Energies 2022, 15, 7806. [Google Scholar] [CrossRef]
- Yang, H.; Zhang, Q. An Adaptive Chaos Immune Optimization Algorithm with Mutative Scale and Its Application. Control Theory Appl. 2009, 26, 1069–1074. [Google Scholar]
- Liu, J.; Yuan, M.; Zuo, F. Global Search-oriented Adaptive Leader Salp Swarm Algorithm. Control Decis 2021, 36, 2152–2160. [Google Scholar]
- Han, M.; Zhong, J.; Sang, P.; Liao, H.; Tan, A. A Combined Model Incorporating Improved SSA and LSTM Algorithms for Short-Term Load Forecasting. Electronics 2022, 11, 1835. [Google Scholar] [CrossRef]
- Kong, W.; Dong, Z.Y.; Jia, Y.; Hill, D.J.; Xu, Y.; Zhang, Y. Short-term residential load forecasting based on LSTM recurrent neural network. IEEE Trans. Smart Grid. 2017, 10, 841–851. [Google Scholar] [CrossRef]
- Wang, S.; Wang, X.; Wang, S.; Wang, D. Bi-directional long short-term memory method based on attention mechanism and rolling update for short-term load forecasting. Int. J. Electr. Power Energy Syst. 2019, 109, 470–479. [Google Scholar] [CrossRef]
- Raza, M.Q.; Mithulananthan, N.; Li, J.; Lee, K.Y. Multivariate ensemble forecast framework for demand forecasting of anomalous days. IEEE Trans. Sustain. Energy 2018, 11, 27–36. [Google Scholar] [CrossRef]
- Liu, H.; Mi, X.; Li, Y. Smart multi-step deep learning model for wind speed forecasting based on variational mode decomposition, singular spectrum analysis, LSTM network and ELM. Energy Convers. Manag. 2018, 8, 54–64. [Google Scholar] [CrossRef]
- Kim, S.; Ko, B.C. Building deep random ferns without backpropagation. IEEE Access 2020, 8, 8533–8542. [Google Scholar] [CrossRef]
- Oshiro, T.M.; Perez, P.S.; Baranauskas, J.A. How many trees in a random forest? In Proceedings of the International Conference on Machine Learning and Data Mining in Pattern Recognition, Berlin, Germany, 13–20 July 2012; Volume 1, pp. 154–168. [Google Scholar]
- Cheng, J.; Zhang, N.; Wang, Y.; Kang, C.; Zhu, W.; Luo, M.; Que, H. Evaluating the spatial correlations of multi-area load forecasting errors. In Proceedings of the 2016 International Conference on Probabilistic Methods Applied to Power Systems (PMAPS), Beijing, China, 16–20 October 2016; Volume 1, pp. 1–6. [Google Scholar]
- Al Mamun, A.; Sohel, M.; Mohammad, N.; Sunny, M.S.H.; Dipta, D.R.; Hossain, E. A comprehensive review of the load forecasting techniques using single and hybrid forecastive models. IEEE Access 2020, 8, 134911–134939. [Google Scholar] [CrossRef]
- Kong, X.; Zheng, F.; Zhijun, E.; Cao, J.; Wang, X. Short-term Load Forecasting Based on Deep Belief Network. Autom. Electr. Power Syst. 2018, 42, 133–139. [Google Scholar]
Hyperparameters | Value |
---|---|
L1 | 270 |
L2 | 383 |
iter | 175 |
lr | 0.0060 |
Type | IMAPE | IRMSE | IMAE |
---|---|---|---|
Daily minimum load test | 0.07398 | 17.0495 | 11.9473 |
Daily maximum load test | 0.02889 | 10.3133 | 6.9687 |
Model | IMAE | IRMSE | IR2 |
---|---|---|---|
LSTM | 6.5170 | 7.2762 | 0.874 |
RF-BP | 8.1534 | 10.2251 | 0.812 |
RF-LSTM | 4.9633 | 6.0156 | 0.903 |
RF-PSO-LSTM | 3.1224 | 3.9218 | 0.945 |
RF-SSA-LSTM | 2.8122 | 3.4574 | 0.988 |
Days | IMAE | IRMSE | IR2 |
---|---|---|---|
60 | 2.8122 | 3.4574 | 0.988 |
120 | 5.9842 | 6.8036 | 0.925 |
180 | 8.6243 | 9.4825 | 0.873 |
240 | 12.7084 | 14.0486 | 0.762 |
300 | 19.3338 | 21.2838 | 0.605 |
IMAE | IRMSE | IR2 | |||||||
---|---|---|---|---|---|---|---|---|---|
Days | RF-SSA-LSTM | RF-PSO-LSTM | RF-LSTM | RF-SSA-LSTM | RF-PSO-LSTM | RF-LSTM | RF-SSA-LSTM | RF-PSO-LSTM | RF-LSTM |
60 | 2.8122 | 3.1224 | 4.9633 | 3.4574 | 3.9218 | 6.0156 | 0.988 | 0.945 | 0.903 |
120 | 5.9842 | 6.3487 | 7.8911 | 6.8036 | 7.5406 | 8.8230 | 0.925 | 0.901 | 0.880 |
180 | 8.6243 | 9.7812 | 11.1254 | 9.4825 | 11.7121 | 13.1145 | 0.873 | 0.827 | 0.771 |
240 | 12.7084 | 14.7510 | 17.6821 | 14.0486 | 16.5261 | 20.1820 | 0.762 | 0.696 | 0.613 |
300 | 19.3338 | 22.9527 | 27.3310 | 21.2838 | 23.5617 | 28.0108 | 0.605 | 0.512 | 0.458 |
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
Wang, Y.; Sun, S.; Cai, Z. Daily Peak-Valley Electric-Load Forecasting Based on an SSA-LSTM-RF Algorithm. Energies 2023, 16, 7964. https://doi.org/10.3390/en16247964
Wang Y, Sun S, Cai Z. Daily Peak-Valley Electric-Load Forecasting Based on an SSA-LSTM-RF Algorithm. Energies. 2023; 16(24):7964. https://doi.org/10.3390/en16247964
Chicago/Turabian StyleWang, Yaoying, Shudong Sun, and Zhiqiang Cai. 2023. "Daily Peak-Valley Electric-Load Forecasting Based on an SSA-LSTM-RF Algorithm" Energies 16, no. 24: 7964. https://doi.org/10.3390/en16247964
APA StyleWang, Y., Sun, S., & Cai, Z. (2023). Daily Peak-Valley Electric-Load Forecasting Based on an SSA-LSTM-RF Algorithm. Energies, 16(24), 7964. https://doi.org/10.3390/en16247964