Short-Term Electricity Price Forecasting Based on BP Neural Network Optimized by SAPSO
Abstract
:1. Introduction
2. Feature Selection
- Market supply and demand index (SDI). System load demand generally has a direct impact on the price of electricity; usually, the greater the electricity consumption, the higher the price of electricity. At the same time, the electricity supplied by the system also affects the price of electricity. Generally, the more the maximum available capacity of the system is, the lower the price of electricity is. Therefore, it’s not reasonable to think about demand and supply alone, but to put them together and use SDI as the impact factor. The specific calculation formula is as follows:
- Previous system marginal electricity price (SMP). Because the bidding mode in the system does not change greatly in a short time, the previous SMP can be used as a strong influence factor in the short-term electricity price forecast;
- The installed capacity ratio, that is, the proportion of the installed capacity of the power plant in the total system capacity; generally speaking, the larger the proportion, the greater the influence of the power generation company on the quotation;
- System reserve demand and reactive power demand are also one of the factors that affect the system electricity price.
3. Methods
3.1. Improved Particle Swarm Optimization Algorithm
3.1.1. SAPSO Algorithm
3.1.2. Function Testing
- Sphere function:
- Rastrigin function:
- Ackley function:
3.2. BP Neutral Network Optimization Based on SAPSO
- Initialize the BP neural network parameters, including network structure, number of neurons at each layer and transmission function. Set particle swarm parameters, including population size, particle dimension, maximum number of iterations, inertia weight and learning factor;
- Initialize the population position and speed. The initial position of particles is randomly set within the value range of weight and threshold of the BP network;
- Calculate the fitness value of each particle. The particle position is assigned to the neural network as the weights and thresholds, the model is used to calculate the sample prediction error of the training set and the particle fitness value is calculated according to Formula (14);
- Determine individual and global extrema. The initial individual extremum is the adaptive value of each particle, the best one of which is called the global extremum.
- The optimal position of each individual is given a jump probability, which is calculated according to Equation (8). According to the probability, an individual optimal position is randomly selected to replace the global optimal position in the speed update formula;
- Judge whether the maximum number of iterations has been reached. If so, proceed to step 7. Otherwise, anneal, update the speed and position of the particles and then go to step 3 to continue the cycle;
- The optimal position of particles is taken as the initial weights and thresholds of the BP neural network;
- Train the BP network and output results.
4. Results
4.1. Algorithm Parameter Setting
4.2. Evaluating Indicator
4.3. Results Analysis
5. Conclusions
- (1)
- The electricity price has great randomness and uncertainty and there are many factors affecting electricity price fluctuation. By analyzing the main factors affecting electricity price, MIC and Pearson correlation analysis were used to determine the supply and demand indexes, early system marginal electricity price, system reserve rate and installed capacity as the input factors of the electricity price prediction model.
- (2)
- The combination of the SA algorithm can enhance the ability of PSO to jump out of the local optimal value and avoid the occurrence of the premature phenomenon. The linearly increased inertia weight was used to improve the disadvantage of the decline of the later convergence speed of PSO and to improve the convergence speed of the algorithm. The results show that the improved algorithm has better performance.
- (3)
- The BP neural network was optimized by the improved particle swarm optimization algorithm and the SAPSO-BP electricity price prediction model was established to improve the accuracy of BP network electricity price prediction. According to the number of hidden layer neurons of networks, nine models, namely, BP-3N, BP-9N, BP-15N, PSO-BP-3N, PSO-BP-9N, PSO-BP-15N, SAPSO-BP-3N, SAPSO-BP-9N and SAPSO-BP-15N, were established to compare the prediction results of the BP, PSO-BP and SAPSO-BP algorithms, respectively, under different network structures. From the evaluation indexes and prediction comparison diagrams, the SAPSO-BP model has high efficiency and accuracy in electricity price prediction, while the number of neurons in the hidden layer has little effect on the prediction results, but it is easy to over fit if there are too many neurons.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Han, S.H.; Hu, F.H.; Cheng, Z.T. Day ahead market marginal price forecasting based on GCN-LSTM. Chin. J. Electr. Eng. 2021, 8, 1–22. [Google Scholar]
- Jia, X.F.; Li, C.B. Research on real-time price forecasting of deep ESN power market considering short-term load. Smart Power 2021, 49, 64–70. [Google Scholar]
- Cerjan, M.; Petričić, A.; Delimar, M. HIRA Model for Short-Term Electricity Price Forecasting. Energies 2019, 12, 568. [Google Scholar] [CrossRef] [Green Version]
- Chen, Y.Y.; Wang, Y.F.; Ma, J.H.; Jin, Q. BRIM: An Accurate Electricity Spot Price Prediction Scheme-Based Bidirectional Recurrent Neural Network and Integrated Market. Energies 2019, 12, 2241. [Google Scholar] [CrossRef] [Green Version]
- Li, Y.C. Electricity price forecasting in power market based on convolutional neural network. Mech. Des. Manuf. Eng. 2021, 50, 101–104. [Google Scholar]
- Marin, C.; Marin, M.; Marko, D. Dynamic Hybrid Model for Short-Term Electricity Price Forecasting. Energies 2014, 7, 3304–3318. [Google Scholar] [CrossRef]
- Zhou, D.M.; Lai, F.; Liu, Y.A.; Wang, Q.; Liu, Y.G. Load forecasting and price forecasting of power system. Power Syst. Prot. Control 2000, 10, 31–33. [Google Scholar]
- Dong, H.Y.; Wang, R.J.; Gu, Y.Q. Life prediction of wind turbine bearing based on Auto-regressive summation moving average model. Syst. Simul. Technol. 2017, 13, 185–189. [Google Scholar]
- Zhang, X.M. Theoretical research on forecasting online clearing price modeling based on multiple linear regression algorithm. Guangdong Electr. Power 2006, 9, 1–4. [Google Scholar]
- Nogales, F.J.; Contreras, J.; Conejo, A.J.; Espinola, R. Forecasting Next-Day Electricity Prices by Time Series Models. IEEE Trans. Power Syst. 2002, 17, 342–348. [Google Scholar] [CrossRef]
- Tan, Z.F.; Zhang, J.L. Day-ahead electricity price forecasting based on multi-factor wavelet analysis and multivariate time series models. Proc. Chin. Soc. Electr. Eng. 2010, 30, 103–110. [Google Scholar]
- Zhang, Y.H.; Zhu, G.R.; Cai, Y.Z.; Zhu, Y.Q. Day ahead electricity price forecasting based on Autoregressive integral moving average model. Autom. Technol. Appl. 2020, 39, 125–129, 139. [Google Scholar]
- Yang, L.; Wu, Y.L.; Zhang, C.; Liu, C.; Jiang, B.; Zhang, P. Improved least squares support vector algorithm for electrical quantity prediction. Power Grid Clean Energy 2017, 33, 71–76. [Google Scholar]
- Wei, Q.; Chen, S.J.; Huang, W.B.; Ma, G.W.; Tao, C.H. Spot market clearing price forecasting method based on Stochastic Forest regression. Chin. J. Electr. Eng. 2021, 41, 1360–1367. [Google Scholar]
- Chen, J.Y.; Tao, C.H.; Ma, G.W.; Chen, S.J.; Zhao, Y.L.; Wang, J. Spot market clearing price prediction method based on data mining and support vector machine. Power Grid Clean Energy 2020, 36, 14–19, 27. [Google Scholar]
- Zhang, R.; Li, G.; Ma, Z. A Deep Learning based Hybrid Framework for Day-ahead Electricity Price Forecasting. IEEE Access 2020, 99, 1. [Google Scholar] [CrossRef]
- Li, W.Y. Research on Electricity Price Forecasting in Power Market Based on Deep Learning. Master’s Thesis, Shandong University of Science and Technology, Shandong, China, 2020. [Google Scholar]
- Gou, X.; Xiao, X.Y. Short term electricity price forecasting model based on empirical mode decomposition and LSTM neural network. J. Xi’an Univ. Technol. 2020, 36, 129–134. [Google Scholar]
- Liu, D.; Lei, Z.Q.; Sun, K. Short term electricity price forecasting based on wavelet packet decomposition and short-term memory network. Smart Power 2020, 48, 77–83. [Google Scholar]
- Dong, Z.K. Short Term Transaction Price Forecasting Based on Deep Learning Algorithm. Master’s Thesis, South China University of Technology, Guangdong, China, 2020. [Google Scholar]
- Xu, R.N.; Tao, Z.Q.; Zhang, Z.K. Research on traffic accident prediction model based on artificial neural network. Technol. Econ. Guide 2021, 29, 32–33. [Google Scholar]
- Espín-Sarzosa, D.; Palma-Behnke, R.; Valencia, F. Modeling of Small Productive Processes for the Operation of a Microgrid. Energies 2021, 14, 4162. [Google Scholar] [CrossRef]
- Pawlik, P.; Kania, K.; Przysucha, B. The Use of Deep Learning Methods in Diagnosing Rotating Machines Operating in Variable Conditions. Energies 2021, 14, 4231. [Google Scholar] [CrossRef]
- Stratigakos, A.; Bachoumis, A.; Vita, V.; Zafiropoulos, E. Short-Term Net Load Forecasting with Singular Spectrum Analysis and LSTM Neural Networks. Energies 2021, 14, 4107. [Google Scholar] [CrossRef]
- Jumilla-Corral, A.A.; PerezTello, C.; CampbellRamírez, H.E.; MedranoHurtado, Z.Y.; MayorgaOrtiz, P.; Avitia, R.L. Modeling of Harmonic Current in Electrical Grids with Photovoltaic Power Integration Using a Nonlinear Autoregressive with External Input Neural Networks. Energies 2021, 14, 4015. [Google Scholar] [CrossRef]
- Guo, X.X. Combined forecasting of short term electricity price based on EEMD and wavelet neural network. J. Chongqing Bus. Univ. 2016, 33, 21–25. [Google Scholar]
- Yamin, H.Y.; Shahidehpour, S.M.; Li, Z. Adaptive short-term electricity price forecasting using artificial neural networks in the restructured power markets. Int. J. Electr. Power Energy Syst. 2004, 26, 571–581. [Google Scholar] [CrossRef]
- Wang, W.; Feng, J.; Xu, F. Estimating Downward Shortwave Solar Radiation on Clear-Sky Days in Heterogeneous Surface Using LM-BP Neural Network. Energies 2021, 14, 273. [Google Scholar] [CrossRef]
- Wan, L.J.; Li, H.Y.; Chen, Y.W.; Li, C.Y. Rolling Bearing Fault Prediction Method Based on QPSO-BP Neural Network and Dempster-Shafer Evidence Theory. Energies 2020, 13, 1094. [Google Scholar] [CrossRef]
- Han, W.; Nan, L.B.; Su, M.; Chen, Y.; Li, R.N.; Zhang, X.J. Research on the Prediction Method of Centrifugal Pump Performance Based on a Double Hidden Layer BP Neural Network. Energies 2019, 12, 2709. [Google Scholar] [CrossRef] [Green Version]
- Liu, H.L.; Li, T.; Zhang, Q.H. Prediction of Sticking Accident Based on Improved BP neural network based on adaptive genetic algorithm. Mod. Electron. Technol. 2021, 44, 149–153. [Google Scholar]
- Shang, F.H.; Li, J.C.; Yuan, Y.; Cao, M.J.; Du, R.S. Stratigraphic division method based on Improved BP neural network. Comput. Technol. Dev. 2020, 30, 148–153. [Google Scholar]
- Guo, Y. Research on Clothing Pressure Prediction Based on Improved BP Neural Network. Master’s Thesis, Xi’an University of Science and Technology, Xi’an, China, 2020. [Google Scholar]
- Huang, G.Q.; Yang, J.J. Short term electricity price forecasting based on BP neural network and Markov chain. J. Shanghai Electr. Power Univ. 2017, 33, 1–3. [Google Scholar]
- Chen, Z.Y.; Rui, X.; Wang, K.Y.; Bin, J. Optimal Energy Management Strategy of a Plug-in Hybrid Electric Vehicle Based on a Particle Swarm Optimization Algorithm. Energies 2015, 8, 3661–3678. [Google Scholar] [CrossRef] [Green Version]
- Kiani, A.T.; Nadeem, M.F.; Ahmed, A.; Khan, I.A.; Alkhammash, H.I.; Sajjad, I.A.; Hussain, B. An Improved Particle Swarm Optimization with Chaotic Inertia Weight and Acceleration Coefficients for Optimal Extraction of PV Models Parameters. Energies 2021, 14, 2980. [Google Scholar] [CrossRef]
- Wu, T.Z.; Shi, X.; Liao, L.; Zhou, C.J.; Zhou, H.; Su, Y.H. A Capacity Configuration Control Strategy to Alleviate Power Fluctuation of Hybrid Energy Storage System Based on Improved Particle Swarm Optimization. Energies 2019, 12, 642. [Google Scholar] [CrossRef] [Green Version]
- Zhang, X.; Wang, X.F. Summary of short term electricity price forecasting. Power Syst. Autom. 2006, 3, 92–101. [Google Scholar]
- Ma, C. Study on Short Term Optimal Operation and Bidding Strategy of Cascade Hydropower Stations. Ph.D. Thesis, Tianjin University, Tianjing, China, 2005. [Google Scholar]
Influence Factors | MIC | Pearson |
---|---|---|
SDI | 0.6865 | 0.664 |
Previous SMP | 0.7273 | 0.791 |
System reserve rate | 0.5257 | 0.151 |
Installed capacity | 0.5155 | 0.151 |
Test Function | Algorithm | Average Value | Standard Deviation |
---|---|---|---|
Sphere | PSO | 1.44 × 10−8 | 8.40 × 10−9 |
SAPSO | 1.10 × 10−9 | 2.08 × 10−9 | |
Rastrigrin | PSO | 2.38 × 10 | 1.78 × 10 |
SAPSO | 1.98 × 100 | 2.77 × 10−1 | |
Ackley | PSO | 1.21 × 100 | 2.92 × 10−1 |
SAPSO | 1.30 × 10−8 | 1.79 × 10−8 |
Actual Electricity Price (CNY) | Hidden Layer 3 Neurons | Hidden Layer 9 Neurons | Hidden Layer 15 Neurons | |||
---|---|---|---|---|---|---|
Predictive Value (CNY) | Error | Predictive Value (CNY) | Error | Predictive Value (CNY) | Error | |
0.37 | 0.314 | 15.24% | 0.352 | 4.93% | 0.227 | 38.76% |
0.158 | 0.295 | 86.73% | 0.165 | 4.51% | 0.235 | 48.89% |
0.471 | 0.345 | 26.84% | 0.466 | 1.14% | 0.479 | 1.60% |
0.187 | 0.170 | 8.87% | 0.226 | 21.05% | 0.135 | 27.92% |
0.179 | 0.295 | 64.82% | 0.188 | 4.95% | 0.281 | 57.19% |
0.22 | 0.290 | 32.04% | 0.266 | 21.00% | 0.280 | 27.15% |
0.13 | 0.148 | 13.98% | 0.147 | 13.11% | −0.052 | 140.21% |
0.148 | 0.124 | 16.26% | 0.019 | 87.29% | 0.183 | 23.76% |
0.314 | 0.294 | 6.47% | 0.238 | 24.24% | 0.403 | 28.39% |
0.222 | 0.281 | 26.56% | 0.000 | 100.13% | 0.397 | 78.88% |
0.362 | 0.275 | 24.15% | 0.129 | 64.32% | 0.327 | 9.80% |
0.132 | 0.010 | 92.06% | 0.004 | 96.85% | 0.215 | 63.00% |
0.408 | 0.251 | 38.53% | 0.262 | 35.80% | 0.403 | 1.28% |
0.142 | 0.117 | 17.33% | 0.114 | 19.58% | 0.132 | 6.92% |
0.391 | 0.426 | 8.88% | 0.382 | 2.37% | 0.399 | 2.09% |
0.505 | 0.412 | 18.50% | 0.410 | 18.74% | 0.582 | 15.21% |
0.197 | 0.345 | 74.92% | 0.231 | 17.41% | 0.289 | 46.46% |
0.192 | 0.285 | 48.60% | 0.229 | 19.48% | 0.196 | 2.10% |
0.163 | 0.182 | 11.58% | 0.209 | 27.97% | 0.228 | 39.67% |
0.144 | 0.281 | 95.20% | 0.150 | 4.35% | 0.108 | 24.93% |
0.139 | 0.181 | 30.23% | 0.172 | 23.60% | −0.073 | 152.59% |
0.229 | 0.345 | 50.62% | 0.309 | 34.76% | 0.168 | 26.71% |
0.133 | 0.128 | 3.57% | 0.145 | 8.83% | 0.079 | 40.60% |
0.14 | 0.128 | 8.60% | 0.111 | 20.73% | 0.109 | 22.38% |
0.339 | 0.344 | 1.56% | 0.270 | 20.28% | 0.419 | 23.48% |
Actual Electricity Price (CNY) | Hidden Layer 3 Neurons | Hidden Layer 9 Neurons | Hidden Layer 15 Neurons | |||
---|---|---|---|---|---|---|
Predictive Value (CNY) | Error | Predictive Value (CNY) | Error | Predictive Value (CNY) | Error | |
0.37 | 0.285 | 23.09% | 0.246 | 33.54% | 0.237 | 35.97% |
0.158 | 0.214 | 35.39% | 0.026 | 83.33% | 0.155 | 1.81% |
0.471 | 0.381 | 19.02% | 0.469 | 0.45% | 0.432 | 8.19% |
0.187 | 0.209 | 11.92% | 0.189 | 1.13% | 0.190 | 1.39% |
0.179 | 0.231 | 29.06% | 0.061 | 66.18% | 0.164 | 8.11% |
0.22 | 0.267 | 21.47% | 0.162 | 26.53% | 0.190 | 13.86% |
0.13 | 0.199 | 53.09% | 0.112 | 14.09% | 0.154 | 18.47% |
0.148 | 0.205 | 38.33% | 0.153 | 3.40% | 0.125 | 15.39% |
0.314 | 0.337 | 7.37% | 0.316 | 0.49% | 0.344 | 9.49% |
0.222 | 0.242 | 9.13% | 0.225 | 1.31% | 0.251 | 13.10% |
0.362 | 0.211 | 41.62% | 0.104 | 71.35% | 0.073 | 79.72% |
0.132 | 0.199 | 51.09% | 0.144 | 9.37% | 0.132 | 0.11% |
0.408 | 0.235 | 42.36% | 0.394 | 3.35% | 0.363 | 10.97% |
0.142 | 0.200 | 40.91% | 0.167 | 17.32% | 0.183 | 28.70% |
0.391 | 0.417 | 6.66% | 0.390 | 0.19% | 0.388 | 0.67% |
0.505 | 0.483 | 4.42% | 0.520 | 2.96% | 0.567 | 12.26% |
0.197 | 0.249 | 26.27% | 0.314 | 59.15% | 0.312 | 58.53% |
0.192 | 0.234 | 21.90% | 0.096 | 49.81% | 0.132 | 31.07% |
0.163 | 0.201 | 23.58% | 0.171 | 4.90% | 0.143 | 12.58% |
0.144 | 0.205 | 42.25% | 0.050 | 65.50% | 0.099 | 31.10% |
0.139 | 0.200 | 43.59% | 0.118 | 15.10% | 0.160 | 15.27% |
0.229 | 0.247 | 7.97% | 0.204 | 10.95% | 0.225 | 1.74% |
0.133 | 0.200 | 50.39% | 0.136 | 2.26% | 0.144 | 7.91% |
0.14 | 0.200 | 43.14% | 0.138 | 1.51% | 0.136 | 2.65% |
0.339 | 0.295 | 13.13% | 0.333 | 1.63% | 0.314 | 7.37% |
Actual Electricity Price (CNY) | Hidden Layer 3 Neurons | Hidden Layer 9 Neurons | Hidden Layer 15 Neurons | |||
---|---|---|---|---|---|---|
Predictive Value (CNY) | Error | Predictive Value (CNY) | Error | Predictive Value (CNY) | Error | |
0.37 | 0.259 | 29.91% | 0.250 | 32.54% | 0.247 | 33.22% |
0.158 | 0.152 | 3.66% | 0.156 | 1.38% | 0.165 | 4.12% |
0.471 | 0.474 | 0.54% | 0.470 | 0.29% | 0.452 | 4.06% |
0.187 | 0.183 | 1.97% | 0.189 | 0.86% | 0.188 | 0.46% |
0.179 | 0.176 | 1.78% | 0.177 | 0.95% | 0.183 | 2.46% |
0.22 | 0.200 | 8.96% | 0.223 | 1.44% | 0.216 | 1.62% |
0.13 | 0.137 | 5.28% | 0.133 | 2.31% | 0.139 | 6.61% |
0.148 | 0.143 | 3.22% | 0.143 | 3.34% | 0.140 | 5.55% |
0.314 | 0.310 | 1.42% | 0.318 | 1.19% | 0.320 | 1.80% |
0.222 | 0.207 | 6.56% | 0.219 | 1.23% | 0.235 | 6.05% |
0.362 | 0.089 | 75.35% | 0.147 | 59.33% | 0.138 | 61.82% |
0.132 | 0.137 | 3.76% | 0.131 | 1.13% | 0.121 | 8.02% |
0.408 | 0.380 | 6.85% | 0.396 | 2.90% | 0.376 | 7.94% |
0.142 | 0.142 | 0.05% | 0.147 | 3.35% | 0.159 | 12.25% |
0.391 | 0.396 | 1.31% | 0.390 | 0.31% | 0.389 | 0.45% |
0.505 | 0.507 | 0.44% | 0.523 | 3.53% | 0.534 | 5.75% |
0.197 | 0.314 | 59.31% | 0.314 | 59.44% | 0.318 | 61.60% |
0.192 | 0.193 | 0.71% | 0.187 | 2.38% | 0.190 | 0.94% |
0.163 | 0.160 | 1.78% | 0.164 | 0.89% | 0.159 | 2.51% |
0.144 | 0.138 | 4.21% | 0.136 | 5.51% | 0.134 | 7.10% |
0.139 | 0.141 | 1.25% | 0.143 | 2.57% | 0.145 | 4.23% |
0.229 | 0.225 | 1.60% | 0.224 | 2.27% | 0.228 | 0.55% |
0.133 | 0.137 | 3.03% | 0.132 | 0.56% | 0.131 | 1.52% |
0.14 | 0.140 | 0.28% | 0.139 | 0.88% | 0.138 | 1.56% |
0.339 | 0.348 | 2.53% | 0.338 | 0.26% | 0.337 | 0.54% |
Methods | BP | PSO-BP | SAPSO-BP | ||||||
---|---|---|---|---|---|---|---|---|---|
Number of Neurons in the Hidden Layer | 3 | 9 | 15 | 3 | 9 | 15 | 3 | 9 | 15 |
MAPE (%) | 32.89 | 27.90 | 38.00 | 28.29 | 21.83 | 17.06 | 9.03 | 7.63 | 9.71 |
RMSE | 0.0858 | 0.0885 | 0.0902 | 0.0688 | 0.0780 | 0.0733 | 0.0639 | 0.0548 | 0.0577 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 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
Yi, M.; Xie, W.; Mo, L. Short-Term Electricity Price Forecasting Based on BP Neural Network Optimized by SAPSO. Energies 2021, 14, 6514. https://doi.org/10.3390/en14206514
Yi M, Xie W, Mo L. Short-Term Electricity Price Forecasting Based on BP Neural Network Optimized by SAPSO. Energies. 2021; 14(20):6514. https://doi.org/10.3390/en14206514
Chicago/Turabian StyleYi, Min, Wei Xie, and Li Mo. 2021. "Short-Term Electricity Price Forecasting Based on BP Neural Network Optimized by SAPSO" Energies 14, no. 20: 6514. https://doi.org/10.3390/en14206514
APA StyleYi, M., Xie, W., & Mo, L. (2021). Short-Term Electricity Price Forecasting Based on BP Neural Network Optimized by SAPSO. Energies, 14(20), 6514. https://doi.org/10.3390/en14206514