Interval estimation-based medium and long term electric quantity prediction method and terminal
By decomposing the medium- and long-term power sequence into trend, period and residual components, and using interval estimation and Markov correction algorithm for prediction, the problem of insufficient prediction accuracy and inability to characterize uncertainty in the prior art is solved, thereby achieving higher prediction accuracy and power grid safety guarantee.
Patent Information
- Application Number
- CN202411806432.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-05-09
AI Technical Summary
At this stage, medium- and long-term power forecasts are mainly deterministic predictions, which cannot characterize the uncertainty of the prediction results, resulting in insufficient prediction accuracy and certain limitations, which affect the safe operation of the power grid.
The medium- and long-term power prediction method based on interval estimation is used to decompose the original power sequence into trend components, periodic components and residual components. The trend and periodic components are predicted using neural network model and seasonal differential autoregressive moving average model. The interval estimation algorithm is used to estimate the residual components, and the preliminary prediction results are corrected through the Markov correction algorithm.
Through interval prediction and Markov correction, the uncertainty of the prediction results is quantified, the accuracy of medium- and long-term power prediction is improved, the safe operation of the power grid is ensured, and the application prospects are broad.
Smart Images

Figure CN119965819A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric power technology, and in particular to a medium- and long-term electricity quantity prediction method and a terminal based on interval estimation. Background Art
[0002] Medium- and long-term electricity forecast refers to electricity forecasting on a monthly or annual time scale. At present, a large number of literatures have predicted medium- and long-term loads from different perspectives. Some methods integrate data of three different time scales of year, month and day by stacking long short-term memory recurrent neural networks, which improves the accuracy of medium- and long-term load forecasting; some methods propose a hybrid weighted combination forecasting model that comprehensively considers time series decomposition method and multi-factor regression forecasting method; this model uses the Prophet algorithm to directly predict monthly data, and at the same time establishes a multi-factor regression forecasting model based on KELM according to monthly electricity data and its influencing factors, and finally assigns weights to the two models according to the weighted combination forecasting method to achieve the purpose of combining the advantages of the two models; some methods describe the expected risk by introducing the information entropy method, and use the minimum empirical risk and expected risk as the criterion to transform the problem of solving the weight of the combination model into a multi-objective optimization problem, and solve the multi-objective optimization problem through the social learning particle swarm optimization algorithm. Compared with the combination model that considers empirical risk and expected risk separately, this combination model has the best effect.
[0003] Through the above research results, it is found that the current medium- and long-term electricity forecast is generally a deterministic forecast, which can only predict the specific value of electricity and cannot characterize the uncertainty of the forecast result, resulting in insufficient forecast accuracy and certain limitations in some application scenarios. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a medium- and long-term electricity forecasting method and terminal based on interval estimation, improve the prediction accuracy of the current medium- and long-term electricity forecasting, and ensure the safe operation of the power grid.
[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0006] The medium- and long-term electricity forecasting method based on interval estimation includes the following steps:
[0007] S1. Obtain and decompose the original electricity quantity series into trend component, period component and residual component;
[0008] S2, using a preset neural network model to predict the trend component to obtain a first prediction result, using a preset seasonal difference autoregressive moving average model to predict the period component to obtain a second prediction result, and using a preset interval estimation algorithm to perform interval estimation on the residual component to obtain an interval estimation result;
[0009] S3, integrating the first prediction result, the second prediction result and the interval estimation result to obtain a preliminary power prediction result corresponding to the original power sequence;
[0010] S4. Using a Markov correction algorithm to correct the preliminary power prediction result to obtain a final power prediction result.
[0011] In order to solve the above technical problems, another technical solution adopted by the present invention is:
[0012] A medium- and long-term electricity quantity prediction terminal based on interval estimation includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:
[0013] S1. Obtain and decompose the original electricity quantity series into trend component, period component and residual component;
[0014] S2, using a preset neural network model to predict the trend component to obtain a first prediction result, using a preset seasonal difference autoregressive moving average model to predict the period component to obtain a second prediction result, and using a preset interval estimation algorithm to perform interval estimation on the residual component to obtain an interval estimation result;
[0015] S3, integrating the first prediction result, the second prediction result and the interval estimation result to obtain a preliminary power prediction result corresponding to the original power sequence;
[0016] S4. Using a Markov correction algorithm to correct the preliminary power prediction result to obtain a final power prediction result.
[0017] The beneficial effects of the present invention are: providing a medium- and long-term electricity forecasting method and terminal based on interval estimation, decomposing the original electricity sequence into a trend component, a periodic component and a residual component, taking the first prediction result and the second prediction result corresponding to the trend component and the periodic component respectively as the deterministic results, and then using a preset interval estimation algorithm to perform interval estimation on the residual component, thereby realizing the medium- and long-term electricity forecasting from the perspective of interval prediction, not only quantifying the uncertainty of the prediction result, but also obtaining the final electricity forecasting result through interval value taking and Markov correction, compared with the existing prediction model algorithm, the prediction accuracy is higher, further ensuring the safe operation of the power grid, and having broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the steps of the medium- and long-term electricity quantity prediction method based on interval estimation of the present invention;
[0019] Figure 2This is an overall framework diagram of medium- and long-term electricity forecasting based on a combined model of the medium- and long-term electricity forecasting method based on interval estimation of the present invention.
[0020] Figure 3 This is a structural diagram of a prediction neural network model of the medium- and long-term electricity quantity prediction method based on interval estimation of the present invention.
[0021] Figure 4 This is a flow chart of the algorithm flow of the GA-prediction neural network model of the medium- and long-term electricity quantity prediction method based on interval estimation of the present invention.
[0022] Figure 5 This is a diagram showing the decomposition of total social electricity consumption according to the first embodiment of the present invention.
[0023] Figure 6 Confidence interval diagram of residual components at different confidence levels of the first embodiment of the present invention.
[0024] Figure 7 This is a graph of prediction results at an 80% confidence level of Example 1 of the present invention.
[0025] Figure 8 This is a graph of prediction results at a 95% confidence level of Example 1 of the present invention.
[0026] Fig. 9 This is a line graph of predicted values and actual values of different models in Example 1 of the present invention.
[0027] Fig.10 This is a system block diagram of a medium- and long-term electricity quantity prediction terminal based on interval estimation of the present invention.
[0028] Description of labels:
[0029] 1. Medium- and long-term electricity forecasting terminal based on interval estimation; 2. Memory; 3. Processor. DETAILED DESCRIPTION
[0030] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.
[0031] Please refer to Figures 1 to 8 ,The medium- and long-term electricity forecasting method based on interval estimation includes the following steps:
[0032] S1. Obtain and decompose the original electricity quantity series into trend component, period component and residual component;
[0033] S2, using a preset neural network model to predict the trend component to obtain a first prediction result, using a preset seasonal difference autoregressive moving average model to predict the period component to obtain a second prediction result, and using a preset interval estimation algorithm to perform interval estimation on the residual component to obtain an interval estimation result;
[0034] S3, integrating the first prediction result, the second prediction result and the interval estimation result to obtain a preliminary power prediction result corresponding to the original power sequence;
[0035] S4. Using a Markov correction algorithm to correct the preliminary power prediction result to obtain a final power prediction result.
[0036] From the above description, it can be seen that the beneficial effects of the present invention are: decomposing the original electricity sequence into a trend component, a periodic component and a residual component, taking the first prediction result and the second prediction result corresponding to the trend component and the periodic component respectively as the deterministic results, and then using a preset interval estimation algorithm to perform interval estimation on the residual component, thereby realizing the medium- and long-term prediction of electricity from the perspective of interval prediction, which not only quantifies the uncertainty of the prediction results, but also obtains the final electricity prediction results through interval value selection and Markov correction. Compared with the existing prediction model algorithm, the prediction accuracy is higher, which further ensures the safe operation of the power grid and has broad application prospects.
[0037] Furthermore, the preset interval estimation algorithm is a quantile Bootstrap algorithm, and the using of the preset interval estimation algorithm to perform interval estimation on the residual component to obtain the interval estimation result specifically includes:
[0038] A preset number of Bootstrap samples are extracted from the historical electricity data, and different confidence levels and their corresponding confidence interval prediction results are calculated based on all the Bootstrap samples. The optimal confidence interval is determined from all the confidence intervals, and the prediction result of the residual component corresponding to the optimal confidence interval is used as the interval estimation result.
[0039] From the above description, we can see that in terms of interval estimation, the quantile Bootstrap algorithm is used to characterize uncertainty and randomness through intervals, so that the uncertainty of power data prediction is quantified, and the optimal confidence interval is used to ensure the optimal coverage of residual components to improve the accuracy of uncertainty estimation.
[0040] Furthermore, the step of determining the optimal confidence interval from all confidence intervals is specifically as follows:
[0041] According to the prediction interval coverage rate PICP and the prediction interval average width PINAW as the quality evaluation indicators of all confidence intervals, the confidence interval with the best quality evaluation is taken as the optimal confidence interval;
[0042] The expression of the prediction interval coverage rate PICP is:
[0043]
[0044] The expression of the prediction interval average width PINAW is:
[0045]
[0046] Among them, N is the number of samples, U t With L t are the upper and lower bounds of the prediction interval, y t is the actual value at time t.
[0047] From the above description, it can be seen that the prediction interval coverage rate PICP and the prediction interval average width PINAW are used as evaluation indicators of interval quality to reflect the accuracy of interval prediction and ensure that the optimal confidence interval obtained in the end is reasonable enough.
[0048] Furthermore, the step S3 further includes:
[0049] Selecting historical final power prediction results and their corresponding real power values from the historical power data as training samples;
[0050] In combination with the training samples, three metrics, namely mean absolute error (MAE), mean relative error (MRE) and root mean square error (RMSE), are used to measure the prediction accuracy of the optimal confidence interval;
[0051] The expression of the mean absolute error MAE is as follows:
[0052]
[0053] The expression of the mean relative error MRE is as follows:
[0054]
[0055] The expression of the root mean square error RMSE is as follows:
[0056]
[0057] Where: y i is the true value, Y i is the predicted value, and n is the number of samples.
[0058] From the above description, we can see that the prediction accuracy is measured from three aspects: mean absolute error MAE, mean relative error MRE and root mean square error RMSE to ensure that the optimal execution confidence interval is reliable enough.
[0059] Furthermore, before step S2, the following steps are also included:
[0060] A genetic algorithm is used to optimize the initial weights and biases of the preset neural network model.
[0061] From the above description, it can be seen that when applying the preset neural network model, a genetic algorithm is used to optimize the initial weights and biases of the preset neural network model to avoid the model falling into a local optimal state, which leads to the problem of poor model prediction performance, and then determine the optimal initial weights and biases.
[0062] Please refer to Fig.10 The medium- and long-term electricity forecasting terminal 1 based on interval estimation includes a memory, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, the following steps are implemented:
[0063] S1. Obtain and decompose the original electricity quantity series into trend component, period component and residual component;
[0064] S2, using a preset neural network model to predict the trend component to obtain a first prediction result, using a preset seasonal difference autoregressive moving average model to predict the period component to obtain a second prediction result, and using a preset interval estimation algorithm to perform interval estimation on the residual component to obtain an interval estimation result;
[0065] S3, integrating the first prediction result, the second prediction result and the interval estimation result to obtain a preliminary power prediction result corresponding to the original power sequence;
[0066] S4. Using a Markov correction algorithm to correct the preliminary power prediction result to obtain a final power prediction result.
[0067] From the above description, it can be seen that the beneficial effects of the present invention are: decomposing the original electricity sequence into a trend component, a periodic component and a residual component, taking the first prediction result and the second prediction result corresponding to the trend component and the periodic component respectively as the deterministic results, and then using a preset interval estimation algorithm to perform interval estimation on the residual component, thereby realizing the medium- and long-term prediction of electricity from the perspective of interval prediction, which not only quantifies the uncertainty of the prediction results, but also obtains the final electricity prediction results through interval value selection and Markov correction. Compared with the existing prediction model algorithm, the prediction accuracy is higher, which further ensures the safe operation of the power grid and has broad application prospects.
[0068] Please refer to Figures 1 to 9, Embodiment 1 of the present invention is:
[0069] The medium- and long-term electricity forecasting method based on interval estimation includes the following steps:
[0070] S1. Obtain and decompose the original electricity quantity series into trend component, period component and residual component;
[0071] In this embodiment, the total social electricity consumption data of a southern city from January 2014 to December 2021 is used as a data set, and the training set and the test set are divided into a ratio of 7:1.
[0072] The total electricity consumption is decomposed into trend component, periodic component and residual component by STL seasonal decomposition algorithm, and the following is obtained: Figure 5 Exploded view shown. Figure 5 It can be seen that the trend component maintains a stable upward trend with obvious regularity; the periodic component is affected by seasonal factors and holiday factors, and shows a certain periodic regularity. For example, the electricity consumption of the whole society drops sharply during the Spring Festival every year, and gradually increases after the Spring Festival; the residual component has no obvious regularity, and the randomness and uncertainty are high.
[0073] Among them, seasonal decomposition: the original electricity series is decomposed into trend component, period component and residual component through STL decomposition algorithm; this application uses the time series seasonal decomposition method STL based on local weighted regression (LOESS) to decompose the total social electricity consumption data into seasonal period component, trend component and residual component. The decomposition formula is as follows:
[0074] Y t =T t +S t +R t (1)
[0075] Where: Y t is the industry electricity consumption at step length t; T t , S t , R t They are the trend component, seasonal cycle component and residual component at step length t respectively.
[0076] The STL algorithm separates different components through inner and outer loop mechanisms, where the inner loop is used to update the trend component and the seasonal cycle component, and the outer loop is used to calculate the robust weight value of the inner loop.
[0077] The inner loop of the STL algorithm obtains the trend component and seasonal cycle component based on LOESS. The specific calculation process of the inner loop is as follows:
[0078]
[0079]
[0080]
[0081]
[0082] Where: k is the number of iterations, is the temporary term obtained by LOESS smoothing subsequence, for The low-pass filter is used to process the low-pass signal. is the seasonal period component obtained in the kth iteration, is the trend component obtained in the kth iteration, is the residual component obtained at the kth iteration.
[0083] The outer loop of the STL algorithm is used to calculate the robust weight value of the inner loop The specific calculation formula is as follows:
[0084]
[0085]
[0086]
[0087] Where: is the robust weight value at step length t; B(u) is the Bisquare function; u is the function independent variable; h is the correction variable; median(·) is used to solve the median.
[0088] S2. Use a preset neural network model to predict the trend component to obtain a first prediction result, use a preset seasonal difference autoregressive moving average model to predict the period component to obtain a second prediction result, and use a preset interval estimation algorithm to perform interval estimation on the residual component to obtain an interval estimation result;
[0089] In this embodiment, based on the above-mentioned STL decomposition, different models are used to predict each component: for the trend component, a prediction neural network model optimized by a genetic algorithm is used for prediction. This application uses data from the past 12 months to predict data for the next month, so the input layer nodes of the prediction neural network model are set to 12, the output layer nodes are set to 1, and the hidden layer nodes are set to 5 based on experience. The initial weights and biases are determined by genetic algorithm optimization.
[0090] Among them, the trend component is predicted by the prediction neural network model optimized by genetic algorithm. The prediction neural network model is a multi-layer feedforward neural network with error back propagation as the core. Its algorithm mainly includes two processes: forward propagation and back propagation. The input signal is forward propagated from the input layer to the hidden layer and finally reaches the output layer. If the output result does not reach the expected value at this time, the network weight and threshold are updated through error back propagation, and this process is repeated until the prediction error reaches the expected value. The algorithm flow structure diagram of the prediction neural network model optimized by genetic algorithm is shown in the figure below. Figure 3 As shown, where X1, X2, …, X n To predict the input signal of the neural network model, O n To predict the output of the neural network model, w ij ,w jk is the weight of the prediction neural network model.
[0091] At the beginning of training, the initial weights and biases of the prediction neural network model are random. If the random values of the initial weights and biases are not good, the model will fall into a local optimal state, resulting in poor model prediction performance. Therefore, this application uses a genetic algorithm to find the optimal initial weights and biases of the network, thereby improving the problem that the prediction neural network model is prone to fall into a local optimal solution.
[0092] Depend on Figure 3 It can be seen that the prediction neural network model optimized by genetic algorithm includes three parts: prediction neural network model structure determination, genetic algorithm optimization parameters, and model training. Among them, the prediction neural network model structure is determined according to the number of input nodes and output nodes; the initial weights and biases are optimized by genetic algorithm. First, the prediction neural network model training error is used as the individual fitness value, and then the genetic algorithm is used to find the individual with the optimal fitness value through selection, crossover and mutation operations; the initial weights and biases of the prediction neural network model are initialized according to the individual corresponding to the optimal fitness value, and the prediction neural network model begins to be trained.
[0093] For the periodic component, the preset seasonal autoregressive integrated moving average model (SARIMA) is used for prediction. The parameters of the SARIMA model include non-seasonal autoregressive order p, non-seasonal difference order d, non-seasonal moving average order q, seasonal autoregressive order P, seasonal difference order D, seasonal moving average order Q, and seasonal cycle length S. According to the Akaike information criterion (AIC), the optimal parameters of the SARIMA model can be found as (p, d, q)(P, D, Q) S =(0,1,0)(1,1,1)12 .
[0094] Among them, the SARIMA model is a method for processing periodic non-stationary time series, and is also one of the most commonly used time series prediction models, which can be abbreviated as:
[0095] SARIMA(p,d,q)(P,D,Q) S (9)
[0096] Among them, (p, d, q) is the non-seasonal term, (P, D, Q) is the seasonal term, p is the non-seasonal autoregressive order, d is the non-seasonal difference order, q is the non-seasonal moving average order, P is the seasonal autoregressive order, D is the seasonal difference order, Q is the seasonal moving average order, S is the length of the seasonal cycle, and its model expression is:
[0097]
[0098] In the above formula, is the p-order autoregressive operator, Φ is the P-order seasonal autoregressive coefficient, ▽ d is the difference operator, is the seasonal difference operator, Z t is the observed value at time t, θ is the q-order moving average operator, Θ is the Q-order seasonal moving average coefficient, a t is the white noise component.
[0099] For the residual component, due to its high uncertainty and small number of samples, the quantile Bootstrap method is used to perform interval estimation on the residual component. The quantile Bootstrap method is used to perform interval estimation. The specific method is as follows:
[0100] Assume that the overall F distribution is unknown, X=(X1,X2,…,X n ) is a sample of capacity n in F, x=(x1,x2,…,x n ) is a known sample value, and F contains unknown key parameters θ. is the estimator of θ. Now we use the quantile Bootstrap method to solve the confidence interval of θ with a confidence level of 1-α. The specific steps are as follows:
[0101] The Bootstrap method is used to observe the sample sequence x=(x1, x2,…, x n ) extract B Bootstrap pseudo samples of capacity n, and for each Bootstrap sample, find the Bootstrap estimate of θ: Then arrange them from smallest to largest:
[0102]
[0103] in, The Bth one after the arrangement value.
[0104] Pick Bundle The distribution of is considered as a similar distribution of R(X), and R(X * ) distribution approximate quantile make:
[0105]
[0106] Correspondingly, we can obtain:
[0107]
[0108] make Then θ is 1 The Bootstrap confidence interval at the -α confidence level is
[0109] The quantile Bootstrap method is used to perform interval estimation on the residual components. The specific design process is as follows:
[0110] Step 1: Bootstrap sampling. Randomly extract the test set length data from the training set data with replacement, set it as a Bootstrap sample, create 50,000 Bootstrap samples, and get a 50,000×12 matrix.
[0111] Step 2: Quantile confidence interval estimation. Arrange the data in ascending order by column, and calculate the upper and lower bounds of the interval with confidence levels of {80%, 85%, 90%, 95%} for each column of data, and then obtain the upper and lower bound sequence.
[0112] Step S3: Prediction interval quality assessment. The confidence interval prediction results at different confidence levels are as follows: Figure 5 As shown; PICP and PINAW at different confidence levels are shown in Table 1:
[0113] Table 1 PICP and PINAW at different confidence levels
[0114] Confidence level / % PICP / % PINAW 80 91.6 152897.01 85 91.6 171324.47 90 91.6 196677.74 95 100 255176.37
[0115] It should be noted that the prediction interval coverage rate PICP and the prediction interval average width PINAW are used as evaluation indicators of interval quality. PICP refers to the probability that the true value falls within the prediction interval, which is used to reflect the accuracy of the interval prediction; PINAW refers to the narrowness of the prediction interval. When PICP is constant, the smaller the PINAW, the higher the interval prediction accuracy. Therefore, according to the prediction interval coverage rate PICP and the prediction interval average width PINAW as the quality evaluation indicators of all confidence intervals, the confidence interval with the best quality evaluation is taken as the optimal confidence interval;
[0116] The expression of prediction interval coverage rate PICP is:
[0117]
[0118] The expression of the average width of the prediction interval PINAW is:
[0119]
[0120] Among them, N is the number of samples, Ut and Lt are the upper and lower bounds of the prediction interval, and yt is the actual value at time t.
[0121] It can be seen from Table 1 that on the current test set, the prediction interval coverage can reach the given confidence level. The interval coverage of 80%, 85% and 90% confidence levels all reach 91.6%, but the average width of the prediction interval at the 80% confidence level is the smallest. Therefore, the confidence intervals at the 85% and 90% confidence levels are excluded, and the optimal confidence interval between the 80% confidence level and the 95% confidence level is selected as the optimal confidence interval.
[0122] Depend on Figure 6 It can be seen that the confidence intervals of the residual components under different confidence levels cover different ranges. As the confidence level increases, the average width and coverage of the prediction interval gradually increase, and the coverage of the residual components is also better. However, due to the strong randomness of the residual components, the coverage effect of the application method is poor in areas with large fluctuations (such as January 2021), which directly leads to a decrease in the coverage rate of some prediction intervals.
[0123] According to the above uncertainty component prediction, the optimal confidence interval of the residual component at the confidence level of 80% and 95% can be obtained. By superimposing the prediction results of the other components (trend component and periodic component), the interval prediction results of the total social electricity consumption can be obtained. In order to further quantify the interval prediction results, the historical final electricity prediction results and their corresponding real electricity values are selected from the historical electricity data as training samples; combined with the training samples, the three metrics of mean absolute error MAE, mean relative error MRE and root mean square error RMSE are used to measure the prediction accuracy of the optimal confidence interval. Figure 7 , Figure 8They are the prediction results at 80% confidence level and 95% confidence level respectively. Table 2 shows the specific prediction results.
[0124] Table 2 Specific prediction results
[0125] Confidence Level MAE RMSE MRE(%) 80% 43550.19 59422.08 1.89 95% 36877.09 51472.57 1.58
[0126] Depend on Figure 7 , Figure 8 It can be seen that the confidence interval of 80% confidence level is small, which cannot cover all true values, and is not conducive to analyzing the situation of large data fluctuations; the confidence interval of 95% confidence level is large, which can not only cover all true values, but also cope with the situation of large data fluctuations. As shown in Table 2, the MRE of the prediction result at 80% confidence level is 1.89%, and the MRE of the prediction result at 95% confidence level is 1.58%. In summary, this embodiment selects the optimal confidence interval of 95% confidence level as the final prediction interval.
[0127] in;
[0128] The expression of mean absolute error MAE is as follows:
[0129]
[0130] The expression of mean relative error MRE is as follows:
[0131]
[0132] The expression of root mean square error RMSE is as follows:
[0133]
[0134] Where:y i is the true value, Y i is the predicted value, and n is the number of samples.
[0135] S3, integrating the first prediction result, the second prediction result and the interval estimation result to obtain a preliminary power prediction result corresponding to the original power sequence;
[0136] In this embodiment, the deterministic prediction results of the trend component and the period component are superimposed with the interval estimation result of the residual component to obtain an interval prediction result, and the average value of the interval is taken as the preliminary power prediction result.
[0137] S4. Use the Markov correction algorithm to correct the preliminary power forecast result to obtain the final power forecast result.
[0138] In this embodiment, the Markov correction method is used to correct the temporary results to obtain the final prediction value; Markov chain refers to a Markov process with discrete time and state. Markov chain prediction is to predict the future state based on the probability transfer matrix between each state of the system and its corresponding initial state. The specific definition of Markov chain can be expressed by the following conditional probability:
[0139] Assume that some non-negative time integer set T = {0,1,2,...,n}, state E = {E0,E1E2,...,E n} is a discrete random process. For any time n, if the conditional probability satisfies:
[0140] P={P n+1 =E n+1 ∣P n =E n} (19)
[0141] Then {E n ,n∈T} is a Markov chain. From the above expression, we can see that the future state E n+1 Only with the current state E n It is related to the past state, and has nothing to do with the past state. This property is also called Markov's non-effect property.
[0142] The probability of transitioning from one state to the next is expressed by the Markov state transition probability, P ij It is from state E i Transfer to state E j The conditional probability is:
[0143] P ij (n) = P{E n+1 =j|E n =i}=f ij / f i (20)
[0144] In the formula, f ij is the frequency of state i transitioning to state j in one step, f i is the frequency of occurrence of state i, and the k-step state transition probability matrix P (k) It can be expressed as:
[0145]
[0146] The above state transition probability matrix satisfies:
[0147]
[0148] If the known initial state is R (0) , then we can find the state R at time k (k) =R(0) P (k) The states of the first m months of the predicted month are taken as the initial states, and the probability vectors of each initial state to the predicted month are calculated by combining the corresponding state probability transfer matrix. Where i∈I is the state, k is the step length (k≤m). The state probabilities of different step lengths in the same state are added together as the probability of the predicted month being in that state, that is:
[0149]
[0150] The state corresponding to the maximum predicted probability max{p i , i∈I} as the predicted month state. The Markov correction prediction value is the state E of the relative error at that moment j and the predicted value at that time Decision, Status E j The upper and lower bounds of j ,N j+ ], the final prediction value expression is:
[0151]
[0152] Among them, the positive and negative signs in the formula are selected according to the state range.
[0153] This application uses three metrics, mean absolute error (MAE), mean relative error (MRE), and root mean square error (RMSE) to measure prediction accuracy;
[0154]
[0155]
[0156]
[0157] Where: y i is the true value; Y i is the predicted value; n is the number of samples.
[0158] In this embodiment, the relative error of the above temporary prediction result is corrected using the Markov correction model, and the specific steps are as follows:
[0159] 1) Interval division
[0160] Taking the relative error in January as an example, according to the positive and negative and size of the relative error, it is divided into three states. The intervals (-0.0540, -0.0063], (-0.0063, 0.0667], and (0.0667, 0.1270] correspond to states E1, E2, and E3 respectively.
[0161] 2) Calculate the state transition probability matrix for each step
[0162] When the step length is 1, the state transition probability matrix of one step is
[0163]
[0164] When the step length is 2, the two-step state transition probability matrix
[0165]
[0166] When the step length is 3, the three-step state transition probability matrix
[0167]
[0168] 3) Markov correction
[0169] The relative error state prediction for January 2021 is shown in Table 3. It can be seen from Table 3 that the probability of the relative error in state 3 in January 2021 is the highest, that is, the relative error range is most likely to be (-0.0540, -0.0063]. According to the Markov correction formula, the total social electricity consumption in January 2021 is 21296027800 kWh. Similarly, the total social electricity consumption in other months is predicted.
[0170] Table 3 Relative error status forecast for January 2021
[0171]
[0172] The electricity consumption forecast values from January to December 2021 are shown in Table 4. Table 4 compares the model of this application with the model without interval estimation and the interval estimation model, and verifies the effectiveness of the model of this application by comparing the relative errors of different prediction models.
[0173] Table 4 Revised values from January to December 2021
[0174]
[0175]
[0176] As shown in Table 4, the MRE of the model in this application is 1.35%, the MRE of the interval estimation model is 1.58%, and the MRE of the model without interval estimation is 1.76%. Compared with the other two models, the prediction accuracy of the model in this application is higher and the effect is better. Fig. 9 It is a line chart of predicted values and actual values of different models. Fig. 9 It can be seen that the predicted value of the application model is most consistent with the actual value.
[0177] Please refer to Fig.10 , Embodiment 2 of the present invention is:
[0178] The medium- and long-term electricity forecasting terminal 1 based on interval estimation includes a memory, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, the medium- and long-term electricity forecasting method based on interval estimation of embodiment 1 is implemented.
[0179] In summary, the medium- and long-term electricity forecasting method and terminal based on interval estimation provided by the present invention decompose the original electricity sequence into a trend component, a periodic component and a residual component, and use the first prediction result and the second prediction result corresponding to the trend component and the periodic component respectively as the deterministic results, and then use a preset interval estimation algorithm to perform interval estimation on the residual component, thereby realizing the medium- and long-term electricity forecasting from the perspective of interval prediction, which not only quantifies the uncertainty of the prediction results, but also obtains the final electricity forecasting result through interval value taking and Markov correction. Compared with the existing prediction model algorithm, the prediction accuracy is higher, which further ensures the safe operation of the power grid and has broad application prospects.
[0180] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A medium- and long-term electricity forecasting method based on interval estimation is characterized by: The steps include: S1. Obtain and decompose the original electricity quantity series into trend component, period component and residual component; S2, using a preset neural network model to predict the trend component to obtain a first prediction result, using a preset seasonal difference autoregressive moving average model to predict the period component to obtain a second prediction result, and using a preset interval estimation algorithm to perform interval estimation on the residual component to obtain an interval estimation result; S3, integrating the first prediction result, the second prediction result and the interval estimation result to obtain a preliminary power prediction result corresponding to the original power sequence; S4. Using a Markov correction algorithm to correct the preliminary power prediction result to obtain a final power prediction result.
2. The medium- and long-term electricity forecasting method based on interval estimation according to claim 1 is characterized in that: The preset interval estimation algorithm is a quantile Bootstrap algorithm, and the interval estimation of the residual component using the preset interval estimation algorithm to obtain the interval estimation result specifically includes: A preset number of Bootstrap samples are extracted from the historical electricity data, and different confidence levels and their corresponding confidence interval prediction results are calculated based on all the Bootstrap samples. The optimal confidence interval is determined from all the confidence intervals, and the prediction result of the residual component corresponding to the optimal confidence interval is used as the interval estimation result.
3. The medium- and long-term electricity forecasting method based on interval estimation according to claim 2 is characterized in that: The method of determining the optimal confidence interval from all confidence intervals is specifically as follows: According to the prediction interval coverage rate PICP and the prediction interval average width PINAW as the quality evaluation indicators of all confidence intervals, the confidence interval with the best quality evaluation is taken as the optimal confidence interval; The expression of the prediction interval coverage rate PICP is: The expression of the prediction interval average width PINAW is: Among them, N is the number of samples, U t With L t are the upper and lower bounds of the prediction interval, y t is the actual value at time t.
4. The medium- and long-term electricity forecasting method based on interval estimation according to claim 2 is characterized in that: The step S3 further comprises: Selecting historical final power prediction results and their corresponding real power values from the historical power data as training samples; In combination with the training samples, three metrics, namely mean absolute error (MAE), mean relative error (MRE) and root mean square error (RMSE), are used to measure the prediction accuracy of the optimal confidence interval; The expression of the mean absolute error MAE is as follows: The expression of the mean relative error MRE is as follows: The expression of the root mean square error RMSE is as follows: Where: y i is the true value, Y i is the predicted value, and n is the number of samples.
5. The medium- and long-term electricity forecasting method based on interval estimation according to claim 1 is characterized in that: Before step S2, the following steps are also included: A genetic algorithm is used to optimize the initial weights and biases of the preset neural network model.
6. A medium- and long-term electricity forecasting terminal based on interval estimation, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: S1. Obtain and decompose the original electricity quantity series into trend component, period component and residual component; S2, using a preset neural network model to predict the trend component to obtain a first prediction result, using a preset seasonal difference autoregressive moving average model to predict the period component to obtain a second prediction result, and using a preset interval estimation algorithm to perform interval estimation on the residual component to obtain an interval estimation result; S3, integrating the first prediction result, the second prediction result and the interval estimation result to obtain a preliminary power prediction result corresponding to the original power sequence; S4. Using a Markov correction algorithm to correct the preliminary power prediction result to obtain a final power prediction result.
7. The medium- and long-term electricity quantity prediction terminal based on interval estimation according to claim 6 is characterized in that: The preset interval estimation algorithm is a quantile Bootstrap algorithm, and the interval estimation of the residual component using the preset interval estimation algorithm to obtain the interval estimation result specifically includes: A preset number of Bootstrap samples are extracted from the historical electricity data, and different confidence levels and their corresponding confidence interval prediction results are calculated based on all the Bootstrap samples. The optimal confidence interval is determined from all the confidence intervals, and the prediction result of the residual component corresponding to the optimal confidence interval is used as the interval estimation result.
8. The medium- and long-term electricity quantity prediction terminal based on interval estimation according to claim 7 is characterized in that: The method of determining the optimal confidence interval from all confidence intervals is specifically as follows: According to the prediction interval coverage rate PICP and the prediction interval average width PINAW as the quality evaluation indicators of all confidence intervals, the confidence interval with the best quality evaluation is taken as the optimal confidence interval; The expression of the prediction interval coverage rate PICP is: The expression of the prediction interval average width PINAW is: Among them, N is the number of samples, U t With L t are the upper and lower bounds of the prediction interval, y t is the actual value at time t.
9. The medium- and long-term electricity quantity prediction terminal based on interval estimation according to claim 7 is characterized in that: The step S3 further comprises: Selecting historical final power prediction results and their corresponding real power values from the historical power data as training samples; In combination with the training samples, three metrics, namely mean absolute error (MAE), mean relative error (MRE) and root mean square error (RMSE), are used to measure the prediction accuracy of the optimal confidence interval; The expression of the mean absolute error MAE is as follows: The expression of the mean relative error MRE is as follows: The expression of the root mean square error RMSE is as follows: Where: y i is the true value, Y i is the predicted value, and n is the number of samples.
10. The medium- and long-term electricity quantity prediction terminal based on interval estimation according to claim 6, characterized in that: Before step S2, the following steps are also included: A genetic algorithm is used to optimize the initial weights and biases of the preset neural network model.