Abstract
Aimed at the problem of order determination of short-term power consumption in a time series model, a new method was proposed to determine the order and the moving average of the ARMA model by particle swarm optimization (PSO).According to the difference between the predicted value and the real value of the ARMA model, the fitness function of the particle swarm optimization algorithm is constructed, while the optimal solution which satisfies the ARMA model is confirmed by adjusting the inertia weight, population size, particle velocity, and iteration number. Finally, SVR regression is performed by using a support vector machine to correct the residual sequence obtained after the prediction of ARMA. The final prediction result is obtained by adding the predicted values and corrected residual. Based on the data of historical electricity load of a residential district in 2016~2017, the proposed method is compared with the traditional models. The result of the use of MATLAB simulation shows that the method is simple and feasible, greatly improves the model prediction accuracy, and implements the new method for short-term load forecasting of a small sample.
1. Introduction
The short-term load forecast of the power system is generally a series of forecasts based on the data of the next few days or several weeks. Since electric energy cannot be stored in large quantities and the demand for electric power in society is constantly changing, it is necessary to predict short-term electricity consumption in order to achieve a dynamic balance between the power supply end and the power generation end. The higher the accuracy of the short-term load forecasting, the more beneficial it is to the normal operation of the power grid system, and it also provides an important basis for the power grid to formulate a short-term reasonable dispatch plan [1]. With the increase in the scale of power systems, the increase in nonlinear loads, and the introduction of market competition mechanisms, it becomes more important and urgent to study combinatorial optimization algorithms with higher prediction accuracy [2]. Liu and Zhang propose cluster-based CIIoT wherein the cluster heads perform cooperative spectrum sensing to get available spectrum and the nodes transmit via nonorthogonal multiple access (NOMA) [3]. Then, Liu et al. furtherly propose a joint optimization algorithm based on Lagrange dual decomposition which is proposed to achieve the optimal solution [4]. Jia et al. propose a space segment design based on a spectrum sensing-based cooperative framework, in consideration of the presence of MUs [5]. Moreover, a novel detector which joints the QOC and Fixed Sphere Decoding (FSD) algorithm is proposed by Jia et al. to address multiplexing overlapped carriers [6].
The essence of load forecasting is to extract the changing law of historical electricity consumption data over time. Because the load is affected by various factors such as temperature and weather, the difficulty of load forecasting also increases [7]. Traditional load forecasting methods include time series method, autoregressive method, Kalman filter [8], and so on. These methods mainly make predictions based on the time series of historical load data. Therefore, the prediction accuracy of data with strong time series is relatively high, but for some nonlinear data, the effect of using this method to predict is relatively poor. Traditional prediction methods have difficulty in meeting higher prediction accuracy requirements. In recent years, artificial intelligence algorithms represented by support vector machines and neural networks [9] have attracted widespread attention due to their high prediction accuracy and strong computing capabilities. Among them, the most widely used is the BP neural network model, which is also simpler and faster, for prediction, but the BP neural network is easy to fall into the local optimum, and it is difficult to obtain the global optimum solution [10, 11]. Yue et al. proposed a short-term load prediction model of a ridgelet recurrent neural network, which improved the accuracy of prediction to a certain extent, but too much data resulted in slower training speed [12]. Wang and others put forward an ARIMA-SVM combined forecasting model through research, which has strong generalization ability and is suitable for load forecasting with strong fluctuations [13]. Wang et al. proposed a short-term prediction model of a convolutional neural network with an encoder and particle swarm optimization algorithm. The PSO algorithm is used to optimize the parameters of the convolutional neural network to improve the prediction accuracy [14]. Li and Wang proposed a short-term load forecasting method based on the PSO algorithm and RNN, which overcomes the problem of large random value of the initial weight of RNN and has good convergence, but it does not solve the gradient problem that easily occurs in RNN [15]. To further promote the forecasting precision, the adjustable fractional weighted coefficients and corresponding time parameter of the initial condition are estimated by utilizing the particle swarm optimization (PSO) [16].
In recent years, many experts have put forward many new criteria and methods on how to determine the structure of ARMA, which has improved compared with traditional methods [17]. But the problem of applying the particle swarm algorithm to ARMA model order determination has been studied by few scholars. This paper proposes a new order determination method for prediction. The particle swarm algorithm is applied to the order problem of the model, and the optimization is performed according to the self-adaptation of the particle swarm algorithm and iteratively finds the optimal position of the particles, that is, the autoregressive order. The optimal solution of the value of the number and the number of moving average terms , so as to determine the best ARMA model, uses SVR to perform regression correction on the residual data obtained after prediction to obtain new effective residual data, combined with the PSO-ARMA. The prediction results are added to get the final prediction result. Additionally, Wu et al. construct the EMD-GM-ARMA model via superimposing the prediction results of each subsequence to predict the mining safety production situation [18]. Guo et al. use a fruit fly optimization algorithm to optimize the parameters in SVR [19]. The above modifications are considered effective improvement, through case analysis and comparison with the prediction results of other models. It is proven that the prediction accuracy of the combined model has been significantly improved.
2. Overview of the PSO-ARMA-SVR Combination Model
2.1. Algorithm Overview
When determining the order of the ARMA model, some uncertain factors often appear. After comprehensive consideration of various constraints, this paper uses the particle swarm algorithm to adaptively optimize the parameters in the ARMA model. The order of the model is iterated and optimized to finally achieve the goal of improving the prediction accuracy of the model. The framework of the algorithm is mainly divided into three parts: (1)PSO-ARMA partA new ARMA model order determination method is proposed, through the continuous iteration of the particle swarm algorithm to find the optimal solution that satisfies the ARMA model autoregressive order and the moving average term . According to the optimal solution obtained by the dynamic weight iteration and the exhaustive method for comparison and verification, it was confirmed that the value is the global optimal solution. (2)ARMA-SVR part
The residual sequence after fitting arma is . The support vector regression (SVR) model is used for fitting, the new effective residual data is obtained through regression correction, and the final prediction results are combined with the prediction results obtained by PSO-ARMA. (3)Fitness function construction
In actual electricity consumption forecasting, usually observable time series are modeled according to their part, and the remaining part of the data is used for verification. If the difference between the predicted value and the true value is small, it represents the model. It is more accurate. Otherwise, it means that the model has a large error and needs to be remodeled. Therefore, the difference between the predicted value and the true value can be used as a criterion for judging whether the model is correct.
2.2. Algorithm Flow and Block Diagram
The PSO algorithm is used to optimize the order of and parameters in ARMA, so as to establish the optimal ARMA-SVR combined prediction model. The PSO-ARMA-SVR modeling process is shown in Figure 1. The specific optimization modeling steps are as follows:
Step 1. Normalize the data. The purpose of normalization of data is to narrow the difference between the attributes in the input data. If the difference is large, it will have a greater impact on the predicted results; the normalization processing formula is as follows: where represents the sample point in the th row and th column and and represent the maximum and minimum values of the data.
Step 2. Use the PSO algorithm to optimize the parameters, initialize the position and velocity of the particles, and obtain a new fitness function value through each iteration to verify whether it is the optimal solution, until the optimal parameters ( and value) are obtained.
Step 3. Establish an ARMA model based on the and parameters obtained by iterative optimization in the previous step, and perform fitting prediction.
Step 4. The data fitting result of the prediction sample is subtracted from the original training data to obtain the residual data predicted by the ARMA model, and the SVR model is further constructed based on the training residual data, and then, the residual data is predicted.
Step 5. According to the residual value obtained after the sample data prediction, the residual is used as the input of the SVR model to perform regression, and a new residual sequence is predicted.
Step 6. Concatenate the ARMA model and the SVR model, train 70% of the data in the sample sequence, and the final output result is the sum of the residual optimization result obtained by the combined prediction model and the ARMA prediction result, and compare the remaining 30% of the data. The final output sequence is .

3. Problem of Determining the ARMA Model Order Based on Particle Swarm Optimization
3.1. Principle of the Particle Swarm Algorithm
The original of the particle swarm algorithm is that people have a lot of different behavioral studies between bird groups. The biggest feature of bird predation is that it can quickly search for a range of predation between similar groups and between groups. Certain sharing of food information is conducive to the coevolution of individuals and groups [13]. The particle swarm algorithm corresponds to one of the solutions of each “flying” particle in space and summarizes the characteristic information of the particle with the three indicators of flight speed, position, and fitness function value and iterates the optimization according to the fitness function. The calculated value is used to judge the quality of particles. By judging the “flying” path of itself and other particles, the particle changes its position and direction to continuously find a better area, thus completing the process of continuous optimization in the global search space [20].
The description of the particle swarm algorithm in the past is as follows: assume that the search space of particles in dimension consists of particles to form a population , where . The fitness function is . The velocity of particle is . The best position for the individual particle to pass is . The optimal position of population is . Suppose the characteristic information of at time is
speed:
position:
individual optimal position:
global optimal position:
Then, the speed and position information of the particle “flying” at time is
Among them, and are the components of the velocity and position of the particle in the th iteration in the th dimension, respectively; and are constants for adjusting the learning step length; and are random numbers distributed between ; and is used to adjust the search range of the solution space. In order to keep the particles in the search range, the speed and position of the particles are generally limited to and , respectively.
3.2. Basic Parameter Setting of Particle Swarm
Since the particle swarm algorithm is restricted by the fixed inertia weight during the iteration process, the global search ability of the algorithm is greatly weakened. In order to prevent the particles from falling into the local optimum prematurely, this paper adopts a rule of diminishing inertia weight differential, which is calculated as follows:
represents the inertia weight, and are the maximum and minimum weights, represents the maximum number of iterations, and is the current number of iterations. When the value of is too small, the search will gradually fall into the local optimum. When the value of is larger, the global search ability is stronger. Therefore, according to this dynamic method, the particles can be better at the global optimum status. First, initialize the population of particles, set the initial position and initial speed of the particle population randomly, and set the number of populations to (the setting of and in the ARMA model by particle swarm). After many experiments, it is found that the initial set number of populations has no great influence on the iterative results of particle swarm optimization. Therefore, in order to simplify and save the iteration time, this paper chooses the number of populations , for the selection of learning factors , generally .
3.3. Determination of Fitness Function
For a time series model, if you want to evaluate the pros and cons of the combined model, you need to judge the accuracy of the model’s prediction results. The higher the accuracy of the prediction, the more reasonable the model is. In the actual electricity consumption forecast, usually for the observable time series, model according to its part and use the remaining part of the data to verify. If the difference between the predicted value and the true value is small, it means that the model is more accurate. Otherwise, it means that the model has a large error and needs to be remodeled. Therefore, the difference between the predicted value and the true value can be used as a criterion for judging whether the model is correct. Therefore, according to this criterion, the square sum of the difference between the predicted value and the actual value is established. The smaller the value change obtained, the more appropriate the model, which is defined as where is the predicted value and is the actual value.
According to formula (8), the fitness function can be constructed:
It can be seen from formula (9) that the smaller the change value , the more ideal the predicted effect. When , it means that the model is the best prediction model, and the prediction effect is the best. Therefore, the above-mentioned value can be used as a criterion function for judging the pros and cons of the model, and the fitness function curve established according to the rule of searching for extreme values of the particle swarm algorithm can well represent the entire algorithm iteration process.
4. ARMA-SVR Model
4.1. ARMA Fitting
Time series model research is based on linearity. Usually in statistics, a set of random variables arranged in time is often used to represent a time series of random events, abbreviated as or . When the system response at time is not only related to its own value at the previous time but also related to the interference before entering the system, then we can define this system as an autoregressive moving average system, and its mathematical model is recorded as : where the real parameter is the autoregressive coefficient, the real parameter is the moving average coefficient, and is the white noise sequence. If , this model serves as a centralized model. In particular, when , the model becomes the model. When , the model becomes the model. The construction of the above model mainly includes the following steps:
Step 1. Data preprocessing. Due to the characteristics of the ARMA model, we need to preprocess the current time series before modeling, so that the data is in a stable trend, and then, the next forecast can be made. This requires us to use the differential method to perform differential processing on the data from the first order to obtain the comparison result of the initial data and the first-order difference as shown in Figure 2. The data is finally in a stable state.
Step 2. Model the order. In this paper, particle swarm optimization is mainly used for self-adaptive optimization. To further determine the self-regression order and sliding average number of items in the ARMA model, this process involves ensuring that the particles reach a global optimal solution. Therefore, the exhaustive method is used to verify the results.
Step 3. Parameter estimation. The commonly used parameter estimation methods mainly include the least square method, moment estimation method, and maximum likelihood estimation method. Each of these methods has its advantages and disadvantages. Generally, we use the moment estimation method for low-order models, and the calculation of the maximum likelihood estimation method is too complicated. Therefore, this paper adopts the least square method with higher accuracy and wider application and directly calls the armax function in MATLAB to estimate the parameters.
Step 4. Test the model. For the test of the ARMA model, we generally check the residual series by the white noise test according to the theoretical method, but the actual calculation process of the model is very cumbersome, so the test of the rationality of the model is passed. The final predicted value is compared with the actual value. If the model is established, the model needs to be remodeled.

4.2. SVR Concept
The support vector machine was initially mainly used in linear problems such as binary classification, and the sample points were divided into two parts as much as possible by finding a hyperplane. A model that is often used in the problem of SVM vector regression is the SVR model [21], so the core technique of SVM is also applicable to the SVR model. After raising the dimensionality of the data to a high-dimensional space, a linear decision function is constructed. Through this decision function, we can realize the linear regression of the equation and replace the nonlinear part of the equation with the kernel function to solve the problem between the nonlinear regression and the dimension [22].
Set a training set of sample data:
In the above data set, by mapping to the high-dimensional feature space through a nonlinear mapping function , this regression equation can be written as
In the formula, is a constant vector, which determines the direction of the hyperplane, and is the displacement, which determines the distance between the hyperplane and the origin.
4.3. Regression Model Algorithm
The SVR model has a regional “spacing zone” boundary at each end of the linear function. Samples falling within this range do not need to calculate the loss but only need to calculate the loss value outside the boundary. Therefore, the purpose of the application of the SVR model for regression is mainly to put the sample distribution within the deviation range ε as much as possible and describe the SVR model by formulas (13) and (14):
In the formula, represents the penalty coefficient, which is generally a constant. By introducing the slack variables and , then this formula can be transformed into
According to the above problem, the Lagrangian equation can be established and the dual problem can be solved very well.
In the above formula, and are both Lagrange multipliers.
4.4. SVR Residual Correction
Since the initial original data is randomly distributed, the residual of the ARMA model contains some other random items with interference information when it is generated. In order to correct and optimize the residual generated by the ARMA model, we input it into the SVR regression modeling which is performed in the model. The residual optimization modeling steps of ARMA-SVR are as follows:
Step 1. Input a training set in the SVR model:
In the above formula, the time node value corresponding to is used as input; the residual value of SVR model correction corresponding to is used as output. By mapping a kernel function into a high-dimensional space, this article uses the most commonly used Gaussian kernel function in the form
In the formula, is the center of the kernel function and is the width parameter, which controls the radial range of the function. According to the regression equation , the sample sequence can be defined. The training fit data is = . The forecast data is = .
Step 2. There is a setting for the parameters and deviation range of the SVR model. According to the kernel function equation defined in the previous step, when the center of the kernel function is very close to the value of , then the value of the kernel function is 1. When is far from , the value of the kernel function is 0. According to experience, the parameter value of the penalty coefficient is . The value range of the insensitivity coefficient is . Choose the mean square error (MSE) of the calculation result as the fitness function. Use the PSO algorithm to iteratively optimize the penalty coefficient and the insensitivity coefficient in the SVR model. Then, find the optimal parameters to predict and correct the residual.
Step 3. Calculate the residual error of the sample after data training based on the established ARMA model . From the start time of the residual sequence, train 70% of the data in the residual sequence and use the regression prediction method of the SVR model to predict the remaining 30% of the data to obtain a new residual sequence .
Step 4. Obtain the final short-term electricity consumption load forecasting sequence ; then, the ARMA-SVR combined model for residual forecasting expression is
5. Experimental Research on Short-Term Electricity Consumption Forecast
5.1. Electricity Data Collection and Access
For the power load forecasting system, different structured data and unstructured data should be collected from an important aspect of the system—the data collection layer. Once the data center is configured, the data is automatically collected to the cloud. As shown in Figure 3, the user’s load data is collected through a trigger-type smart meter. This type of smart meter generally uses the HT5019 chip as the measurement chip, and the collection frequency is generally 15 minutes. It can be connected with LORA, 4G, Wi-Fi, etc. Other submeters, terminals, and servers are connected to give full play to the role of the data collection layer and then actively upload the collected load power data to the cloud. The power load forecasting system obtains electricity consumption information mostly by using the electricity consumption, voltage value, current value, real-time power, etc. collected by smart meters. By querying the weather port, it can also obtain data information about weather, temperature, and seasons.

The research object of this paper selects the electricity load data of 210 residents in a residential area in Guangdong Province to conduct experiments. Through the method of ARMA modeling and SVR residual correction method, we combined the forecast of the work load data of 103 weeks from 2016 to 2017.
This experiment was completed in the simulation environment of MATLAB 2018a. After the required data was collected, the data was reasonably selected by analyzing the distribution law of the sample data. At the same time, abnormal points should be processed according to the previous and next moments. Data with a large difference is regarded as an abnormal point. For missing data, replace the average of several similar daily load data based on the periodic characteristics of electricity usage. Further build the particle swarm algorithm to find the optimal parameters to build the ARMA model for load forecasting. Finally, the difference between the predicted data and the true value of the verification set data is made to obtain the predicted error value. The residual sequence is introduced into the SVR vector regression as the input variable, and the residual correction value of the ARMA model is obtained. Finally, the sum of the ARMA predicted value and the SVR residual correction value is used as the final weekly load forecast result. The combined prediction model was compared with a single ARMA model, SVR model, and SVR-ARMA model, and the performance evaluation results of the combined prediction model were obtained.
5.2. ARMA-SVR Model Experimental Results and Analysis Based on the Particle Swarm Algorithm
The ARMA model has the characteristics of stability when predicting. Usually, we need to test the stationarity of the data first. If the original data is in a random distribution state, then the data must be processed by multiorder difference until it is in a stable state. Referring to electricity usage rules, Figure 4 shows the weekly load data distribution map of a residential area from 2016 to 2017. By observing the data distribution status of the map, it can be seen that the data has a large range of changes and presents a periodic distribution law.

By performing the first-order difference change on the data as shown in Figure 5, it can be observed that its distribution fluctuates roughly above and below the mean. After passing the ADF test, it can be determined that the time series is first-order difference stationary.

The optimal model results obtained after 40 iterations of the particle swarm algorithm are shown in Table 1.
It can be concluded from Table 1 that the final region of the iteration process is stable, and the curve of evolutionary algebra and objective function is shown in Figure 6.

As can be seen from the above figure, as the evolutionary algebra gradually increases, the optimal value of the objective function gradually tends to be in a stable state, indicating that the solution at this time is the optimal solution; then, can be used as the optimal model to make predictions.
The optimal model obtained after applying the particle swarm to determine the order is used to simulate the electricity consumption data of 103 households from 2016 to 2017, select 70% of the sample data for training, and use 30% of the data as the verification set; its simulated trend chart is shown in Figure 7.

The SVR model is established based on the residual data of the ARMA prediction results, and the input data is divided into two parts using the hold-out method. One part is used as the training set (about 70%), and the other part is used as the test set (about 30%) for verification. The SVR model prediction value and actual value trend comparison chart of the residual data is shown in Figure 8.

The PSO-ARMA-SVR combined forecasting model proposed in this paper is used to predict the weekly load data of 103 residents in a community. The forecast results are shown in Table 2. It can be seen from the table that the residual correction value in the SVR prediction model is the correction result of the residual value generated by the ARMA model, and the prediction value of the combined model is the sum of the prediction value of the ARMA prediction model and the SVR residual correction value. It can be seen from the table that the prediction error of the combined model is smaller than that of the single ARMA model. The maximum error is 374.85 kWh, and the minimum error is only 1.52 kWh, indicating that the combined prediction model is more effective.
5.3. Comparative Analysis
In order to verify the prediction accuracy of the PSO-ARMA-SVR combined prediction model used in this article, the prediction values of the three models of ARMA, SVR, and SVR-ARMA were established for comparison. The initial values and parameter settings of each model were compared with PSO-ARMA-SVR. The ARMA-SVR models are all the same, and the prediction comparison results are shown in Figure 9.

Through the comparison and analysis of the prediction results of the four prediction models in the figure, it can be seen that the PSO-ARMA-SVR combined prediction model proposed in this paper has the highest degree of agreement with the actual value, indicating that the model has good fitting performance. In order to test the model, according to the quality, the error value of the fitting was studied, and the result is shown in Figure 10.

From the comparison of the four types of prediction errors in the figure, it can be seen that the prediction effects of the ARMA model and the SVR model are relatively poor, and the prediction accuracy of the combined prediction model is significantly higher than that of the single prediction model. The error fitting curve of the PSO-ARMA-SVR combined prediction model proposed in this paper tends to be 0, and the prediction deviation drops to 0.03%. The 28 periods of data in the figure are compared to the average prediction of each period of the combined model SVR-ARMA. The performance increased by 0.95%, indicating that the combined model constructed in this paper is more effective for load forecasting and the forecasting effect is relatively better.
6. Conclusion
With the increasing demand for electricity consumption in cities, the state grid has become increasingly in demand for accurate electricity consumption distribution and dispatch. Based on the traditional ARMA prediction model, this paper establishes a PSO-ARMA-SVR combined prediction model combining linear and nonlinear features to achieve accurate prediction of short-term electricity consumption in residential areas. The ARMA model is constructed by building a particle swarm algorithm. A new method of order determination, by optimizing the parameters and in the SVR, realizes the correction of the ARMA prediction residual value in the SVR regression prediction model, improves the accuracy of the prediction model, and reduces the prediction deviation to 0.03%. The PSO-ARMA-SVR model proposed in this paper is evaluated based on the prediction results and the percentage of data errors after data fitting, which proves that the method has outstanding performance in load forecasting and provides a new idea for future research, having good application prospects.
Data Availability
The data of historical electricity load of a residential district in 2016~2017, which is used to support the findings of this study, have not been made available because the data involve the principle of commercial confidentiality.
Conflicts of Interest
The authors declare that they have no conflicts of interest.