Uncertain hydrological forecasting method based on particle swarm and Mertropolis
Through the particle swarm algorithm and adaptive Mertropolis algorithm combined with Bayesian method, the problem of large calculation amount and slow convergence speed of uncertainty processing in hydrological forecasting is solved, and the faster and more accurate output of hydrological flow forecasting intervals is achieved, improving the output of hydrological flow forecasting intervals. The reliability of forecasts is achieved.
Patent Information
- Application Number
- CN202411287603.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-27
AI Technical Summary
In terms of uncertainty, the existing hydrological forecasting methods have problems such as large algorithm calculation, slow convergence speed, and difficulty in obtaining the posterior distribution analysis form of model parameters, resulting in insufficient reliability and accuracy of forecast results.
The parameters of Xin'anjiang model are solved by using particle swarm algorithm for maximum likelihood estimation, combined with the adaptive Mertropolis algorithm and Bayesian method, Markov chains are generated for sampling, and the posterior distribution of parameters is obtained, and converged through the random perturbation acceleration algorithm. Output hydrological flow forecast interval range.
It improves the convergence speed and calculation efficiency of hydrological forecasts, provides more reliable uncertain interval forecast results, and reduces the complexity of calculation amount and model parameter processing.
Smart Images

Figure CN119204318A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of hydrological forecasting, and in particular to an uncertain hydrological forecasting method based on particle swarm and Mertropolis. Background Art
[0002] Hydrological forecasting is closely related to hydrological models. Hydrological forecasting is mainly achieved based on the constructed hydrological models. Nowadays, most of the commonly used hydrological forecasts are deterministic, and the forecast results are presented in the form of point estimates. In fact, the hydrological forecast process also has a random and uncertain side. There may be errors in the measurement of rainfall and evaporation data. The selection of the forecast model, the determination of the selected model structure, and the calculation of parameters also have unavoidable uncertainties. Therefore, the forecast results actually have potential uncertainties indirectly. The results given by the deterministic hydrological forecast form are unique values, which cannot well reflect the uncertainty of the forecast results. The field of computer science and technology has many effective processing tools for this. Therefore, analyzing and studying the uncertainty of hydrological forecasting, combined with existing achievements such as machine learning and artificial intelligence, is conducive to improving the reliability of forecast results and providing more information for the implementation of relevant decisions. It has important theoretical value and practical significance. With the continuous deepening and development of research, neural networks have been widely used in almost all scientific fields and have become an important part of various practical applications. However, basic neural networks cannot estimate the uncertainty of samples, and it is difficult to quantify the uncertainty of their predictions when the model is not calibrated accurately. In some fields with high safety requirements, prediction results that rely entirely on model certainty may have a great impact on decision-making. Bayesian methods can clearly describe the uncertainty of model parameters and provide a deeper theoretical basis. On the one hand, the research on Bayesian neural networks focuses on the variational inference (VI) method, which is an approximate reasoning method that transforms the Bayesian reasoning process into an optimization problem. On the other hand, the Monte Carlo method, as an effective tool for integral solution, has always been at the center of Bayesian research.
[0003] Xing Zhenxiang et al. proposed the AGA-BP network structure of prior density and likelihood function under the Bayesian probability forecasting (BFS) framework in the Journal of Hydraulic Engineering, Issue 12, pp. 1500-1506 in 2007, and established the BFS of the Xin'anjiang model based on AGM-AM-MCMC. It can not only give the mean forecast of flood flow, but also give the variance and confidence interval of the specified probability. Although it converges faster than the traditional MCMC algorithm, it still requires more computer resources and computing time.
[0004] In 2018, Xu Wei et al. used the MG model and BC transformation to transform the measured runoff and forecast runoff series into normal state in the 11th issue of the Journal of Hydroelectric Engineering, pages 15-23; based on the transformed runoff series, they established the BPF-MG model and the BPF-BC model respectively; and analyzed and evaluated the probabilistic forecast results using the single forecast value accuracy evaluation index and the forecast interval quality evaluation method respectively. However, the model structure is complex and has many parameters, and obtaining accurate forecast results requires a large amount of data calculation.
[0005] The above methods need to be optimized in terms of algorithm computational complexity and convergence degree. At the same time, no solution is proposed for the processing of model parameters, such as obtaining the analytical form of the posterior distribution of parameters. Summary of the invention
[0006] The object of the present invention is to provide an uncertain hydrological forecasting method based on particle swarm and Mertropolis, so as to solve the above-mentioned problems existing in the prior art.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0008] An uncertain hydrological forecasting method based on particle swarm and Mertropolis includes the following steps:
[0009] Step 1: Data preprocessing, including selecting the parameters of the Xin'anjiang model and using the particle swarm algorithm to perform maximum likelihood estimation on the selected parameters to solve the optimal values of the parameters of the Xin'anjiang model;
[0010] Step 2: Randomly perturb the optimal parameter value, use the perturbation result as the initial sample point, and generate multiple independent threads or processes containing Markov chains;
[0011] Step 3: Use the adaptive Mertropolis algorithm (AM algorithm) to determine whether each Markov chain converges to a stable distribution;
[0012] Step 4: Input the data of the study basin into the Xin'anjiang model, and calculate and output the hydrological flow forecast range through the Xin'anjiang model.
[0013] Furthermore, in step 1:
[0014] The parameters of the selected Xin'anjiang model include total surface inflow (SM), total soil inflow (KI) and total underground inflow (KG). The process of solving the optimal values of the parameters specifically includes the following steps:
[0015] Step 1.1, randomly initialize the particle position vector and velocity vector of the particle swarm;
[0016] Step 1.2, using the Xin'anjiang model to calculate the hydrological forecast flow corresponding to each particle;
[0017] Step 1.3, calculate the objective function of each particle, i.e., the likelihood function, according to the simulated flow and the real flow process; regard parameter estimation as an optimization process, and take the likelihood function as the optimization target. The likelihood function formula used by the present invention for the Xinanjiang model is as follows:
[0018]
[0019] Among them, Q obs,k is the measured flow value at the kth moment; Q cal,k is the calculated flow value at the kth moment; m is the total number of time periods of the flow process; N is the number of floods; w is other elements required by the hydrological model, such as rainfall, flow, etc. The formula for solving the optimal parameter value of the likelihood function is as follows:
[0020]
[0021] Furthermore, the specific process of step 3 includes the following steps:
[0022] Step 3.1, update the individual optimal value Pbest and the group optimal value Gbest of the particle swarm;
[0023] Step 3.2, when the posterior distribution is unknown, the Bayesian method is used to combine the prior knowledge of the relevant parameters with the actual observed sample data to obtain the prior distribution of the relevant parameters. After the likelihood function is given, the posterior distribution formula of the relevant parameters is obtained according to the Bayesian formula, as shown below:
[0024]
[0025] Among them, θ is the model parameter vector; p(θ) is the parameter prior distribution, which represents the prior knowledge about the model parameters, which can generally be learned from the data or directly specify common distributions such as uniform distribution and normal distribution: L(Q|θ) is the likelihood of parameter θ, which can generally be given according to the empirical formula in hydrological forecasting; p(θ|Q) is the parameter posterior distribution.
[0026] Step 3.3, construct a Markov chain for sampling. The acceptance of a single sample is determined according to the selected likelihood function. The acceptance probability α of the sample calculated in the AM algorithm is expressed as follows:
[0027]
[0028] Step 3.4, use the bimodal probability density function to test the performance of the AM algorithm. The probability density function formula is as follows:
[0029]
[0030] The initial covariance matrix of the parameter θ is taken as a diagonal matrix, and the search range of the parameter is taken as [-4,6]. The sample mean and variance are used to determine whether the result converges to a stable distribution. If the result converges to a stable distribution, each thread or process is terminated.
[0031] Furthermore, in step 4:
[0032] The data of the study basin include rainfall P and evaporation EM;
[0033] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0034] 1. Compared with the traditional genetic algorithm used in this field, the particle swarm algorithm does not need to encode individuals or perform genetic operations. Particles are only updated through internal speed. Particles only save their own optimal information and share the global optimal particle information. In the process of optimizing, each particle in the particle group can play the role of local optimization, with stronger global search capabilities and faster convergence speed.
[0035] 2. In the face of the difficulty in obtaining the analytical form of the posterior distribution of parameters in the hydrological model, the Bayesian method and the AM algorithm are used to obtain the posterior distribution samples of the parameters. Among the many MCMC sampling methods, the AM algorithm can avoid the selection of the proposed distribution and adaptively update the proposed distribution according to the sampled samples. Its convergence speed is faster than the MH sampling algorithm and the amount of calculation is smaller.
[0036] 3. At the same time, in view of the fact that the AM algorithm is time-consuming and converges slowly, the PSO algorithm is used to solve the maximum likelihood estimate of the model parameters, and the parameter value is randomly disturbed as the initial optimal sample point of the Markov chain to accelerate the convergence process of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 The present invention is a method flow chart of an embodiment of the present invention.
[0038] Figure 2 The figure is a schematic diagram of a hydrological forecast model according to an embodiment of the present invention.
[0039] Figure 3 A flood event in 1986 and 1989 was used for one embodiment of the present invention.
[0040] Figure 4 The forecast result for 1988 obtained by calculation according to an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention discloses an uncertainty hydrological forecasting method based on particle swarm and Mertropolis, comprising: data preprocessing, i.e. selecting parameters of a Xin'anjiang model and using a particle swarm algorithm to perform maximum likelihood estimation on the selected parameters to solve the optimal values of the parameters of the Xin'anjiang model; randomly perturbing the optimal values of the parameters, using the perturbation results as initial sample points, and generating multiple independent threads or processes containing Markov chains; determining whether each Markov chain converges to a stable distribution through an adaptive Mertropolis algorithm (AM algorithm); inputting the data of the study basin into the Xin'anjiang model, and outputting the hydrological flow forecast interval range through the Xin'anjiang model calculation.
[0042] The present invention is further described in detail below with reference to the accompanying drawings.
[0043] Figure 1 FIG. 1 is a method flow chart of an embodiment of the present invention. Figure 1 As shown, the method of this embodiment includes the following steps:
[0044] Step 1: Data preprocessing, including selecting the parameters of the Xin'anjiang model and using the particle swarm algorithm to perform maximum likelihood estimation on the selected parameters to solve the optimal values of the parameters of the Xin'anjiang model;
[0045] Step 2: Randomly perturb the optimal parameter value, use the perturbation result as the initial sample point, and generate multiple independent threads or processes containing Markov chains;
[0046] Step 3: Use the adaptive Mertropolis algorithm (AM algorithm) to determine whether each Markov chain converges to a stable distribution;
[0047] Step 4: Input the data of the study basin into the Xin'anjiang model, and calculate and output the hydrological flow forecast range through the Xin'anjiang model.
[0048] Furthermore, in step 1:
[0049] The Xinanjiang model is a conceptual model, also known as a "grey box" model. This model has the characteristics of a white box model based on the physical process of hydrological phenomena, and combines hydrological empirical formulas such as evapotranspiration formula, confluence unit line, infiltration curve, etc. Therefore, it has a certain degree of physical basis and contains a certain degree of empiricism. The conceptual hydrological model is based on the physical process of hydrological phenomena and combines hydrological experience to obtain certain physical parameter values, such as Figure 2 shown.
[0050] The selected parameters of the Xin'anjiang model include total surface inflow (SM), total soil inflow (KI) and total underground inflow (KG).
[0051] The process of solving the optimal parameter value specifically includes the following steps:
[0052] Step 1.1, randomly initialize the particle position vector and velocity vector of the particle swarm;
[0053] Step 1.2, using the Xin'anjiang model to calculate the hydrological forecast flow corresponding to each particle;
[0054] Step 1.3, calculate the objective function of each particle, i.e., the likelihood function, according to the simulated flow and the real flow process; regard parameter estimation as an optimization process, and take the likelihood function as the optimization target. The likelihood function formula used by the present invention for the Xinanjiang model is as follows:
[0055]
[0056] Among them, Q obs,k is the measured flow value at the kth moment; Q cal,k is the calculated flow value at the kth moment; m is the total number of time periods of the flow process; N is the number of floods; w is other elements required by the hydrological model, such as rainfall, flow, etc. The formula for solving the optimal parameter value of the likelihood function is as follows;
[0057]
[0058] In this embodiment, in the specific setting of the particle swarm algorithm, the learning factor c1 is 0.5, c2 is 0.5, and the inertia weight w is 0.8. The prediction results of the parameters of the Xinanjiang model obtained by maximum likelihood estimation are as follows: the SM value is 19.59, the KI value is 0.438, and the KG value is 0.561.
[0059] Furthermore, the specific process of step 3 includes the following steps:
[0060] Step 3.1, update the individual optimal value Pbest and the group optimal value Gbest of the particle swarm,
[0061] Step 3.2, when the posterior distribution is unknown, the Bayesian method is used to combine the prior knowledge of the relevant parameters with the actual observed sample data to obtain the prior distribution of the relevant parameters. After the likelihood function is given, the posterior distribution formula of the relevant parameters is obtained according to the Bayesian formula, as shown below:
[0062]
[0063] Among them, θ is the model parameter vector; p(θ) is the parameter prior distribution, which represents the prior knowledge about the model parameters, which can generally be learned from the data or directly specify common distributions such as uniform distribution and normal distribution; L(Q|θ) is the likelihood of parameter θ, which can generally be given according to the empirical formula in hydrological forecasting; p(θ|Q) is the parameter posterior distribution.
[0064] Step 3.3, construct a Markov chain for sampling. The acceptance of a single sample is determined according to the selected likelihood function. The acceptance probability α of the sample calculated in the AM algorithm is expressed as follows:
[0065]
[0066] Step 3.4, use the bimodal probability density function to test the performance of the AM algorithm. The probability density function formula is as follows:
[0067]
[0068] The initial covariance matrix of the parameter θ is taken as a diagonal matrix, and the search range of the parameter is taken as [-4,6]. The sample mean and variance are used to determine whether the result converges to a stable distribution. If the result converges to a stable distribution, each thread or process is terminated.
[0069] Furthermore, in step 4:
[0070] The data of the study basin include rainfall P and evaporation EM;
[0071] The hydrological model predicts flow mainly in the flood process, that is, the flow process with a flood peak. Therefore, this embodiment selects a flood process in each year based on the actual flood data from 1981 to 1990, and the time period length is 100. Figure 3 Shown is a flood process in 1986 and 1989.
[0072] This example obtains the measured flow process of floods from 1981 to 1990 and the range of hydrological flow forecast. The measured flow in most periods of floods in different years is included in the range. Compared with the single forecast flow value calculated based on the maximum likelihood estimation, the uncertainty interval forecast is more reliable. Figure 4 The figure shows the forecast results for 1988. From the actual results, it can be seen that the use of PSO-MLE-AM algorithm for uncertainty forecasting is effective, and applying this algorithm to actual flood forecasting can provide more reliable interval results.
Claims
1. An uncertain hydrological forecasting method based on particle swarm and Mertropolis, characterized in that: The following steps are involved: Step 1: Data preprocessing, including selecting the parameters of the Xin'anjiang model and using the particle swarm algorithm to perform maximum likelihood estimation on the selected parameters to solve the optimal values of the parameters of the Xin'anjiang model; Step 2: Randomly perturb the optimal parameter value, use the perturbation result as the initial sample point, and generate multiple independent threads or processes containing Markov chains; Step 3: Use the adaptive Mertropolis algorithm (AM algorithm) to determine whether each Markov chain converges to a stable distribution; Step 4: Input the data of the study basin into the Xin'anjiang model, and calculate and output the hydrological flow forecast range through the Xin'anjiang model.
2. The uncertain hydrological forecasting method based on particle swarm and Mertropolis according to claim 1, characterized in that: In step 1: The parameters selected for the Xin'anjiang model include total surface inflow (SM), total soil inflow (KI), and total underground inflow (KG); The process of solving the optimal parameter value specifically includes the following steps: Step 1.1, randomly initialize the particle position vector and velocity vector of the particle swarm; Step 1.2, use the Xin'anjiang model to calculate the hydrological forecast flow corresponding to each particle; Step 1.3, calculate the objective function of each particle, i.e., the likelihood function, according to the simulated flow and the real flow process; the likelihood function formula used by the present invention for the Xinanjiang model is as follows: Among them, Q obs,k is the measured flow value at the kth moment; Q cal,k is the calculated flow value at the kth moment; m is the total number of time periods of the flow process; N is the number of floods; w is other elements required by the hydrological model, such as rainfall, flow, etc. The formula for solving the optimal parameter value of the likelihood function is as follows:
3. The uncertain hydrological forecasting method based on particle swarm and Mertropolis according to claim 1, characterized in that: The specific process of step 3 includes the following steps: Step 3.1, update the individual optimal value Pbest and the group optimal value Gbest of the particle swarm; Step 3.2, when the posterior distribution is unknown, the Bayesian method is used to combine the prior knowledge of the relevant parameters with the actual observed sample data to obtain the prior distribution of the relevant parameters. After the likelihood function is given, the posterior distribution formula of the relevant parameters is obtained according to the Bayesian formula, as shown below: Among them, θ is the model parameter vector; p(θ) is the parameter prior distribution, which represents the prior knowledge about the model parameters, which can generally be learned from the data or directly specify common distributions such as uniform distribution and normal distribution; L(Q|θ) is the likelihood of parameter θ, which can generally be given according to the empirical formula in hydrological forecasting; p(θ|Q) is the parameter posterior distribution. Step 3.3, construct a Markov chain for sampling. The acceptance of a single sample is determined according to the selected likelihood function. The acceptance probability α of the sample calculated in the AM algorithm is expressed as follows: Step 3.4, use the bimodal probability density function to test the performance of the AM algorithm. The probability density function formula is as follows: The initial covariance matrix of parameter θ is taken as a diagonal matrix, and the search range of the parameter is taken as [-4, 6]. The sample mean and variance are used to determine whether the result converges to a stable distribution. If so, each thread or process is terminated.
4. The uncertain hydrological forecasting method based on particle swarm and Mertropolis according to claim 1, characterized in that: In step 4: The data of the study basin include rainfall P and evaporation EM.