Probability interval prediction method and device
By adopting shape adaptive quantile regression and integrated learning methods in probability interval prediction, combined with conformal prediction, the problem of insufficient accuracy and robustness of prediction intervals in the prior art is solved, and a more efficient and reliable uncertain interval construction is achieved.
Patent Information
- Application Number
- CN202411902374.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing probability interval prediction methods have insufficient accuracy and robustness in practice, especially when considering uncertainty and potential risks, and it is difficult to provide complete and effective prediction results.
The probability interval prediction method based on shape adaptive quantile regression is adopted. By dividing the training set into multiple sub-intervals, multiple quantile regression models are trained, and the results of different models are fused through integrated learning methods, and combining the conformal prediction method to construct a more accurate and robust prediction interval.
It improves the accuracy and robustness of the prediction interval, can effectively avoid the defects of the basic regression model, provide a more complete and reliable uncertainty interval construction, and meet the needs of decision support and risk management.
Smart Images

Figure CN119782936A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of probability interval prediction, and in particular to a probability interval prediction method and device. Background Art
[0002] Time series forecasting can visualize some uncertain factors, so as to make better decisions about certain situations that may occur in the future. It is also widely used, such as air quality forecasting, stock forecasting, traffic flow forecasting, disease forecasting, etc. Forecasting usually refers to the prediction of future values, and its common solution is regression analysis. In the context of forecasting, the ultimate goal is to obtain a practical probability distribution of future quantities or time series to effectively support decision making and risk management. However, most forecasting methods only focus on specified quantities that affect the distribution, such as mean, mathematical expectation, median, etc. For example, suppose that a company's stock price often fluctuates slightly, but in the long run, the price always fluctuates around its mean, so the mean reversion model can be used to predict the company's future stock price. However, the main purpose of forecasting is to support decision-making, and in the decision-making process, it is also necessary to consider the uncertainty and potential risks of the forecast results, including the worst case and possible losses. When it is impossible to collect all influencing factors or there is uncertainty in future influencing factors, point forecasts often present incomplete analysis.
[0003] Therefore, when making decisions, the uncertainty of the prediction must be considered. The probability interval prediction can not only provide a more comprehensive and objective description of the results for decision-making, but also reflect the uncertainty of the predicted value and the width of the prediction interval, thereby better describing the possible range of results and risks.
[0004] Probability interval prediction can provide complete probability statistical information through methods such as quantile estimation, prediction interval estimation, and probability density estimation. When constructing a prediction interval, it is necessary to cover as much real information as possible in a relatively narrow interval to improve the accuracy of the prediction. For uncertainty estimation, existing solutions include post-uncertainty estimation based on ensemble learning that combines the prediction results of multiple models, Bayesian recursive neural network prediction that expresses model uncertainty through model parameters, quantile regression prediction that directly learns prediction intervals, and shape-preserving prediction. The above models can quantify uncertainty to a certain extent, but they also have some limitations. For example, it is difficult for ensemble learning to determine the correlation and proportion between each model in practical applications; Bayesian reasoning may be difficult to calibrate when applied to basic regression models; quantile regression has the risk of overfitting; shape-preserving prediction requires exchangeability, but the time dependence in time series makes this requirement difficult to achieve. Summary of the invention
[0005] In order to solve the above technical problems, the present invention provides a probability interval prediction method and device, which improves the accuracy and robustness of the prediction interval.
[0006] The present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a probability interval prediction method, the method comprising:
[0008] S1: Divide the training set into multiple training set sub-intervals, train multiple quantile regression models on multiple independent training set sub-intervals, and obtain multiple ensemble learners composed of quantile regression models;
[0009] S2: According to the prediction error of the ensemble learner, select a better ensemble learner and store it as a better model; find the residual interval of the upper limit and the lower limit of the prediction interval corresponding to the stored better model;
[0010] S3: Use the stored better model to predict the test set, select the best ensemble learner based on the difference between the prediction result and the average aggregation result, and store it as the best model; and obtain the prediction interval based on the prediction result of the stored best model.
[0011] Furthermore, the S1 includes:
[0012] Divide the training set into multiple training set sub-intervals according to the number of ensemble learners, and set the sample index of each training set sub-interval;
[0013] According to the number of ensemble learners, multiple quantile regression models are trained on multiple independent training set intervals.
[0014] Set up the quantile ensemble estimator to obtain multiple ensemble learners consisting of quantile regression models.
[0015] Further, the S2 includes:
[0016] Initialize the residual interval set, the combination of ensemble learners included in the better model, and the combination of ensemble learners included in the optimal model;
[0017] The residual interval set includes the residual intervals of the upper and lower limits of the prediction interval;
[0018] By setting the first judgment model, the ensemble learner whose prediction error is less than the first threshold is taken as a better model, and stored in the combination of the ensemble learners included in the better model;
[0019] Using the asymmetric consistency score, the residual intervals of the upper and lower limits of the prediction interval corresponding to the stored better model are found and stored in the residual interval set.
[0020] Further, the S3 includes:
[0021] Construct prediction intervals for the data in the test set sequentially according to the time index of the test set;
[0022] The stored better model is used to predict the test set, and the better model whose difference between the prediction result and the average aggregation result is less than the second threshold is used as the optimal model through the set second judgment model; and it is stored in the combination of the ensemble learners included in the optimal model;
[0023] According to the prediction results of the optimal model, the prediction interval is obtained through the weighted aggregation function.
[0024] Furthermore, the method further comprises:
[0025] S4: The better model with a difference not less than the second threshold is taken out, and the upper limit, lower limit and median line of the prediction interval are added to the corresponding residual.
[0026] A probability interval prediction device, the device comprising:
[0027] An ensemble learner construction module is used to divide the training set into multiple training set sub-intervals, train multiple quantile regression models on multiple independent training set sub-intervals, and obtain multiple ensemble learners composed of quantile regression models;
[0028] The residual interval prediction module is used to select a better ensemble learner according to the prediction error of the ensemble learner and store it as a better model; find the residual interval of the upper limit and the lower limit of the prediction interval corresponding to the stored better model;
[0029] The prediction interval prediction module is used to use the stored better model to predict the test set, select the best ensemble learner according to the difference between the prediction result and the average aggregation result, and store it as the best model; and obtain the prediction interval according to the prediction result of the stored best model.
[0030] Furthermore, the integrated learner construction module includes:
[0031] A training set sub-interval division unit, used to divide the training set into a plurality of training set sub-intervals according to the number of ensemble learners, and to set a sample index of each training set sub-interval;
[0032] A quantile regression model training unit, used to train multiple quantile regression models on multiple independent training set sub-intervals according to the number of ensemble learners;
[0033] The ensemble learner construction unit is used to set the quantile ensemble estimator to obtain multiple ensemble learners composed of quantile regression models.
[0034] Furthermore, the residual interval prediction module includes:
[0035] An initialization unit, used to initialize a residual interval set, a combination of ensemble learners included in a better model, and a combination of ensemble learners included in an optimal model;
[0036] The residual interval set includes the residual intervals of the upper and lower limits of the prediction interval;
[0037] A better model acquisition unit, used to use the set first judgment model to take the ensemble learner with a prediction error less than the first threshold as the better model, and store it in the combination of ensemble learners included in the better model;
[0038] The residual interval prediction unit is used to use the asymmetric consistency score to find the residual interval of the upper limit and the lower limit of the prediction interval corresponding to the stored better model, and store them in the residual interval set.
[0039] Furthermore, the prediction interval prediction module includes:
[0040] A prediction interval construction unit, used to sequentially construct prediction intervals for data in the test set according to the time index of the test set;
[0041] An optimal model acquisition unit is used to use the stored better model to predict the test set, and through the set second judgment model, take the better model whose difference between the prediction result and the average aggregation result is less than the second threshold as the optimal model; and store it in the combination of ensemble learners included in the optimal model;
[0042] The prediction interval prediction unit is used to obtain the prediction interval through a weighted aggregation function according to the prediction result of the optimal model.
[0043] Furthermore, the device also includes:
[0044] The shape-preserving prediction module is used to extract the better model whose difference is not less than the second threshold, and add the upper limit, lower limit and median line of the prediction interval to the corresponding residual.
[0045] The present invention has the following beneficial effects:
[0046] The present invention is a probability interval prediction method based on shape adaptive quantile regression. In order to solve the limitations of the probability interval prediction method of the prior art in practice, it is a method for constructing uncertainty intervals that can not only provide interval validity guarantees in theory, but also effectively avoid the defects of the basic regression model. First, the present invention adopts a basic quantile regression model, which can take advantage of its direct reading of prediction samples to generate prediction intervals. Then, in order to effectively avoid the overfitting problem, the data set is divided into a training set and a test set according to a certain ratio. The training set is used to train the model, and the test set is used to evaluate the generalization ability of the model. At the same time, an integrated learning method is also adopted to divide the data set into multiple self-collected pieces to train multiple models, and then the results of different models are fused to obtain the final prediction result. By fusing the results of different models, the accuracy and robustness of the prediction interval can be improved, and the exchangeability required by the shape-preserving prediction to be performed next is also met. Finally, a shape-preserving prediction method is adopted to ensure the reliability of the prediction interval covering the true value, and the upper and lower limits of the prediction interval are respectively subjected to shape-preserving prediction, and more true values can be covered on the basis of sacrificing a certain interval width by guaranteeing the operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a flow chart of the probability interval prediction method of the present invention;
[0048] Figure 2 Schematic diagram of a probability interval prediction device of the present invention. DETAILED DESCRIPTION
[0049] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0050] Embodiment 1:
[0051] The embodiment of the present invention provides a probability interval prediction method, such as Figure 1 As shown, the method includes:
[0052] S1: Divide the training set into multiple training set sub-intervals, train multiple quantile regression models on multiple independent training set sub-intervals respectively, and obtain multiple ensemble learners composed of quantile regression models.
[0053] Before that, you need to customize and initialize some parameters first:
[0054] Given a custom confidence level , (Adaptive) Quantile Regression Model , average aggregation function , the first judgment model (If the condition is met, y=1, if the condition is not met, y=0), the second judgment model (If the condition is met, y=1, if the condition is not met, y=0), the number of ensemble learners , weighted aggregation function , training set , test set .
[0055] The specific operations of this step are as follows:
[0056] According to the number of ensemble learners , divide the training set into multiple training set sub-intervals, and train the time index of the training set , set the sample index for each training set subinterval .
[0057]
[0058] According to the number of ensemble learners , multiple quantile regression models are trained on multiple independent training set intervals.
[0059] Set the quantile ensemble estimator to obtain multiple ensemble learners composed of quantile regression models .
[0060]
[0061] S2: According to the prediction error of the ensemble learner, select the better ensemble learner and store it as the better model; find the residual interval of the upper limit and lower limit of the prediction interval corresponding to the stored better model.
[0062] In one example, this step includes:
[0063] Initialize the residual interval set , the combination of ensemble learners included in the better model And the combination of ensemble learners included in the optimal model .
[0064] Among them, the residual interval set includes the residual interval of the upper limit of the prediction interval and the residual interval for the lower bound .
[0065] By setting the first judgment model , the ensemble learner whose prediction error is less than the first threshold is taken as the better model and stored in the combination of the ensemble learners contained in the better model.
[0066]
[0067] Using the asymmetric consistency score, find the residual intervals of the upper and lower bounds of the prediction interval corresponding to the stored better model and store them in the residual interval set.
[0068]
[0069]
[0070] S3: Use the stored better model to predict the test set, select the best ensemble learner based on the difference between the prediction result and the average aggregation result, and store it as the best model; and obtain the prediction interval based on the prediction result of the stored best model.
[0071] Specifically, this step includes:
[0072] According to the time index of the test set , sequentially construct prediction intervals for the data in the test set.
[0073]
[0074] Then, the judgment models are sorted to obtain the optimal model ensemble learner combination and a dynamic adaptive weight is assigned to the optimal model ensemble learner combination.
[0075] The present invention introduces a model performance predictor to screen quantile regression models for combination and constructs a reasonable ensemble learner by adjusting their adaptive weights to improve the accuracy and robustness of prediction. Since the ensemble learner is independent of the accuracy of the potential prediction method, it can ensure that the model is applied on any quantile regression model, thereby constructing a distribution-free, approximately effective prediction interval.
[0076] Use the stored better model to predict the test set, and use the second judgment model set , the better model whose difference between the prediction result and the average aggregation result is less than the second threshold is taken as the optimal model; and stored in the combination of ensemble learners contained in the optimal model.
[0077]
[0078] According to the prediction results of the optimal model, the prediction interval is obtained through the weighted aggregation function.
[0079]
[0080] As an improvement of the embodiment of the present invention, the method further includes:
[0081] S4: Take out the better model whose difference is not less than the second threshold (i.e. the better model combination with larger error value), and add them to the corresponding residual as the upper limit, lower limit and median line of the prediction interval.
[0082]
[0083] This step introduces shape-preserving prediction, and uses the shape-preserving prediction method to make local adjustments to the prediction interval to construct a prediction interval that is more in line with the real data. The order and continuity of the prediction results are increased, so that the obtained prediction interval can adaptively adjust the width and position of the prediction interval according to the characteristics of the data, thereby better adapting to the local changes of the time series, further improving the prediction accuracy while ensuring the coverage rate, and covering more real values at the expense of less prediction interval width.
[0084] The present invention is a probability interval prediction method based on shape adaptive quantile regression. In order to solve the limitations of the probability interval prediction method of the prior art in practice, it is a method for constructing uncertainty intervals that can not only provide interval validity guarantees in theory, but also effectively avoid the defects of the basic regression model. First, the present invention adopts a basic quantile regression model, which can take advantage of its direct reading of prediction samples to generate prediction intervals. Then, in order to effectively avoid the overfitting problem, the data set is divided into a training set and a test set according to a certain ratio. The training set is used to train the model, and the test set is used to evaluate the generalization ability of the model. At the same time, an integrated learning method is also adopted to divide the data set into multiple self-collected pieces to train multiple models, and then the results of different models are fused to obtain the final prediction result. By fusing the results of different models, the accuracy and robustness of the prediction interval can be improved, and the exchangeability required by the shape-preserving prediction to be performed next is also met. Finally, a shape-preserving prediction method is adopted to ensure the reliability of the prediction interval covering the true value, and the upper and lower limits of the prediction interval are respectively subjected to shape-preserving prediction, and more true values can be covered on the basis of sacrificing a certain interval width by guaranteeing the operation.
[0085] Embodiment 2:
[0086] The embodiment of the present invention provides a probability interval prediction device, such as Figure 2 As shown, the device comprises:
[0087] The ensemble learner construction module 1 is used to divide the training set into multiple training set sub-intervals, train multiple quantile regression models on multiple independent training set sub-intervals respectively, and obtain multiple ensemble learners composed of quantile regression models.
[0088] The residual interval prediction module 2 is used to select a better ensemble learner according to the prediction error of the ensemble learner and store it as a better model; and find the residual interval of the upper limit and the lower limit of the prediction interval corresponding to the stored better model.
[0089] The prediction interval prediction module 3 is used to use the stored better model to predict the test set, select the best integrated learner according to the difference between the prediction result and the average aggregation result, and store it as the best model; and obtain the prediction interval according to the prediction result of the stored best model.
[0090] Specifically, the aforementioned integrated learner construction module includes:
[0091] The training set sub-interval division unit is used to divide the training set into multiple training set sub-intervals according to the number of ensemble learners, and set the sample index of each training set sub-interval.
[0092] The quantile regression model training unit is used to train multiple quantile regression models on multiple independent training set sub-intervals according to the number of ensemble learners.
[0093] The ensemble learner construction unit is used to set the quantile ensemble estimator to obtain multiple ensemble learners composed of quantile regression models.
[0094] As an example, the residual interval prediction module includes:
[0095] The initialization unit is used to initialize the residual interval set, the combination of ensemble learners included in the better model, and the combination of ensemble learners included in the optimal model.
[0096] The residual interval set includes the residual intervals of the upper and lower limits of the prediction interval.
[0097] The better model acquisition unit is used to use the set first judgment model to take the ensemble learner with a prediction error less than the first threshold as the better model, and store it in the combination of ensemble learners included in the better model.
[0098] The residual interval prediction unit is used to use the asymmetric consistency score to find the residual interval of the upper limit and the lower limit of the prediction interval corresponding to the stored better model, and store them in the residual interval set.
[0099] Correspondingly, the prediction interval prediction module includes:
[0100] A prediction interval construction unit, used to sequentially construct prediction intervals for data in the test set according to the time index of the test set;
[0101] An optimal model acquisition unit is used to use the stored better model to predict the test set, and through the set second judgment model, take the better model whose difference between the prediction result and the average aggregation result is less than the second threshold as the optimal model; and store it in the combination of ensemble learners included in the optimal model;
[0102] The prediction interval prediction unit is used to obtain the prediction interval through a weighted aggregation function according to the prediction result of the optimal model.
[0103] As an improvement of the embodiment of the present invention, the device further includes:
[0104] The shape-preserving prediction module 4 is used to extract the better model whose difference is not less than the second threshold, and add the upper limit, lower limit and median line of the prediction interval to the corresponding residual.
[0105] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment 1. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment 1. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the devices and units described above can all refer to the corresponding processes in the aforementioned method embodiment 1, and will not be repeated here.
[0106] The above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or perform equivalent replacements on some of the technical features thereof; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. They should all be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A probability interval prediction method, characterized in that: The method comprises: S1: Divide the training set into multiple training set sub-intervals, train multiple quantile regression models on multiple independent training set sub-intervals, and obtain multiple ensemble learners composed of quantile regression models; S2: According to the prediction error of the ensemble learner, select a better ensemble learner and store it as a better model; find the residual interval of the upper limit and the lower limit of the prediction interval corresponding to the stored better model; S3: Use the stored better model to predict the test set, select the best ensemble learner based on the difference between the prediction result and the average aggregation result, and store it as the best model; and obtain the prediction interval based on the prediction result of the stored best model.
2. The probability interval prediction method according to claim 1, characterized in that: The S1 includes: Divide the training set into multiple training set sub-intervals according to the number of ensemble learners, and set the sample index of each training set sub-interval; According to the number of ensemble learners, multiple quantile regression models are trained on multiple independent training set intervals. Set up the quantile ensemble estimator to obtain multiple ensemble learners consisting of quantile regression models.
3. The probability interval prediction method according to claim 2, characterized in that: The S2 includes: Initialize the residual interval set, the combination of ensemble learners included in the better model, and the combination of ensemble learners included in the optimal model; The residual interval set includes the residual intervals of the upper and lower limits of the prediction interval; By setting the first judgment model, the ensemble learner whose prediction error is less than the first threshold is taken as a better model, and stored in the combination of the ensemble learners included in the better model; Using the asymmetric consistency score, the residual intervals of the upper and lower limits of the prediction interval corresponding to the stored better model are found and stored in the residual interval set.
4. The probability interval prediction method according to claim 3, characterized in that: The S3 includes: Construct prediction intervals for the data in the test set sequentially according to the time index of the test set; The stored better model is used to predict the test set, and the better model whose difference between the prediction result and the average aggregation result is less than the second threshold is used as the optimal model through the set second judgment model; and it is stored in the combination of the ensemble learners included in the optimal model; According to the prediction results of the optimal model, the prediction interval is obtained through the weighted aggregation function.
5. The probability interval prediction method according to claim 4, characterized in that: The method further comprises: S4: The better model with a difference not less than the second threshold is taken out, and the upper limit, lower limit and median line of the prediction interval are added to the corresponding residual.
6. A probability interval prediction device, characterized in that: The device comprises: An ensemble learner construction module is used to divide the training set into multiple training set sub-intervals, train multiple quantile regression models on multiple independent training set sub-intervals, and obtain multiple ensemble learners composed of quantile regression models; The residual interval prediction module is used to select a better ensemble learner according to the prediction error of the ensemble learner and store it as a better model; find the residual interval of the upper limit and the lower limit of the prediction interval corresponding to the stored better model; The prediction interval prediction module is used to use the stored better model to predict the test set, select the best ensemble learner according to the difference between the prediction result and the average aggregation result, and store it as the best model; and obtain the prediction interval according to the prediction result of the stored best model.
7. The probability interval prediction device according to claim 6, characterized in that: The integrated learner construction module includes: A training set sub-interval division unit, used to divide the training set into a plurality of training set sub-intervals according to the number of ensemble learners, and to set a sample index of each training set sub-interval; A quantile regression model training unit, used to train multiple quantile regression models on multiple independent training set sub-intervals according to the number of ensemble learners; The ensemble learner construction unit is used to set the quantile ensemble estimator to obtain multiple ensemble learners composed of quantile regression models.
8. The probability interval prediction device according to claim 7, characterized in that: The residual interval prediction module comprises: An initialization unit, used to initialize a residual interval set, a combination of ensemble learners included in a better model, and a combination of ensemble learners included in an optimal model; The residual interval set includes the residual intervals of the upper and lower limits of the prediction interval; A better model acquisition unit, used to use the set first judgment model to take the ensemble learner with a prediction error less than the first threshold as the better model, and store it in the combination of ensemble learners included in the better model; The residual interval prediction unit is used to use the asymmetric consistency score to find the residual interval of the upper limit and the lower limit of the prediction interval corresponding to the stored better model, and store them in the residual interval set.
9. The probability interval prediction device according to claim 8, characterized in that: The prediction interval prediction module comprises: A prediction interval construction unit, used to sequentially construct prediction intervals for data in the test set according to the time index of the test set; An optimal model acquisition unit is used to use the stored better model to predict the test set, and through the set second judgment model, take the better model whose difference between the prediction result and the average aggregation result is less than the second threshold as the optimal model; and store it in the combination of ensemble learners included in the optimal model; The prediction interval prediction unit is used to obtain the prediction interval through a weighted aggregation function according to the prediction result of the optimal model.
10. The probability interval prediction device according to claim 9, characterized in that: The device also includes: The shape-preserving prediction module is used to extract the better model whose difference is not less than the second threshold, and add the upper limit, lower limit and median line of the prediction interval to the corresponding residual.
Citation Information
Cited By
Unoccupied parking space fluctuation interval prediction method and related equipment
CN120316584A