Disclosure of Invention
The purpose of the invention is as follows: the invention provides a traffic flow prediction model parameter calibration method based on a response curved surface, which can realize the rapid calibration of traffic flow prediction model parameters and obtain the optimal calibration result.
The technical scheme is as follows: the invention relates to a traffic flow prediction model parameter calibration method based on a response surface, which comprises the following steps:
s1, determining a solution space of the traffic flow prediction model parameters; traffic flow prediction model f (beta)1,β2,…,βn) With n parameters beta1,β2,…,βnThe value range of each parameter is the solution space of each parameter, and is respectively expressed as Z1,Z2,…,Zn;
S2, calculating a model error under the initialization parameter combination;
s21, solution space Z of the parameters determined in step S11,Z2,…,ZnIn the method, m groups of values of n parameters are randomly extracted by adopting a Latin hypercube sampling method to form a parameter library U which is expressed as { beta [ ]1 1,β2 1,…,βn 1},{β1 2,β2 2,…,βn 2},…,{β1 m,β2 m,…,βn m}; wherein m is>0.5n2+1.5n+1;
S22, calculating a traffic flow prediction model f (beta) under the condition of m groups of parameter values1,β2,…,βn) M sets of predicted results X1,X2,…,Xm;
S23, calculating the error between the m groups of prediction results and the corresponding real results, wherein the error calculation formula is as follows:
εi=|Yi-Xi|,i∈{1,2,...,m}
wherein, XiFor the i-th group of predictors, YiAnd the real result is corresponding to the ith group of prediction results.
S3, generating a response surface between the parameters and the model errors; for the m sets of prediction errors of step S23, fitting the prediction errors epsilon and n parameters (beta) by using a multiple quadratic regression equation g1,β2,…,βn) The functional relationship between ═ g (. beta.), (beta.)1,β2,…,βn) The functional relation is the current response curved surface between the parameter and the model error; solving by using maximum likelihood estimation or a least square method during fitting;
s4, testing convergence; if any one of the following convergence conditions is met or two convergence conditions are met simultaneously, the convergence test is passed, and a final calibration result of the model parameters is output: in the solution space Z of the parameters1,Z2,…,ZnSolving the current response curved surface g (beta) by adopting a Newton method in the range1,β2,…,βn) The corresponding parameter combination of the lowest point; otherwise, the convergence does not pass, and the process advances to step S5;
convergence condition 1:
wherein e is the maximum allowable error;
convergence condition 2: m > M, wherein M is the maximum number of tests;
s5, determining the next parameter combination point;
s51, solving space Z in parameter1,Z2,…,ZnIn the range, the current response curved surface g (beta) is solved by adopting a Newton method1,β2,…,βn) Corresponding to the lowest point of { beta } in the parameter set1 k,β2 k,…,βn k};
S52, solving space Z in parameter
1,Z
2,…,Z
nWithin the range, a set of parameter combinations { beta } is randomly chosen
1 l,β
2 l,…,β
n lIf the parameter combination { beta }
1 l,β
2 l,…,β
n lRe-extracting if the element belongs to U until the extracted parameter combination
S53, randomly selecting one parameter from the two parameter combinations generated in the steps S51 and S52 according to 1/2 probability as the next parameter combination point;
s54, adding the next parameter combination point determined in the step S53 into a parameter base U, and updating m to m + 1;
s6, calculating the model error under the parameter combination point; the next parameter combination point determined in step S53 is calculated in step S22, and the traffic flow prediction model f (β)1,β2,…,βn) The prediction error at this point is calculated by the method of step S23, and the process returns to step S3.
Has the advantages that:
1) the response surface of the invention can approximate the mapping relation between the multivariate parameter and the prediction error, and does not need to calculate the model prediction results under all parameter combinations, thereby greatly saving the time occupied by model trial calculation, being particularly effective when the model parameter combinations are more, and realizing the rapid calibration of the traffic flow prediction model parameters.
2) Compared with a conventional heuristic algorithm, the method disclosed by the invention has the advantages of both search efficiency and fairness. When the search direction of the solution is determined, on one hand, efficient search is considered, and the optimal solution under the current response curved surface is searched; on the other hand, other space ranges which are not collected are continuously explored through convergence test, the obtained calibration result is prevented from being limited to a local optimal solution, and the optimal calibration result is obtained in a plurality of groups of parameter combinations which approach to the real result.
3) The method can cope with more diversified scenes. The method of the invention can be applied to continuous parameters, discrete parameters, integer parameters and combinations thereof; further, the traffic flow prediction model may be various, such as machine learning, deep learning, time series, and the like.
4) The method is simple to operate and easy to program.
Detailed Description
As shown in fig. 1, the traffic flow prediction model parameter calibration method based on the response surface provided by the invention includes the following steps: s1, determining a solution space of the traffic flow prediction model parameters; s2, calculating a model error under the initialization parameter combination; s3, generating a response surface between the parameters and the model errors; s4, testing convergence; s5, determining the next parameter combination point; s6, calculating the model error at the parameter combination point.
S1: determining a solution space for traffic flow prediction model parameters
Traffic flow prediction model f (beta)1,β2,…,βn) With n parameters beta1,β2,…,βnThe value range of each parameter is the solution space of each parameter, and is respectively expressed as Z1,Z2,…,Zn;
S2: calculating model error under initialization parameter combination
The solution space Z of the parameters determined at step S11,Z2,…,ZnIn the method, m groups of values of n parameters are randomly extracted by adopting a Latin hypercube sampling method to form a parameter library U which is expressed as { beta [ ]1 1,β2 1,…,βn 1},{β1 2,β2 2,…,βn 2},…,{β1 m,β2 m,…,βn m}; wherein m is>0.5n2+1.5n+1;
Calculating a traffic flow prediction model f (beta) under the condition of m groups of parameter values1,β2,…,βn) M sets of predicted results X1,X2,…,Xm;
And calculating the error between the m groups of predicted results and the corresponding real results, wherein the error calculation formula is as follows:
εi=|Yi-Xi|,i∈{1,2,...,m}
wherein, XiIs the ith group of prediction results; y isiThe real result corresponding to the prediction result of the ith group can be obtained by field observation and collection under corresponding conditions.
S3: generating a response surface between parameters and model errors
For the m sets of prediction errors of step S2, fitting the prediction errors epsilon and n parameters (beta) by using a multiple quadratic regression equation g1,β2,…,βn) The functional relationship between ═ g (. beta.), (beta.)1,β2,…,βn) The functional relation is the current response curved surface between the parameter and the model error; solving by using maximum likelihood estimation or a least square method during fitting;
s4: convergence test
If any one of the following convergence conditions is met or two convergence conditions are met simultaneously, the convergence test is passed, and a final calibration result of the model parameters is output: in the solution space Z of the parameters1,Z2,…,ZnSolving the current response curved surface g (beta) by adopting a Newton method in the range1,β2,…,βn) The corresponding parameter combination of the lowest point; otherwise, the convergence does not pass, and the process advances to step S5;
convergence condition 1:
wherein e is the maximum allowable error;
convergence condition 2: m > M, wherein M is the maximum number of tests;
s5: determining a next parameter combination point
In the solution space Z of the parameters1,Z2,…,ZnIn the range, the current response curved surface g (beta) is solved by adopting a Newton method1,β2,…,βn) Corresponding to the lowest point of { beta } in the parameter set1 k,β2 k,…,βn k};
In the solution space Z of the parameters
1,Z
2,…,Z
nWithin the range, a set of parameter combinations { beta } is randomly chosen
1 l,β
2 l,…,β
n lIf the parameter combination { beta }
1 l,β
2 l,…,β
n lRe-extracting if the element belongs to U until the extracted parameter combination
Randomly selecting one parameter from the two sets of parameter combinations generated in the previous step of S5 as a next parameter combination point according to 1/2 probability;
adding the parameter combination point to a parameter library U, and updating m to m + 1;
s6: calculating the model error at the parameter combination point
The next parameter combination point determined in step S5 is calculated in step S22, and the traffic flow prediction model f (β)1,β2,…,βn) The prediction error at this point is calculated by the method of step S2, and the process returns to step S3.