A precipitation normalization analysis method and system based on gradient parameter optimization
Through the method of optimizing gradient parameters, a normal transformation model and likelihood function are constructed, which solves the modeling complexity problem caused by non-normal characteristics of precipitation data, realizes adaptive precipitation data analysis, and improves the accuracy and adaptability of the analysis results.
Patent Information
- Application Number
- CN202210988178.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-17
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2042-08-17
AI Technical Summary
The non-normal characteristics of existing precipitation data lead to complex modeling and analysis, and the commonly used transformation parameters are empirical, making it difficult to adapt to different climatic conditions, affecting the accuracy of the analysis results.
Using a method based on gradient parameter optimization, by constructing a normal transformation model and likelihood function, we deduce and parse gradient vectors for parameter optimization, and adapt to the precipitation distribution characteristics under different climatic conditions.
The parameter optimization process is simplified, the accuracy and adaptability of precipitation data analysis is improved, and the work difficulty of hydrological and meteorological workers is reduced.
Smart Images

Figure CN115828045B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of hydrological data processing, and more specifically, to a precipitation normalization analysis method and system based on gradient parameter optimization. Background Art
[0002] Precipitation data is crucial hydrometeorological observational data. Modeling and analyzing precipitation data is an effective approach for developing precipitation data products, analyzing watershed drought events, and conducting hydrological forecasts. Due to the natural properties of precipitation, precipitation data often exhibit a non-normal distribution: On the one hand, precipitation typically exhibits a positively skewed distribution, characterized by high skewness and kurtosis; on the other hand, precipitation has a natural lower boundary, with a minimum value of zero, resulting in a mixed discrete-continuous distribution. Many current statistical analysis methods are based on the assumption of a normal distribution. Therefore, the non-normal nature of precipitation data complicates the modeling and analysis process and can negatively impact the results.
[0003] To address the non-normal distribution of precipitation, a commonly used approach is to transform non-normally distributed precipitation data into normally distributed data using normal transformation methods such as log, Box-Cox, and log-sinh transformations, before further modeling and analysis. Different transformation methods require different transformation parameters, each of which has a different impact on the normal transformation. A common approach is to set the transformation parameters empirically. However, empirical parameter settings are difficult to adapt to precipitation distribution characteristics under different climatic conditions, and the accuracy of the resulting precipitation data analysis results needs to be improved. Summary of the Invention
[0004] In order to overcome the defects of the above-mentioned precipitation normalization analysis method in the prior art that is difficult to adapt to the precipitation distribution characteristics under different climatic conditions and the accuracy of data analysis needs to be improved, the present invention provides a precipitation normalization analysis method and system based on gradient parameter optimization.
[0005] In order to solve the above technical problems, the technical solutions of the present invention are as follows:
[0006] A precipitation normalization analysis method based on gradient parameter optimization includes the following steps:
[0007] S1. Obtain precipitation data to be analyzed;
[0008] S2. Constructing a normal transformation model to perform a normal transformation on the precipitation data to obtain a normal variable Z; wherein the normal transformation model includes corresponding normal transformation parameters;
[0009] S3, making the normal variable Z obey the normal distribution, and constructing the joint probability density function of the normal variable Z;
[0010] S4. Constructing a likelihood function for parameter optimization based on the normal transformation model and the joint probability density function; wherein the parameters to be optimized include normal distribution parameters and the normal transformation parameters;
[0011] S5. Optimizing the likelihood function by deriving an analytical gradient vector of the likelihood function until a preset termination condition is satisfied, thereby obtaining optimal parameters that maximize the likelihood function.
[0012] S6. Update the normal transformation model based on the optimal parameters, and perform normal transformation and modeling analysis on the precipitation data to obtain precipitation normalization analysis results.
[0013] In this technical solution, the likelihood function is optimized by deriving its analytical gradient vector, which simplifies the parameter optimization process of the normal transformation. At the same time, the parameter estimation of different normal transformations is completed to obtain precipitation normalization analysis results that are adapted to the precipitation distribution characteristics under different climatic conditions.
[0014] Furthermore, the present invention also proposes a precipitation normalization analysis system based on gradient parameter optimization, which is applied to the above precipitation normalization analysis method. The precipitation normalization analysis system includes:
[0015] A data acquisition module is used to obtain precipitation data to be analyzed;
[0016] A normal transformation module, configured to perform a normal transformation on the precipitation data according to a preset normal transformation model to obtain a normal variable Z;
[0017] A normal distribution module, used to make the normal variable Z obey the normal distribution and construct a joint probability density function of the normal variable Z;
[0018] an optimization module, configured to construct a likelihood function for parameter optimization based on the normal transformation model and the joint probability density function, optimize the likelihood function by deriving an analytical expression of the gradient vector of the likelihood function, and update the normal transformation model in the normal transformation module after satisfying a preset termination condition and obtaining the optimal parameters that maximize the likelihood function;
[0019] The analysis module is used to perform modeling analysis based on the normal variable Z output by the normal transformation module after optimization and update, and output the precipitation normalization analysis results.
[0020] Compared with the existing technology, the beneficial effect of the technical solution of the present invention is: by deriving the analytical expression of the gradient vector of the likelihood function and adopting the maximum likelihood estimation method for optimization, the present invention can adaptively perform parameter optimization according to the different distribution characteristics of precipitation to adapt to the precipitation distribution characteristics under different climatic conditions, thereby reducing the difficulty of hydrological and meteorological workers in carrying out precipitation normalization work. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 This is a flow chart of the precipitation normalization analysis method based on gradient parameter optimization in Example 1.
[0022] Figure 2 : The frequency distribution histogram of the standardized precipitation data before and after the normal transformation of Example 2.
[0023] Figure 3 This is the normal distribution quantile plot of standardized precipitation before and after the normal transformation of Example 2.
[0024] Figure 4 This is the architecture diagram of the precipitation normalization analysis system of Example 3. DETAILED DESCRIPTION
[0025] The accompanying drawings are for illustrative purposes only and are not to be construed as limiting this patent;
[0026] In order to better illustrate this embodiment, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product size;
[0027] It is understandable to those skilled in the art that some well-known structures and descriptions thereof may be omitted in the drawings.
[0028] The technical solution of the present invention is further described below with reference to the accompanying drawings and embodiments.
[0029] Example 1
[0030] This embodiment proposes a precipitation normalization analysis method based on gradient parameter optimization, such as Figure 1 FIG. 1 is a flow chart of the precipitation normalization analysis method of this embodiment.
[0031] The precipitation normalization analysis method based on gradient parameter optimization proposed in this embodiment includes the following steps:
[0032] S1. Obtain precipitation data to be analyzed.
[0033] S2. Construct a normal transformation model, perform a normal transformation on the precipitation data, and obtain a normal variable Z; wherein the normal transformation model includes corresponding normal transformation parameters.
[0034] S3. Let the normal variable Z obey the normal distribution, and construct the joint probability density function of the normal variable Z.
[0035] S4. Based on the normal transformation model and the joint probability density function, construct a likelihood function for parameter optimization.
[0036] The parameters to be optimized include normal distribution parameters and the normal transformation parameters.
[0037] S5. Optimizing the likelihood function by deriving an analytical gradient vector of the likelihood function until a preset termination condition is satisfied, thereby obtaining optimal parameters that maximize the likelihood function.
[0038] S6. Update the normal transformation model based on the optimal parameters, and perform normal transformation and modeling analysis on the precipitation data to obtain precipitation normalization analysis results.
[0039] In this embodiment, by constructing a likelihood function and performing optimization by deriving the analytical gradient vector of the likelihood function, parameter optimization can be adaptively performed according to different distribution characteristics of precipitation to adapt to precipitation distribution characteristics under different climatic conditions, thereby reducing the difficulty for hydrometeorological workers to carry out precipitation normalization work.
[0040] In an optional embodiment, the constructed normal transformation model is based on one or more of Log transformation, Box-Cox transformation or Log-sinh transformation.
[0041] Where X=[x1,x2,..,x n ] is n samples of precipitation data, and Z=[z1,z2,..,z n ] represents the corresponding normal variable after normal transformation.
[0042] The expression of the normal transformation model based on Log transformation is as follows:
[0043] Z Log (X; c) = log (X + c) (1)
[0044] Where log(·) represents the natural logarithm function, and c is the parameter of the log transformation, which is usually a non-negative number and is used to deal with the situation where the log transformation is meaningless when X = 0.
[0045] The first-order derivative of the Log transform with respect to X is:
[0046] Z L ' og (X; c) = (X + c) -1 (2)
[0047] It can be seen that there is only one parameter to be optimized in the normal transformation model based on Log transformation, which is parameter c.
[0048] The expression of the normal transformation model based on Box-Cox transformation is as follows:
[0049]
[0050] Where Z Box-Cox (·) represents the set of normal variables after Box-Cox transformation, and λ1 and λ2 are the normal transformation parameters of Box-Cox transformation.
[0051] The value range of λ1 is [-2, 2]. From Equation (3), we can see that when λ1 = 0, the Box-Cox transformation is equivalent to the Log transformation. In this case, the parameter λ2 has the same function as the parameter c, and is used to handle the case where the Box-Cox transformation is meaningless when X = 0. λ2 is usually a non-negative number, but it can also be fixed to 0 or other positive numbers.
[0052] The first-order derivative of the Box-Cox transformation with respect to X is:
[0053]
[0054] It can be seen that the parameters to be optimized in the normal transformation model based on Box-Cox transformation are λ1 and λ2.
[0055] The expression of the normal transformation model based on Log-sinh transformation is as follows:
[0056]
[0057] Where Z Log-sinh (·) represents the set of normal variables after the Log-sinh transformation, and α and β are the normal transformation parameters of the Log-sinh transformation. When the β parameter approaches infinity, the effect of the Log-sinh transformation is similar to that of the Log transformation.
[0058] The first-order derivative of the Log-sinh transform with respect to X is:
[0059]
[0060] coth(·) represents the hyperbolic cotangent function. It can be seen that the parameters to be optimized in the normal transformation model based on Log-sinh transformation are α and β.
[0061] In an optional embodiment, the step S3 includes the following steps:
[0062] S3.1. Values in the precipitation data that are less than or equal to the censoring threshold x0 are considered censored values;
[0063] S3.2. Assume that the normal variable Z after censoring obeys the normal distribution to construct the joint probability density function.
[0064] Furthermore, the deletion threshold x0 is a real number equal to or slightly greater than 0.
[0065] This embodiment takes into account that, because the lower boundary of precipitation is zero, precipitation data exhibits a discrete-continuous mixed distribution. Traditional precipitation normalization typically addresses zero precipitation values by adding an offset coefficient, but this fails to consider the impact of the mixed distribution of precipitation on parameter estimation. This embodiment processes precipitation data based on a censoring threshold, converting it into a continuous distribution. Compared to traditional processing methods, this fully considers the impact of the mixed distribution of precipitation on parameter estimation, resulting in more reasonable estimation results.
[0066] Further assuming that the normal variable Z after censoring obeys the normal distribution, construct the joint probability density function:
[0067]
[0068] Where z i ∈Z represents the i-th precipitation data sample in the normal variable Z that has undergone normal transformation; μ Z and σ Z Indicates the mean and standard deviation of the normal variable Z that obeys the normal distribution; p N (·) represents the probability density function of the normal variable Z following the normal distribution, φ N (·) represents the cumulative distribution function of the normal variable Z; Ω1 represents the set of sample indices whose precipitation data is greater than the censoring threshold x0, and the number is recorded as n1; Ω0 represents the set of sample indices whose precipitation data is less than or equal to the censoring threshold x0, and the number is recorded as n0, and n = n0 + n1.
[0069] Based on formula (7), the expression of the likelihood function used for parameter optimization is as follows:
[0070]
[0071] Where θ represents the parameter set in the likelihood function p(X|θ), including the normal distribution parameter μ Z and σ Z and normal transformation parameters; J represents the Jacobian matrix of the normal transformation.
[0072] For the likelihood function p(X|θ), we often take its logarithmic form and get:
[0073]
[0074] In the formula, Z′(xi ) represents the first-order derivative of the corresponding normal transformation. For the Log, Box-Cox, and Log-sinh transformations, the forms in Equations (2), (4), and (6) are used respectively; erf(·) represents the error function.
[0075] Furthermore, this embodiment optimizes the likelihood function and its gradient information until a preset termination condition is satisfied, thereby obtaining the optimal parameters that satisfy the maximum value of the likelihood function. The parameters to be optimized include the normal distribution parameter μ Z and σ Z , and the normal transformation parameters c, λ1, λ2, α and β.
[0076] This embodiment uses the maximum likelihood estimation method to perform optimization, that is, to find a set of parameters so that logp(X|θ) in equation (9) reaches the maximum value.
[0077] Furthermore, in an optional embodiment, in step S5, the specific steps include:
[0078] S5.1. Set the starting point θ of the parameter to be optimized 0 ;
[0079] S5.2. Using the quasi-Newton method, the likelihood function is iteratively optimized based on the gradient vector until a preset termination condition is satisfied, thereby obtaining the optimal parameters that maximize the likelihood function.
[0080] The iterative solution formula is as follows:
[0081]
[0082] Where θ k+1 and θ k Indicates the value of the parameter to be optimized in the k+1th and kth iterations; g k Represents the value of the gradient vector composed of the parameter set θ in the likelihood function in the kth iteration; represents the inverse matrix of the Hessian matrix at the kth iteration.
[0083] This embodiment takes into account the large amount of computation required by traditional global optimization algorithms, the long optimization time required, and the influence of local optimal values. Therefore, the quasi-Newton method is used as the optimization algorithm. At the same time, based on the log-likelihood function logp(X|θ) in formula (9), the analytical solution of the gradient of different parameters is derived. This is used as gradient information. The purpose is to provide direction for the algorithm search and improve the algorithm's search efficiency, thereby quickly finding the optimal parameter value. Common methods include the DFP algorithm (Davodpm-Fletcher-Powell) and the BFGS algorithm (Broyden-Fletcher-Goldfard-Shano).
[0084] Furthermore, the gradient of the log-likelihood function is composed of the first-order partial derivative of the log-likelihood function logp(X|θ) with respect to the parameters. For Log, Box-Cox and Log-sinh transformations, it is necessary to estimate the mean μ of the normalized variable Z Z and standard deviation σ Z .
[0085] Among them, the mean μ Z The first-order partial derivative of is expressed as:
[0086]
[0087] Standard deviation σ Z The first-order partial derivative of is expressed as:
[0088]
[0089] Different normal transformation methods have different parameters. For Log transformation, the first-order partial derivative of logp(X|θ) with respect to parameter c is:
[0090]
[0091] For the Box-Cox transformation, the first-order partial derivative of logp(X|θ) with respect to the parameter λ1 is:
[0092]
[0093] When λ1=0, the first-order partial derivative of logp(X|θ) with respect to parameter λ1 is:
[0094]
[0095] For the Box-Cox transformation, the first-order partial derivative of logp(X|θ) with respect to the parameter λ2 is:
[0096]
[0097] For the Log-sinh transform, the first-order partial derivative of logp(X|θ) with respect to the parameter α is:
[0098]
[0099] For the Log-sinh transform, the first-order partial derivative of logp(X|θ) with respect to the parameter β is:
[0100]
[0101] Based on the first-order partial derivatives of each parameter, the gradient vector of the log-likelihood function can be obtained, specifically:
[0102] For Log transformation, the gradient vector of the log-likelihood function is:
[0103]
[0104] For the Box-Cox transformation, the gradient vector of the log-likelihood function is:
[0105]
[0106] For the Log-sinh transform, the gradient vector of the log-likelihood function is:
[0107]
[0108] Furthermore, in an optional embodiment, in step S5.1, the starting point θ of the parameter to be optimized is set 0 The steps include:
[0109] Set the initial estimate of the parameter θ 0 , and assume that the parameter θ 0 It follows a uniform distribution within its range:
[0110] θ 0 ~U(B l ,B u )
[0111] Among them B l With B u denote the lower and upper bounds of the parameter θ respectively;
[0112] From the parameter θ 0 Several random points are randomly selected from the uniform distribution as the initial points of the quasi-Newton method for solution.
[0113] In this embodiment, considering that the likelihood function may have multiple local optimal solutions, we can 0Randomly select several random points from the uniform distribution as the initial points of the quasi-Newton method to solve, and finally select the parameter combination that makes -logp(X|θ) obtain the minimum value (that is, logp(X|θ) obtains the maximum value) from multiple solution results as the final parameter optimization result θ opt :
[0114]
[0115] In the formula, the parameter optimization result θ opt Including the optimization of normal distribution parameters and normal transformation parameters.
[0116] Furthermore, in an optional embodiment, in step S5.2, the termination condition includes at least one of the following conditions:
[0117] (1) The value of the gradient vector g in the current iteration k Less than the preset threshold ε g ;
[0118] (2) The change in the likelihood function value during the two iterations is less than the preset threshold ε p .
[0119] In condition (1), when the gradient vector ||g k || is less than the threshold ε g When , it is considered that the likelihood function has converged, then the current parameter set θ k is the solution, which is the optimal parameter.
[0120] In condition (2), it is expressed as: At this point, the likelihood function is considered to have converged, and the current parameter set θ k is the solution, which is the optimal parameter.
[0121] This example is suitable for optimizing parameters for Log, Box-Cox, and Log-sinh transformations. Its mathematical modeling process is implemented in the Python programming language, facilitating automated precipitation normal transformation. Specifically, this example constructs a likelihood function and employs maximum likelihood estimation for optimization, deriving analytical solutions for the gradients of different parameters to adapt to precipitation distribution characteristics under different climatic conditions, thereby effectively improving the accuracy of precipitation data analysis results.
[0122] Example 2
[0123] This embodiment applies the precipitation normalization analysis method based on gradient parameter optimization proposed in Example 1 and proposes a specific implementation process.
[0124] This example uses monthly precipitation data from the Global Precipitation Climatology Centre as input and performs normal transformations on the input precipitation data, including Log, Box-Cox, and Log-sinh transformations. The specific steps are as follows:
[0125] S1. Use the open_dataset function in the Python third-party library xarray to read the Global Precipitation Climatology Centre dataset in NetCDF format. Then extract the global precipitation observation data for July, obtain the precipitation data to be analyzed, and store it in a variable named xr_gpcc_precip.
[0126] S2. Perform mathematical modeling analysis on the precipitation data collected in S1.
[0127] The deletion threshold x0 is set to 0.01 and stored in a variable named threshold. All values less than or equal to x0 in the precipitation data are replaced by x0, and their position indexes are recorded in a variable named mask. At the same time, the number of samples greater than x0 and less than or equal to x0 are stored in variables named n1 and n0, respectively.
[0128] Then, the natural logarithm calculation is completed through the log function in Numpy and Scipy, the hyperbolic sine calculation is completed through the sinh function, the exponential calculation is completed through the power function, and the error function calculation is completed through the erf function, thereby completing the construction of the normal transformation and likelihood function.
[0129] S3. Based on S2, perform gradient analysis on the log-likelihood function and encapsulate the mathematical process into a function.
[0130] S3.1. Based on the log-likelihood function form in S2, derive its gradient with respect to different parameters, including normal distribution parameters and normal transformation parameters, where the gradient with respect to parameter μ is Z , σ Z The gradient calculations of , c, λ1, λ2, α, and β are defined as functions grad_mu, grad_sigma, grad_c, grad_l1, grad_l2, grad_alpha, and grad_beta, respectively.
[0131] S3.2. Define the joint probability density calculation, Log transformation Jacobian matrix calculation, Box-Co x transformation Jacobian matrix calculation and Log-sinh transformation Jacobian matrix calculation in the likelihood function as functions norm, jac_log, jac_boxcox and jac_logsinh respectively, and combine them with the functions in S3.1 to encapsulate them into the class Likelihood Funct ion.
[0132] S3.3. Define the Log, Box-Cox, and Log-sinh transformations as log, boxcox, and logsinh functions, respectively, and encapsulate them into the class PowerTrans.
[0133] S3.4. Save the functions and classes defined above as .py files.
[0134] S4. Call the function encapsulated in S3 through the import statement in Python to perform a normal transformation on the precipitation data of the Global Precipitation Climatology Centre grid by grid.
[0135] S4.1. Set multiple initial points, that is, different initial estimates of each parameter. Based on the log-likelihood function and its gradient in S2 and S3, use the quasi-Newton method to optimize the parameters through the optimize.minimize function in Scipy.
[0136] S4.2 From the results obtained at different initial points, select the group with the largest log-likelihood function value, and use the corresponding parameter optimization results as the parameters of the precipitation normal transformation.
[0137] S4.3. Apply different normal transformations (Log, Box-Cox, and Log-sinh transformations) to different grids in turn to complete the normal transformation of all precipitation.
[0138] S4.4. Taking three of the grids as an example, use the pyplot.hist function in Matplotlib to draw the frequency distribution histogram of the standardized precipitation data before and after the normal transformation, as shown in Figure 2 shown.
[0139] Figure 2 In the figure, the original precipitation data represented by the first row shows a positive skewness as a whole, while the results of the second to fourth rows show left-right symmetric results, indicating that the present invention can effectively estimate the normal transformation parameters and better realize the normalization of precipitation data.
[0140] S4.5. Use the pyplot.scatter function to draw the normal distribution quantile map of standardized precipitation before and after the transformation, as shown in the following example: Figure 3 shown.
[0141] Figure 3 In the figure, the first row shows the results of the original precipitation data. It can be seen that the scatter plot deviates from the 1:1 line, indicating that the original data does not conform to the normal distribution, while the results of different transformations shown in rows 2 to 4 are distributed along the 1:1 line as a whole, indicating that the normalized variables obtained based on the present invention obey the normal distribution.
[0142] S4.6. Use the skew, kurtosis, shapiro, and pearsonr functions in Scipy and Numpy to test the normality of precipitation after normal transformation. Use Basemap to plot the calculated skewness coefficient, kurtosis coefficient, Shapiro-Wilk test P value, and Filliben r statistic value.
[0143] From the different normality test indices, it can be seen that compared with the original precipitation data, the normality of precipitation after normal transformation has been significantly improved overall, indicating that the present invention can effectively estimate the parameters of different normal transformations of Log, Box-Cox and Log-sinh to adapt to different climate characteristics around the world, and has good application effect and stability.
[0144] Example 3
[0145] This embodiment proposes a precipitation normalization analysis system based on gradient parameter optimization, which is applied to the precipitation normalization analysis method based on gradient parameter optimization proposed in Example 1. Figure 4 , which is a structural diagram of the precipitation normalization analysis system of this embodiment.
[0146] The precipitation normalization analysis system based on gradient parameter optimization proposed in this embodiment includes:
[0147] The data acquisition module is used to obtain precipitation data to be analyzed.
[0148] The normal transformation module is used to perform normal transformation on the precipitation data according to a preset normal transformation model to obtain a normal variable Z.
[0149] The normal distribution module is used to make the normal variable Z obey the normal distribution and construct the joint probability density function of the normal variable Z.
[0150] An optimization module is used to construct a likelihood function for parameter optimization based on the normal transformation model and the joint probability density function, optimize the likelihood function by deriving an analytical expression of the gradient vector of the likelihood function, and update the normal transformation model in the normal transformation module after satisfying a preset termination condition and obtaining the optimal parameters that make the likelihood function take the maximum value.
[0151] The analysis module is used to perform modeling analysis based on the normal variable Z output by the normal transformation module after optimization and update, and output the precipitation normalization analysis results.
[0152] In this embodiment, the optimization module optimizes the parameters of the Log, Box-Cox, and Log-sinh transformations, and derives analytical solutions for the gradients of different parameters to adapt to the precipitation distribution characteristics under different climatic conditions, thereby effectively improving the accuracy of precipitation data analysis results.
[0153] Furthermore, in an optional embodiment, the normal transformation module includes at least one of a Log transformation unit, a Box-Cox transformation unit, and a Log-sinh transformation unit.
[0154] Furthermore, in an optional embodiment, the data acquisition module is also used to regard the values in the precipitation data that are less than or equal to the deletion threshold x0 as deleted values according to a preset deletion threshold x0, and then send them to the normal transformation module to obtain the corresponding normal variable Z, and then input it into the normal distribution module to make the normal variable Z after the deletion process obey the normal distribution, so as to further construct the normal distribution probability density function.
[0155] Furthermore, in an optional embodiment, the optimization module uses the quasi-Newton method to iteratively optimize the likelihood function based on the gradient vector. 0 Randomly select several random points from the uniform distribution as the initial points of the quasi-Newton method to solve, and finally select the parameter combination that makes -logp(X|θ) obtain the minimum value (that is, logp(X|θ) obtains the maximum value) from multiple solution results as the final parameter optimization result θ opt .
[0156] The same or similar reference numerals correspond to the same or similar components;
[0157] The terms used in the drawings to describe positional relationships are for illustrative purposes only and should not be construed as limiting this patent;
[0158] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.
Claims
1. A precipitation normalization analysis method based on gradient parameter optimization, characterized in that: The following steps are involved: S1. Obtain precipitation data to be analyzed; S2. Constructing a normal transformation model and performing a normal transformation on the precipitation data to obtain a normal variable Z; wherein the normal transformation model includes corresponding normal transformation parameters; S3, making the normal variable Z obey the normal distribution, and constructing the joint probability density function of the normal variable Z; The step S3 further includes the following steps: treating the values in the precipitation data that are less than or equal to the deletion threshold x0 as deleted values, and assuming that the normal variable Z after the deletion process obeys the normal distribution, Used to construct the joint probability density function; In the step S3, the expression of the joint probability density function constructed based on the normal variable Z after the censoring process is as follows: Where z i ∈Z represents the i-th precipitation data sample in the normal variable Z that has undergone normal transformation; μ Z and σ Z Indicates the mean and standard deviation of the normal variable Z that obeys the normal distribution; p N (·) represents the probability density function of the normal variable Z obeying the normal distribution, φ N (·) represents the cumulative distribution function of the normal variable Z; Ω1 represents the set of sample indices whose precipitation data is greater than the censoring threshold x0, and the number is recorded as n1; Ω0 represents the set of sample indices whose precipitation data is less than or equal to the censoring threshold x0, and the number is recorded as n0, and n = n0 + n1; S4. Constructing a likelihood function for parameter optimization based on the normal transformation model and the joint probability density function; wherein the parameters to be optimized include normal distribution parameters and the normal transformation parameters; In the step S4, based on the normal transformation model and the joint probability density function, the expression of the likelihood function for parameter optimization is constructed as follows: Where θ represents the parameter set in the likelihood function p(X|θ), including the normal distribution parameter μ Z and σ Z and normal transformation parameters; J represents the Jacobian matrix of the normal transformation; The likelihood function is expressed in logarithmic form as follows: Wherein, the gradient vector is composed of the first-order partial derivative of the log-likelihood function logp(X|θ) with respect to the parameter θ; S5. Optimizing the likelihood function by deriving an analytical gradient vector of the likelihood function until a preset termination condition is satisfied, thereby obtaining optimal parameters that maximize the likelihood function. S6. Update the normal transformation model based on the optimal parameters, and perform normal transformation and modeling analysis on the precipitation data to obtain precipitation normalization analysis results.
2. The precipitation normalization analysis method according to claim 1, characterized in that: In step S2, the constructed normal transformation model is based on one or more of Log transformation, Box-Cox transformation or Log-sinh transformation; Among them, the expression of the normal transformation model based on Log transformation is as follows: Z Log (X;c)=log(X+c); The expression of the normal transformation model based on Box-Cox transformation is as follows: The expression of the normal transformation model based on Log-sinh transformation is as follows: Where X represents the sample set of precipitation data; Z Log (·) represents the set of normal variables after Log transformation, c is the normal transformation parameter of Log transformation; Z Box-Cox (·) represents the set of normal variables after Box-Cox transformation, λ1 and λ2 are the normal transformation parameters of Box-Cox transformation; Z Log-sinh (·) represents the set of normal variables after Log-sinh transformation, and α and β are the normal transformation parameters of Log-sinh transformation.
3. The precipitation normalization analysis method according to claim 1 or 2, characterized in that: In the step S5, the specific steps include: Set the starting point θ of the parameter to be optimized 0 ; The quasi-Newton method is used to iteratively optimize the likelihood function based on the gradient vector until the preset termination condition is met, and the optimal parameters that make the likelihood function take the maximum value are obtained; the iterative solution formula is as follows: Where θ k+1 and θ k Indicates the value of the parameter to be optimized in the k+1th and kth iterations; g k Represents the value of the gradient vector composed of the parameter set θ in the likelihood function at the kth iteration, where the parameter set θ includes the normal distribution parameter μ Z and σ Z and normal transformation parameters; represents the inverse matrix of the Hessian matrix at the kth iteration.
4. The precipitation normalization analysis method according to claim 3, characterized in that: The termination condition includes at least one of the following conditions: (1) The value of the gradient vector g in the current iteration k Less than the preset threshold ε g ; (2) The change in the likelihood function value during the two iterations is less than the preset threshold ε g .
5. The precipitation normalization analysis method according to claim 4, characterized in that: Set the starting point θ of the parameter to be optimized 0 The steps include: Set the initial estimate of the parameter θ 0 , and assume that the parameter θ 0 It follows a uniform distribution within its range: i 0 ~U(B l ,B u ) Among them B l With B u They represent the lower and upper bounds of the parameter θ respectively; From the parameter θ 0 Several random points are randomly selected from the uniform distribution as the initial points of the quasi-Newton method for solution.
6. A precipitation normalization analysis system based on gradient parameter optimization, applied to the precipitation normalization analysis method according to any one of claims 1 to 5, characterized in that: include: A data acquisition module is used to obtain precipitation data to be analyzed; A normal transformation module, configured to perform a normal transformation on the precipitation data according to a preset normal transformation model to obtain a normal variable Z; A normal distribution module, used to make the normal variable Z obey the normal distribution and construct a joint probability density function of the normal variable Z; an optimization module, configured to construct a likelihood function for parameter optimization based on the normal transformation model and the joint probability density function, optimize the likelihood function by deriving an analytical expression of the gradient vector of the likelihood function, and update the normal transformation model in the normal transformation module after satisfying a preset termination condition and obtaining the optimal parameters that maximize the likelihood function; The analysis module is used to perform modeling analysis based on the normal variable Z output by the normal transformation module after optimization and update, and output the precipitation normalization analysis results.
7. The precipitation normalization analysis system according to claim 6, characterized in that: The normal transformation module includes at least one of a Log transformation unit, a Box-Cox transformation unit, and a Log-sinh transformation unit.