Research on Power Price Forecasting Based on PSO-XGBoost

: With the reform of the power system, the prediction of power market pricing has become one of the key problems that needs to be solved in time. Power price prediction plays an important role in maximizing the proﬁts of the participants in the power market and making full use of power energy. In order to improve the prediction accuracy of the power price, this paper proposes a power price prediction method based on PSO optimization of the XGBoost model, which optimizes eight main parameters of the XGBoost model through particle swarm optimization to improve the prediction accuracy of the XGBoost model. Using the electricity price data of Australia from January to December 2019, the proposed model is compared with the XGBoost model. The experimental results show that PSO can effectively improve the performance of the model. In addition, the prediction results of PSO-XGBoost are compared with those of SVM, LSTM, ARIMA, RW and XGBoost, and the average relative error and root mean square error of different power price prediction models are calculated. The experimental results show that the prediction accuracy of the PSO-XGBoost model is higher and more in line with the actual trend of power price change.


Introduction
Power is an important basic industry and public utility related to the national economy and people's livelihoods. The main purpose of a power market reform is to break the monopoly, improve the production efficiency of the power industry and realize the optimal allocation of resources by introducing the competition mechanism. Chile [1] was the first country to marketize the electricity market. In 1982, Chile officially promulgated new electricity laws and regulations, which defined the position that the transmission system is open to all domestic power plants and all individual electricity users in the form of official national laws, thus changing the situation of a regional monopoly and starting a new reform in the operation of contract electricity trading and real-time electricity trading; therefore, various power enterprises' operation changed from monopoly to competition. The power system in Chile has achieved the expected results, which not only ensures the basic stability of electricity prices, but also ensures that power producers can obtain considerable profits; however, some problems are also exposed, including the lack of investment in grid development caused by the imperfect pricing of electricity sales and the imperfect pricing system of the transmission system. After decades of development, the reform of the electricity market in the UK has achieved many phased results [2]. After four stages of electricity market reform, Britain has established a fair, transparent and open electricity trading market, and introduced privatization and competition through the four aspects of power generation, electricity sales, distribution and electricity sales. However, with the continuous practice of electricity reform, the British electricity market has also exposed some drawbacks, such as the complexity of system marginal price calculations, and the quotations of power producers can not truly reflect their power generation costs. Since the 1990s, China has successively carried out the practice and exploration of electricity marketization reform [3][4][5][6], and provinces (regions) have carried out various types of reform practices, including transmission and distribution price verification, electricity sales side reform, direct trading, etc., in combination with policy requirements and their own actual conditions. However, it was not until August 27, 2019, when the State Grid Corporation of China issued the Notice of the Ministry of Industry of the State Grid on the Withdrawal of Electricity Sales by Collective Enterprises of the Company System, requiring the collective enterprises of the company system to withdraw from the electricity sales business, that China's electricity sales side was fully opened, forming a market structure of multiple buyers and sellers, breaking the monopoly of the power grid on the power industry, and making great progress in the construction of electricity marketization. However, there are still problems, such as untimely information disclosure, inadequate market supervision and imperfect pricing mechanisms. The National Energy Market (NEM) of Australia is one of the well-known free-bidding electricity markets in the world. Its electricity reform was based on the experiences and lessons of other countries and adjustments were made according to local conditions. The reform of electricity marketization in Australia has roughly gone through three stages: the structural restructuring of the electricity industry, building a unified electricity market system and re-establishing the electricity regulatory system [7]; it has always focused on providing users with lower electricity prices, promoting competition among internal departments of the power industry, optimizing energy investment and providing open access to the power network [8]. After decades of development, Australia's power system reform has achieved remarkable results, not only in reducing electricity prices and improving the efficiency of the power industry, but also in increasing investment in the power industry, which improved the competitiveness of Australia's industry. To sum up, the electric power system reform in various countries aims to achieve the following objectives: 1. provide a stable electricity price and power supply; 2. break monopoly barriers and improve competitiveness; and 3. improve the transparency and satisfaction of power trading, and make the power market truly fair, just and open.
With the continuous advancement of the reforms of the power system and the liberalization of the power sales side in various countries, the power trading market has gradually become the leading development trend in the current power industry, and power resources have become a commodity. The power price is the core content of power market transactions, and power price forecasting is of great significance for the fair trading and supply-demand interaction of all players in the power market. For power producers, they need to make bidding strategies based on an accurate forecast of power prices to meet the principle of maximum income and minimum risk, and accurate forecasting of power prices can enable power producers to accurately grasp the market trends and then formulate the best price strategy. For power purchasers, the accurate prediction of power prices can enable power purchasers to effectively control power consumption and reasonably plan for power consumption according to their own actual conditions, thus reducing the cost of electricity consumption. For market regulation, the accurate prediction of electricity price can provide a scientific basis for formulating various electricity policies, promote the development and progress of the electricity market, and promote the formation of a stable, orderly and healthy market environment [9]. Therefore, power price forecasting is of great significance. Combined with the historical data on power pricing, this paper uses the PSO-optimized XGBoost to forecast the power price, establishes a power price forecasting model based on the PSO-optimized XGBoost, and compares this model with other models to prove the effectiveness and correctness of PSO-XGBoost.

Related Work
The importance of power price forecasting has attracted the attention and research of many scholars at home and abroad. At present, the prediction methods of power price mainly include the grey model prediction method, neural network method and combination model prediction method.
In 1982, Professor Deng of Huazhong University of Science and Technology first pro-posed the grey system theory [10]. At present, many scholars have studied the grey model in power price forecasting [11]. The main research object of grey system theory is the uncertain system of "poor information". It realizes an accurate description and under-standing of the real world through part of the known information and finds internal laws. After 40 years of development, grey system theory has been widely used in many fields, such as society, water conservancy, medicine and so on, and has achieved good results [11]. Reference [10] improves the traditional grey model and uses the improved grey model to forecast the clearing price of the power market. In order to improve the prediction accuracy, the authors of [12] established an improved grey model of multi-electricity prices to comprehensively predict the electricity price in the spot market and the long-term contract market, and adopted the grey solution optimization algorithm.
Reference [13] uses autoregressive integrated moving average (ARIMA) models to predict the next day's electricity price, and corrects the error of the prediction model. In order to improve the convergence speed, the authors of [14] designed a Levenberg-Marquardt BP (LMBP) method to train the neural network, which is used to predict the short-term electricity price, and carried out experiments in the electricity market of Anhui Province, proving the high performance of this method. Article [15] combines an artificial neural network and clustering algorithm, proposes a day-ahead price prediction model based on an RNN and tests it on the hourly price of daytime electricity in the US electricity market. In order to improve the accuracy and stability of power price forecasting, the authors of [16] proposed an optimized long short-term memory neural network (LSTM) model and tested it in the power markets of Pennsylvania, New Jersey and Maryland. Reference [17] proposed a deep RNN-based day-ahead price forecasting method, and verified it based on the data of the New England power market, where the results showed that the method was effective. Reference [9] proposes a price forecasting method based on genetic algorithm, which uses genetic algorithm to optimize BP neural network, and tests it on the data of the American power market. The experimental results show that this method can effectively control the forecasting error. In order to improve the accuracy of electricity price prediction, article [18] adopts the method of a deep belief network to predict the day-ahead electricity price, and uses the real data of the PJM power market in the United States to simulate the prediction. The experimental results show that the prediction accuracy of the deep belief network is higher, and it is an effective method for power prediction.
In view of the low prediction accuracy of a single model in power price prediction [19], many scholars have proposed combined prediction methods. Reference [20] proposes a hybrid model of EMD-LSTM-SVR to predict the power price. EMD is used to extract the periodic component and the trend component in the power price sequence, and LSTM is used to predict the periodic component and the trend component and output the prediction results of each component. Support vector regression (SVR) is used to superimpose the prediction sequence of each component to generate the predicted price sequence. Finally, the precision of the model is predicted using the price data of the PJM power market in the United States. In order to improve the prediction accuracy by taking advantage of the unique characteristics of each model, the authors of [21] proposed a hybrid method that combines a wavelet transform with a kernel extreme learning machine based on the adaptive particle swarm optimization and autoregressive moving average (ARMA), and evaluates the performance of this method by using the electricity price data of five countries. Reference [22] combines the ensemble empirical mode decomposition (EEMD), support vector machine (SVM) and autoregressive moving average (ARMA) to form a combined prediction model, and uses the real data of American power sales companies for prediction. The experimental results show that the combined model has a higher prediction accuracy. On the basis of the conventional electricity price forecasting model, article [23] also established an ARIMA forecasting model for the random sequence formed by the predicted residual to correct the electricity price forecasting results. The combined model can improve the prediction accuracy to a certain extent, but it also has many shortcomings, such as not being able to depict the linear change trend in the power price series.
To sum up, in order to improve the accuracy of power price prediction and characterize the changing trend of power pricing, this paper optimizes the extreme gradient boosting (XGBoost) based on particle swarm optimization (PSO), proposes a PSO-XGBoost power price prediction method and tests it on the Australian power price dataset from January to December 2019.

PSO-XGBoost
This section introduces the XGBoost algorithm and PSO algorithm, explains how PSO optimizes the main parameters of XGBoost, and proposes two evaluation indicators of the model.

XGBoost
XGBoost was proposed by Chen [24] in 2016 and is an improved Gradient Boosting Decision Tree(GBDT). Boosting is an algorithm that promotes the combination of base classifiers with strong classifiers. First, a base classifier is trained using the initial training set, and the weight of the training samples in the next base classifier is adjusted according to the performance so that the samples with classification errors gain more attention; this is repeated many times until they meet the conditions. Finally, the trained multiple classifiers are weighted and combined. Compared with GBDT, XGBoost is characterized by a high accuracy, difficulty in overfitting, and strong scalability [25].The objective function of GBDT is the loss function, and the objective function of XGBoost is the loss function plus the regular term. The loss function is the difference between the predicted value and the real value, and the objective function is optimized by reducing the loss; the regular term is used to control the complexity of the model and prevent extreme cases of the model.
Assuming that there are K trees in the model [26,27], for the sample set {(x 1 , y 1 ), (x 2 , y 2 ), · · · , (x m , y m )}, the prediction value of the model for each sample value where f t (x i ) = q(x i ) represents the leaf node corresponding to the sample on the kth weak classifier. The objective function of XGBoost is the loss function plus the regular term. The over-all objective function can be expressed as: where ∑ i=1 l y i , y * i represents the loss function composed of the deviation between the real value and the predicted value, and ∑ k Ω( f k ) represents the regular term, which is used to prevent the model from overfitting. It is expressed as follows: where T is the number of leaf nodes, γ and λ are parameters that control the structure of the tree and the weight distribution of leaf nodes, and w j is the weight of leaf nodes with index j. According to Formulas (1) and (2), the overall objective function is converted into the following form: Expand the loss function by using the second-order Taylor expansion and remove the constant term to obtain a new objective function as follows: where are the second derivative of the loss function.
The optimal weight of the leaf node is: where G j = ∑ i∈I J g i is the sum of the accumulated values of the first-order partial derivatives contained in the leaf node j, and H j = ∑ i∈I j h i is the sum of the second-order partial derivatives contained in the leaf node j.
The objective function is rewritten as a quadratic function of one variable with respect to the leaf weight w and the optimal value of the objective function is:

Particle Swarm Optimization
Particle swarm optimization (PSO) was proposed by Kennedy and Eberhart in 1995 [28]. Its basic idea is to simulate the predatory behavior of birds that adjust their search path and then find food according to their own experience and population communication. Each solution in the solution space of PSO corresponds to a bird in the search space, which is called a particle. Each particle has two characteristics of position and velocity. Each position of the particle represents a feasible solution. The particle moves in the space at a certain speed. The particle's running track is the process of solving. In the iterative process of particle swarm, the search process of each particle is constrained by the individual extreme value and the group extreme value. The individual extreme value is the optimal position that the particle seeks itself, which is recorded as pBest. The group extreme value is the optimal position that the whole particle swarm currently finds, which is recorded as gBest. During the iteration, the velocity v i and position x i of the ith particle are calculated as follows [29]: where ω is the inertia factor, and its value is non-negative; rand(t) is a random number between (0, 1); and c 1 and c 2 are learning factors, and usually, c 1 = c 2 = 2.
The flow chart of the PSO iterative search for the optimal solution is shown in Figure 1. The specific steps are as follows: (1) Randomly initialize the velocity and position of each particle in the search space.
(2) Calculate the fitness value of each particle.
(3) For each particle, its fitness value is compared with its best position pBest. If the current fitness value is better, it is taken as the current best position. (4) For each particle, its fitness value is compared with the global best position gBest. If the current fitness value is better, it is taken as the current best position. (5) Adjust the particle velocity according to Formula (8). (6) Adjust the position of the particles according to Formula (9). Otherwise, go to step (2) to continue the iteration. Judge whether the end conditions are met. If the conditions are met, end the iteration. Otherwise, go to step (2) to continue the iteration.

PSO-XGBoost
There are many parameters in the XGBoost model. The main factor affecting the accuracy of the model is the setting of parameters. It is often impossible to find an accurate parameter by artificially setting parameters. Therefore, in this experiment, PSO is used to optimize the main parameters of XGBoost. The default values and value ranges of parameters are shown in Table 1. The flow chart of the PSO-XGBoost model is shown in Figure 2. The steps to build the PSO-XGBoost model are as follows: (1) The data set is divided into a training set and a test set. The training set is the power price data from 1 January 2019 to 30 January 2019, and the test set is the data from 31 January 2019. The training set is used for model training and parameter optimization, and the test set is used for checking the accuracy of the model. (2) The Z-score was used to standardize the training set and the test set.

PSO-XGBoost
There are many parameters in the XGBoost model. The main factor affecting the accuracy of the model is the setting of parameters. It is often impossible to find an accurate parameter by artificially setting parameters. Therefore, in this experiment, PSO is used to optimize the main parameters of XGBoost. The default values and value ranges of parameters are shown in Table 1. The flow chart of the PSO-XGBoost model is shown in Figure 2. The steps to build the PSO-XGBoost model are as follows: (1) The data set is divided into a training set and a test set. The training set is the power price data from 1 January 2019 to 30 January 2019, and the test set is the data from 31 January 2019. The training set is used for model training and parameter optimization, and the test set is used for checking the accuracy of the model. (2) The Z-score was used to standardize the training set and the test set.
(3) Set the maximum number of iterations to 600, and set the inertia factor ω the decrease as the number of iterations increases, with a decreasing range of 0.9 → 0.4.
(4) Initialize the velocity and position of each particle according to the value range of the parameters. (5) The calculation formula of the fitness value is as follows: where N is the total number of samples, y i is the actual value of the electricity price, and y * i is the predicted value of the electricity price. (6) Start the iterative calculation, update the velocity and position of each particle according to Formulas (8) and (9), and calculate the updated fitness value according to Formula (10). (7) Adaptation value comparison. First, it is judged whether the fitness value is greater than the individual optimum. If the fitness value is greater than the individual optimum, the individual optimum is updated; otherwise, the individual optimum remains unchanged. Secondly, it is judged whether the fitness value is greater than the global optimum. If the fitness value is greater than the global optimum, the global optimum is updated; otherwise, the global optimum remains unchanged. (8) Update iterations: t = t + 1. (9) Determine whether to terminate the iteration according to the iteration termination condition (satisfying the objective function or the maximum number of iterations). If the iteration terminates, go to the next step; otherwise, return to step (6) to continue the iteration. (10) The test set is used to predict the electricity price and output the prediction results.
Electronics 2022, 11, x FOR PEER REVIEW 7 of 15 (5) The calculation formula of the fitness value is as follows: where N is the total number of samples, is the actual value of the electricity price, and * is the predicted value of the electricity price.
(6) Start the iterative calculation, update the velocity and position of each particle according to Formulas (8) and (9), and calculate the updated fitness value according to formula 10. (7) Adaptation value comparison. First, it is judged whether the fitness value is greater than the individual optimum. If the fitness value is greater than the individual optimum, the individual optimum is updated; otherwise, the individual optimum remains unchanged. Secondly, it is judged whether the fitness value is greater than the global optimum. If the fitness value is greater than the global optimum, the global optimum is updated; otherwise, the global optimum remains unchanged. (8) Update iterations: = + 1. (9) Determine whether to terminate the iteration according to the iteration termination condition (satisfying the objective function or the maximum number of iterations). If the iteration terminates, go to the next step; otherwise, return to step (6) to continue the iteration. (10) The test set is used to predict the electricity price and output the prediction results. The experimental results show that when the learning_rate is 0.01, max_depth is 3, colsample_bytree is 0.6, subsample is 0.7, min_child_weight is 1, gamma is 0.1, reg_alpha is 0.1 and reg_lambda is 0.1, the prediction effect of the PSO-XGBoost model is the best.

Evaluation Criteria of the Model
In this paper, the mean relative error (MRE) and root mean square error (RMSE) are used as the overall measurement standards of prediction accuracy to evaluate the performance of models after training. MRE is the average value of the relative error, which is a basic index to investigate the error; RMSE is the square root of the ratio of the square of the deviation between the predicted value and the real value of the model and the number of prediction times n. It is very sensitive to the large or small errors in the prediction data The experimental results show that when the learning_rate is 0.01, max_depth is 3, colsample_bytree is 0.6, subsample is 0.7, min_child_weight is 1, gamma is 0.1, reg_alpha is 0.1 and reg_lambda is 0.1, the prediction effect of the PSO-XGBoost model is the best.

Evaluation Criteria of the Model
In this paper, the mean relative error (MRE) and root mean square error (RMSE) are used as the overall measurement standards of prediction accuracy to evaluate the performance of models after training. MRE is the average value of the relative error, which is a basic index to investigate the error; RMSE is the square root of the ratio of the square of the deviation between the predicted value and the real value of the model and the number of prediction times n. It is very sensitive to the large or small errors in the prediction data and can better reflect the accuracy of the prediction results [30]. The specific calculation formulas are as follows [31]: where N represents the total number of samples in the test set, y i represents the actual electricity price, and y * i represents the predicted value.

Results
First, this section introduces the datasets used in the experiment and explains how to preprocess the datasets. Secondly, the PSO-XGBoost algorithm proposed in this paper is compared with other algorithm models. The comparison is mainly divided into two parts. Part one is the comparison between the PSO-XGBoost and XGBoost algorithm. The comparison results show that PSO can effectively optimize the parameters of XGBoost, thus improving the prediction accuracy. The second part is the comparison between PSO-XGBoost and other models. The experimental results show that PSO-XGBoost is more in line with the trend of power price changes and has higher accuracy.

Data Set
This paper uses the hourly power price data published by the Australian power market from January 2019 to June 2019 as the original data sequence for training and testing. The last day of each month is used as the test set, and the remaining data are used as the experimental training set. Six algorithms, XGBoost, LSTM, ARIMA [32], RW [33], SVR and PSO-XGBoost, are used to establish the power price prediction model. The change in the electricity price data from January 2019 to June 2019 is shown in Figure 3. and can better reflect the accuracy of the prediction results [30]. The specific calculation formulas are as follows [31]: where N represents the total number of samples in the test set, represents the actual electricity price, and * represents the predicted value.

Results
First, this section introduces the datasets used in the experiment and explains how to preprocess the datasets. Secondly, the PSO-XGBoost algorithm proposed in this paper is compared with other algorithm models. The comparison is mainly divided into two parts. Part one is the comparison between the PSO-XGBoost and XGBoost algorithm. The comparison results show that PSO can effectively optimize the parameters of XGBoost, thus improving the prediction accuracy. The second part is the comparison between PSO-XGBoost and other models. The experimental results show that PSO-XGBoost is more in line with the trend of power price changes and has higher accuracy.

Data Set
This paper uses the hourly power price data published by the Australian power market from January 2019 to June 2019 as the original data sequence for training and testing. The last day of each month is used as the test set, and the remaining data are used as the experimental training set. Six algorithms, XGBoost, LSTM, ARIMA [32], RW [33], SVR and PSO-XGBoost, are used to establish the power price prediction model. The change in the electricity price data from January 2019 to June 2019 is shown in Figure 3.

Feature of Data Set
In order to ensure that the model has sufficient feature information for training, the data set is divided into two parts: time characteristics and price data characteristics.
The prediction of the electricity price belongs to the time series problem, which often has periodicity, and the time information greatly affects the accuracy of the model. The electricity price has obvious periodicity, as, for example, there is a certain periodicity between the electricity price of the hour h on day d and the electricity price of the hour h on day d-1, as shown in Table 2. In this paper, two time characteristics related to power price forecasting are extracted.

Feature Name Feature Description
Day of the week Day of the week Hour of the day Which hour of the day When processing power price data, two aspects are mainly considered: one is the power price at adjacent time points, and the other is the power price at the same time point on adjacent days. The electricity price at adjacent time points mainly considers the influence of the electricity price adjacent to the forecast day d on the electricity price of the forecast day; the electricity price at the same time point on adjacent days mainly considers the periodicity of data by day. Specific features are shown in Table 3. Table 3. Features of price data.

Feature Name Feature Description
Electricity price at time d-1 Electricity price at adjacent time points Electricity price at time d-24 Electricity price at the same time point on adjacent days

Data Preprocessing
The Z-score normalization method is used to process the data to make it conform to the standard normal distribution. The formula is as follows: where x represents the value after standardization, x represents the original value, mean(x) represents the average value of the data, and σ(x) represents the standard deviation of the data.

Experimental Results
After the training of the power price prediction model based on PSO-XGBoost is completed, the model is used to predict the power price change from January to June 2019. The prediction results are shown in Figure 4, where RV represents the change curve of the actual value of the power price, and PV represents the change curve of the power price predicted by PSO-XGBoost. It can be seen from Figure 4 that the predicted value of the power price is close to the actual value, and the predicted change curve of the power price is basically consistent with the actual change trend, which indicates that the prediction effect is good.

Compared with XGBoost
In order to intuitively observe the parameter optimization effect of PSO on XGBoost model, Figure 5 shows the prediction comparison between the XGBoost pr tion model and the PSO-XGBoost prediction model from January to June. In the trai process of the XGBoost model, we use 5-fold cross-validation to optimize the supe rameters of XGBoost, evaluate the models corresponding to each group of parame and finally, select the best model and parameters. For 5-fold cross-validation, the dat is randomly divided into five parts, four of which are used as training data and one a data for testing in turn. The corresponding deviation value will be obtained for each and the average value of the five results will be used as the evaluation index of the rithm accuracy. The parameters of the XGBoost model are set as: the learning_rate is max_depth is 6, colsample_bytree is 1, subsample is 0.7, min_ child_ weight is 1, gam is 0.03, reg_alpha is 0.1 and reg_ lambda is 0.1. It can be seen from Figure 5 that models have good effects, but the performance of PSO-XGBoost is better than XGB and the predicted power price is closer to the actual price, which shows the effective of PSO in improving the performance of the model. At the same time, compared XGBoost, PSO-XGBoost can select parameters more intelligently, requires less manua perience, and has better theoretical value and practical significance.

Compared with XGBoost
In order to intuitively observe the parameter optimization effect of PSO on the XGBoost model, Figure 5 shows the prediction comparison between the XGBoost prediction model and the PSO-XGBoost prediction model from January to June. In the training process of the XGBoost model, we use 5-fold cross-validation to optimize the super parameters of XGBoost, evaluate the models corresponding to each group of parameters, and finally, select the best model and parameters. For 5-fold cross-validation, the data set is randomly divided into five parts, four of which are used as training data and one as test data for testing in turn. The corresponding deviation value will be obtained for each test, and the average value of the five results will be used as the evaluation index of the algorithm accuracy. The parameters of the XGBoost model are set as: the learning_rate is 0.01, max_depth is 6, colsample_bytree is 1, subsample is 0.7, min_ child_ weight is 1, gamma is 0.03, reg_alpha is 0.1 and reg_ lambda is 0.1. It can be seen from Figure 5 that both models have good effects, but the performance of PSO-XGBoost is better than XGBoost, and the predicted power price is closer to the actual price, which shows the effectiveness of PSO in improving the performance of the model. At the same time, compared with XGBoost, PSO-XGBoost can select parameters more intelligently, requires less manual experience, and has better theoretical value and practical significance.

Compared with Other Models
In order to compare the prediction effect of the PSO-XGBoost model proposed in this paper, extreme gradient boosting (XGBoost), the autoregressive integrated moving average model (ARIMA), random walks (RW), long short-term memory (LSTM) and support vector regression (SVR) are used to establish power price prediction models. The parameters of LSTM are set as follows: the LSTM layer is made up of three layers, where the number of neurons in the first layer is 64, the number of neurons in the second layer is 32, the number of neurons in the third layer is 16, the number of neurons in the fully connected layer is 1, the number of epochs is 100, and the batch size is 5. The parameters of SVR are set as follows: the kernel function is the Gaussian radial basis function, the penalty coefficient is 1e3, and gamma is 0.1. For ARIMA, the data set is basically stabilized after the first difference. Set the parameters of d = 1, p = 4, and q = 2 of the ARIMA model, and select the ARIMA (4,1,2) model. For RW, we chose a one-dimensional random walks model for comparison.

Compared with Other Models
In order to compare the prediction effect of the PSO-XGBoost model proposed in this paper, extreme gradient boosting (XGBoost), the autoregressive integrated moving average model (ARIMA), random walks (RW), long short-term memory (LSTM) and support vector regression (SVR) are used to establish power price prediction models. The parameters of LSTM are set as follows: the LSTM layer is made up of three layers, where the number of neurons in the first layer is 64, the number of neurons in the second layer is 32, the number of neurons in the third layer is 16, the number of neurons in the fully connected layer is 1, the number of epochs is 100, and the batch size is 5. The parameters of SVR are set as follows: the kernel function is the Gaussian radial basis function, the penalty coefficient is 1e3, and gamma is 0.1. For ARIMA, the data set is basically stabilized after the first difference. Set the parameters of d = 1, p = 4, and q = 2 of the ARIMA model, and select the ARIMA (4,1,2) model. For RW, we chose a one-dimensional random walks model for comparison.
In order to more intuitively understand the prediction error at each time, Figure 6 shows the change trend of the actual power price and the predicted power price, where RV represents the actual value of the power price from January to June 2019. It can be seen from Figure 6 that the predicted value of the PSO-XGBoost model is closer to the actual power price at each time, and the power price change curve is more closely fitted to the actual power price change curve. PSO-XGBoost captures the original power price more regularly, and the prediction accuracy is higher than that of other comparison models. In order to more intuitively understand the prediction error at each time, Figure 6 shows the change trend of the actual power price and the predicted power price, where RV represents the actual value of the power price from January to June 2019. It can be seen from Figure 6 that the predicted value of the PSO-XGBoost model is closer to the actual power price at each time, and the power price change curve is more closely fitted to the actual power price change curve. PSO-XGBoost captures the original power price more regularly, and the prediction accuracy is higher than that of other comparison models.  According to the calculation formulas of the MRE and RMSE, Tables 4 and 5 show the MRE and RMSE of the prediction results of each model. It can be seen from the error comparison in Tables 4 and 5 that the MRE and RMSE of the XGBoost improved based on PSO are smaller, and have better simulation and prediction effects.

Analysis of Experimental Results
In order to fully prove the effectiveness of the method proposed in this paper, in addition to fitting the electricity price data from January to June 2019, we also fitted the electricity price data from July to December and calculated the MRE and RMSE. There are 31 days (744 data) in July, August, October and December. We use the electricity price data of the first 24 days as the training set to train the model, and the data of the last 7 days as the prediction set to test the accuracy of the model. For the data of September and November, we use the data of the first 27 days as the training set, and the data of the last three days as the test set. The calculated MRE and RMSE are shown in Tables 6 and 7.

Conclusions
This paper studies power price prediction in the power market. Taking the Australian power market as the background, a power price prediction model based on the PSOimproved XGBoost is established and verified using a data set from Australia from January to December 2019. The experimental results show that the XGBoost model optimized by PSO can obtain a prediction effect close to the actual value. In addition, this paper also sets up a comparative test. The LSTM price prediction model, XGBoost price prediction model and SVR price prediction model are established to compare results with the PSO-XGBoost model proposed in this paper, and the MRE and RMSE of the prediction results of different algorithms on the same data set are calculated. The data show that the MRE and RMSE of PSO-XGBoost are the smallest.
At present, the PSO-XGBoost proposed in this paper has some details that need to be improved, such as the balance between the number of iterations or particles and the optimal solution. When the number of particles or the number of iterations is set to be small, the algorithm runs for a short time, but it is easy to obtain the local optimal solution. On the contrary, if the algorithm runs for a long time, it can obtain the optimal solution. In the future, we need to continue to study and solve these problems and strive to improve the prediction accuracy of the model. I believe that our model will play an important role in the international power industry and China's power system reform in the near future.