Short-term wind power forecast method based on segmentation ant group algorithm optimization SVM
Technical field
The invention belongs to wind-power electricity generations and interconnection technology field, in particular to a kind of to optimize SVM based on segmentation ant group algorithm
Short-term wind power forecast method.
Background technique
Although the extensive development of wind-powered electricity generation effectively alleviates energy crisis and problem of environmental pollution, due to influencing wind
The factor of energy is numerous, causes blower power output there are randomness, fluctuation and unstability, brings not exclusively controllable feature,
And large-scale wind power is accessed and is affected to the stable operation and scheduling of electric system, therefore accurate short-term wind-electricity power prediction
It is particularly significant for promoting the operation of electric system economic stability.
Support vector machines is used widely because of its excellent High Dimensional Mapping ability.The wherein core letter of support vector machines
Nonlinear separability sample is transformed into the feature space of linear separability by number, and kernel functional parameter γ determines mapped function relation, from
And it also determines sample and is mapped to the complexity of feature space;Meanwhile penalty coefficient C can make model in complexity and mistake
A balance is made between poor size, also has large effect to the extensive Generalization Ability of SVM.Therefore the parameter of support vector machines
That is the selection of kernel functional parameter γ and penalty coefficient C determines the performance superiority and inferiority of model.
For the selection of kernel functional parameter γ and penalty coefficient C, (2012) such as Huang Jun are raw are with cross-validation method optimization branch
The kernel functional parameter γ and penalty coefficient C for holding vector machine, effectively increasing precision of prediction, [Huang Junsheng is based on wavelet analysis and branch
Hold the wind power prediction [D] of vector machine;Shandong University, 2012.], Wang Chunmei equal (2017) combines BP neural network and support
Vector machine can accurate prediction Future Data [Wang Chunmei data mining neural network based to historical data training
Algorithm research [J] modern electronic technology, 2017,40 (11): 111-114.].But it is insufficient that these methods have several points: intersection is tested
Demonstration is to fix a parameter first, and the method for adjusting another parameter, there are certain masters on determining parameter for this method
The property seen, it is more difficult to obtain optimum network structure, and this method operational efficiency is low, be unfavorable for calculating;And neural network method is
Gradient decline is done in a higher dimensional space, it is easy to be fallen into local optimum, be caused search study to be stagnated, limit model
Habit ability.
Summary of the invention
Cross validation and neural network in short-term wind-electricity power prediction are solved the object of the present invention is to provide a kind of
It is easy to be influenced and fallen into the insufficient segmentation ant group optimization support vector machines of local optimum by subjective factor in parameter selection
Prediction technique.
Realize the technical solution of the object of the invention are as follows: a kind of short-term wind-electricity power based on segmentation ant group algorithm optimization SVM
Prediction technique, comprising the following steps:
Step 1 chooses sample initial data and is pre-processed the influence to eliminate dimension to initial data to it, wherein
Initial data includes environmental impact factor wind power output power corresponding with its that M group influences wind power output power;
Step 2, the data obtained according to step 1, determine the structure of support vector machines;
Step 3, kernel functional parameter γ and punishment system in conjunction with the structure of step 2 support vector machines, to support vector machines
Number C carries out segmentation ant group optimization, obtains the best parameter group for meeting the SVM of anticipation error;
The best parameter group of step 4, the SVM obtained according to step 3 constructs SVM model, that is, wind power prediction model,
Short-term wind-electricity power can be realized using the model to predict.
Compared with prior art, the present invention its remarkable advantage are as follows: 1) learnt by known historical data to short-term wind
Electric output power carries out more accurate prediction, provides technical support for the large-scale grid connection of wind-power electricity generation;2) using segmentation ant
The parameter of group's algorithm optimization support vector machines, simultaneously scans for the parameter value of γ, C in the process, can obtain what accuracy rate was optimal
Parameter combination, avoiding artificial subjectivity bring influences;3) each group parameter mutually decouples in searching process, convenient for parallel meter
It calculates, improves parameter selection speed, operational efficiency is high;4) segmentation ant group algorithm is recycled using two parts, different search solutions
Mechanism strengthens the exploration to solution space, enhances ability of searching optimum, avoids falling into local optimum, is greatly reduced pre-
Survey error.
The present invention is described in further detail with reference to the accompanying drawing.
Detailed description of the invention
Fig. 1 is that the present invention is based on the short-term wind power forecast method flow charts that segmentation ant group algorithm optimizes SVM.
Fig. 2 is the part initial data of the 6 kinds of input influence factors and wind power output power selected in the embodiment of the present invention
Schematic diagram.
Fig. 3 is the result schematic diagram that ant colony algorithm optimization support vector machine penalty coefficient C is segmented in the embodiment of the present invention.
Fig. 4 is the result signal that ant colony algorithm optimization support vector machine kernel functional parameter γ is segmented in the embodiment of the present invention
Figure.
Fig. 5 is that ant colony algorithm optimization support vector machine parametric procedure error curve diagram is segmented in the embodiment of the present invention.
Fig. 6 is the prediction result and real data comparison diagram of the method for the present invention in the embodiment of the present invention.
Fig. 7 is tradition SVM model prediction result and real data comparison diagram in the embodiment of the present invention.
Fig. 8 is the method for the present invention and tradition SVM model predictive error comparison diagram in the embodiment of the present invention, wherein figure (a) is
Mean absolute percentage error comparison result figure, figure (b) are that mean square error compares result figure.
Specific embodiment
In conjunction with Fig. 1, the present invention is based on the short-term wind power forecast method of segmentation ant group algorithm optimization SVM, including it is following
Step:
Step 1 chooses sample initial data and is pre-processed the influence to eliminate dimension to initial data to it, wherein
Initial data includes environmental impact factor wind power output power corresponding with its that M group influences wind power output power;
Step 2, the data obtained according to step 1, determine the structure of support vector machines (SVM);
Step 3, kernel functional parameter γ and punishment system in conjunction with the structure of step 2 support vector machines, to support vector machines
Number C carries out segmentation ant group optimization, obtains the best parameter group for meeting the SVM of anticipation error;
The best parameter group of step 4, the SVM obtained according to step 3 constructs SVM model, that is, wind power prediction model,
Short-term wind-electricity power can be realized using the model to predict.
It is further preferred that the environmental impact factor for influencing wind power output power in step 1 includes wind speed, wind direction sine
Value, wind direction cosine value, gas epidemic disaster and air pressure.
It is further preferred that specially normalized is pre-processed to initial data in step 1, by sample original number
According to being retractable to section [0,1].
It is exemplary preferably, normalized specifically uses min-max method for normalizing.
Further, the structure of support vector machines is specially Radial basis kernel function in step 2, the functional form are as follows:
K (x, y)=exp (- γ ‖ x-y ‖2)
In formula, γ is kernel functional parameter, and x is input environment influence factor variable, and y is wind power output power variable;Wherein x
To influence the multi-C vector that the environmental impact factor of wind power output power is constituted.
Further, the structure that step 2 support vector machines is combined described in step 3, to the kernel functional parameter of support vector machines
γ and penalty coefficient C carries out segmentation ant group optimization, obtains the best parameter group for meeting the SVM of anticipation error, specifically:
Step 3-1, the support vector machines structure established according to step 2, forms n sample matrix, and each matrix is one group
The multi-C vector that the environmental impact factor and wind power output power for influencing wind power output power are constituted;
Step 3-2, using p sample matrix in n sample matrix as training sample, remaining sample matrix is as test
Sample;
Step 3-3, search space size is determined according to the value range of parameter C and γ to be optimized, number of significant digit;
Step 3-4, determine that ant colony scale is m, pheromones factor of evaporation ρ, pheromones intensity Q, pheromones initial value
τ, pheromones heuristic factor α, ant initial crawl speed λ, visibility heuristic factor β, first stage the number of iterations N1And it is maximum
The number of iterations N2;
Step 3-5, in conjunction with step 3-2, step 3-3 and step 3-4, kernel functional parameter γ to support vector machines and
Penalty coefficient C carries out segmentation ant group optimization, and current iteration times N and N are judged in optimization process1、N2Size relation, if working as
Preceding the number of iterations N≤N1, the first stage in segmentation ant group optimization, execution step 3-6, step 3-7;If current iteration number
N1≤N<N2, the second stage in segmentation ant group optimization, execution step 3-8, step 3-9;
Step 3-6, every ant is placed in a certain start node, every ant randomly selects next node, configuration information
Prime matrix, calculates the reality output of current support vector machines, and calculates training error;
Step 3-7, it is obtained according to the reality output of the step 3-6 support vector machines obtained and training error when time iteration ginseng
Number optimal solution, and Pheromone Matrix is updated, later by the number of iterations N cumulative 1,3-5 is returned to step until reaching the first rank
Section the number of iterations N1;
Step 3-8, every ant is randomly placed on a certain start node again, the pheromones obtained according to step 3-7 are dense
The method of the state transition probability P of the determining ant of degree, join probability P and roulette determines the next node that ant reaches, and calculates
The reality output of current support vector machines, and calculate training error;
Step 3-9, the size relation of judgment step 3-8 is calculated training error and anticipation error, if training error is greater than
Anticipation error updates Pheromone Matrix, and is less than maximum number of iterations N in current iteration times N2In the case where, by iteration time
Number N cumulative 1 simultaneously repeats step 3-8, step 3-9;If training error is less than anticipation error or the number of iterations N >=N2, output is most
Excellent parameter combination.
Below with reference to embodiment, the present invention is described in further detail.
Embodiment
The present invention is based on the short-term wind power forecast methods of segmentation ant group algorithm optimization SVM, including the following contents:
1, consider the factor that is affected to wind power, select wind speed, wind direction sine value, wind direction cosine value, temperature, wet
Degree and environmental impact factor of 6 indexs of air pressure as wind power output power, and it is enabled to carry out simulation study as input.This reality
The initial data acquired in example is applied as shown in Fig. 2, acquisition data are using 1 hour as interval, include on January 1st, 2012 extremely
The data on January 11st, 2012.Using the data in January 1 to January 10 as model training collection, the data on January 11 are as survey
Examination collection, predicts the wind power output power on January 11, then the data with prediction time same time actual measurement compare.
2, initial data is normalized using min-max method for normalizing.Min-max normalization uses
Mapminmax function is mapped to data value on [0,1] section.Convert function are as follows:
In formula, x is input;Y is the output after mapping;[ymin ymax] be mapping after range;xmin、xmaxIt is respectively defeated
Enter minimum value, the maximum value in data set x.
3, search space size is determined according to the value range of support vector machines parameter C and γ to be optimized, number of significant digit.If
The number of significant digit for determining penalty coefficient C is 5, and highest order is kilobit, and precision is 1 after decimal point, value range be (0,
9999.9];The number of significant digit of nuclear parameter γ is also 5, and highest order is position, value range be (0,9.9999], such root
One 10 × 10 region of search is established according to the value of number of significant digit.Abscissa x represents ant in the i-th layer choosing routing diameter, indulges
The numerical value of final choice when coordinate y represents ant edge selection each time.
Then to segmentation ant group algorithm setup parameter, if ant colony scale be m=20, pheromones factor of evaporation ρ=
0.8, pheromones intensity Q=0.75, pheromones initial value τ=1, pheromones heuristic factor α=0.5, ant initial crawl speed λ
=0.4, visibility heuristic factor β=1, ant colony maximum number of iterations N=30.The optimum results of penalty coefficient C as shown in figure 3,
The optimum results of kernel functional parameter γ are as shown in figure 4, Support Vector Machines Optimized parametric procedure error curve diagram is as shown in Figure 5.
It can be seen from Fig. 3,4,5 when parameter cyclic the number of iterations is greater than 10 times, the error of model and the value of parameter
It has been tended towards stability that, i.e. C=9344.5, when γ=0.0104, error minimum 0.0014.
4, the optimized parameter of the support vector machines kernel functional parameter and penalty coefficient optimized according to segmentation ant group algorithm, i.e.,
Penalty coefficient C=9344.5, kernel functional parameter γ=0.0104, calculate coefficient b*=0.1386, there is 12 supporting vectors, point
Not Wei the 2,7,15,24,41,77,81,109,128,146,173,202nd time data.According to the coefficient of calculating and training
Obtained optimized parameter obtains the prediction model of support vector machines are as follows:
Wherein, xiIt (i=2,7,15,24,41,77,81,109,128,146,173,202) is supporting vector machine model
Supporting vector, x are wind power index value vector to be measured.It enablesFor the Lagrange multiplier of corresponding supporting vector,
Wherein m2=0.024, m7=0.137, m15=0.076, m24=0.081, m41=0.192, m77=0.041, m81=0.024,
m109=0.175, m128=0.039, m146=0.153, m173=0.065, m202=0.058.
5, using the model prediction result of present invention segmentation ant colony algorithm optimization support vector machine as shown in fig. 6, it is punished
Coefficient C=9344.5, kernel functional parameter γ=0.0104, the mean square error (MSE) of prediction result are 0.1857, average absolute hundred
Dividing ratio error (MAPE) is 0.1392.
Using the obtained prediction result of traditional SVM as shown in fig. 7, its penalty factor=9542.6, kernel functional parameter γ=
0.0004, the mean square error (MSE) of prediction result is 0.2068, mean absolute percentage error (MAPE) is 0.2005.
Two kinds of model prediction resultant errors are compared as follows shown in table 1 and Fig. 8.By comparison as can be seen that of the invention is pre-
The mean square error (MSE) for surveying result is 0.1857, mean absolute percentage error (MAPE) is 0.1392, is verified than conventional cross
SVM prediction fluctuating error is small, and precision of prediction is higher, shows better prediction effect.
The each model prediction resultant error of table 1 compares
Prediction technique |
MSE |
MAPE |
Cross validation SVM |
0.2068 |
0.2005 |
SACO-SVM |
0.1857 |
0.1392 |
The present invention is a kind of for study historical data progress wind power prediction by providing, in the subjectivity of cross validation
Influence and neural network be easily trapped into the insufficient situation of local optimum, solve support vector machines find best parameter group into
The problem of row wind power prediction.It is verified through practical application, this method substantially reduces wind power output power prediction fluctuating error,
Precision of prediction is higher.