Precipitation missing data interpolation construction method, equipment, medium and product
By building multiple machine learning models (BPNN, RF, SVR) and combining MLR models for parameter optimization, the problem of low interpolation accuracy of precipitation missing data in traditional methods is solved, and higher interpolation accuracy and reliability are achieved.
Patent Information
- Application Number
- CN202411639277.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-03-11
AI Technical Summary
The traditional method of deficient precipitation data interpolation has low accuracy and cannot effectively and accurately interpolate deficient precipitation data.
By obtaining the historical precipitation data of all meteorological sites in the target basin, dividing the training set, verification set and prediction set, and building BPNN model, RF model, SVR model and MLR model, combining these models for parameter optimization, and finally interpolation of the precipitation missing data through the MLR model.
It improves the accuracy and reliability of data interpolation of precipitation missing data, reduces interpolation uncertainty, and enhances the accuracy and adaptability of data interpolation.
Smart Images

Figure CN119598107A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of rainfall data processing, and in particular to a method, device, medium and product for interpolating and constructing missing precipitation data. Background Art
[0002] The integrity of meteorological raw data is an important basis for the calculation of water resources and water environment, and the interpolation of missing data in meteorological observations is an important step in the compilation of meteorological data. At present, traditional data interpolation methods are mainly based on meteorological models, conceptual models, physical models or mathematical models. Among them, the regression forms of traditional meteorological models and conceptual models are relatively simple and cannot adapt to the meteorological environment of different regions, resulting in the inability to accurately and effectively interpolate missing precipitation data. When simulating complex meteorological environments, physical models require more parameter support, the modeling process is more difficult, and the accuracy of interpolation of missing precipitation data is also low. For mathematical models, methods such as Lagrange interpolation and Newton interpolation are more suitable for data interpolation. They have high requirements for the integrity of data before and after the missing values. The real-time interpolation of monitoring data will be greatly restricted, and the interpolation of missing precipitation data cannot be effectively and accurately realized. In summary, the accuracy of the above traditional data interpolation methods is low. Therefore, how to improve the accuracy of interpolation of missing precipitation data is a technical problem that needs to be solved in basin rainfall monitoring. Summary of the invention
[0003] The purpose of this application is to provide a method, device, medium and product for constructing precipitation missing data interpolation, which can improve the accuracy of precipitation missing data interpolation.
[0004] To achieve the above objectives, this application provides the following solutions:
[0005] In a first aspect, the present application provides a method for interpolating missing precipitation data, the method comprising the following steps:
[0006] The historical precipitation data of all meteorological stations in the target watershed are obtained; the meteorological stations include the meteorological stations to be interpolated and the remaining meteorological stations in the watershed.
[0007] The data set is divided according to the historical precipitation data to determine a training set, a validation set and a prediction set; the training set and the validation set are data corresponding to a period when the precipitation of the meteorological station to be interpolated and the precipitation of the remaining meteorological stations in the basin are known, and the prediction set is data corresponding to a period when the precipitation of the meteorological station to be interpolated is unknown and the precipitation of the remaining meteorological stations in the basin is known.
[0008] A BPNN model, a RF model and a SVR model are constructed respectively, and the BPNN model, the RF model and the SVR model are trained respectively using the training set to obtain a final BPNN model, a final RF model and a final SVR model.
[0009] An MLR model is constructed according to the final BPNN model, the final RF model and the final SVR model, and the performance of the MLR model is verified and parameters are optimized using the verification set to obtain the final MLR model.
[0010] The prediction set is input into the final MLR model to obtain the interpolation value of the meteorological station to be interpolated; the interpolation value is the interpolation value corresponding to the unknown precipitation in the historical precipitation data of the meteorological station to be interpolated.
[0011] Optionally, obtaining historical precipitation data of all meteorological stations in the target watershed includes the following steps:
[0012] Obtain precipitation data for each of the meteorological stations in the target watershed within a set time period.
[0013] The precipitation data are sorted to obtain time series data.
[0014] The historical precipitation data is generated according to the time series data.
[0015] Optionally, dividing the data set according to the historical precipitation data to determine the training set, the validation set and the prediction set specifically includes the following steps:
[0016] The data corresponding to a period in which the precipitation of the meteorological station to be interpolated and the precipitation of the remaining meteorological stations in the basin are all known in the historical precipitation data are divided into a training set.
[0017] The data corresponding to another period in which the precipitation of the meteorological station to be interpolated and the precipitation of the remaining meteorological stations in the basin are known in the historical precipitation data are divided into a validation set.
[0018] The data corresponding to the period in the historical precipitation data when the precipitation of the meteorological station to be interpolated is unknown and the precipitation of the remaining meteorological stations in the basin is known are divided into a prediction set.
[0019] Optionally, constructing an MLR model according to the final BPNN model, the final RF model and the final SVR model, and using the validation set to perform performance verification and parameter optimization on the MLR model to obtain the final MLR model specifically includes the following steps:
[0020] The training output result of the final BPNN model, the training output result of the final RF model and the training output result of the final SVR model are used as three input vectors of the MLR model, and the MLR model is constructed using the least squares method.
[0021] The performance of the MLR model is verified using the verification set, and the model parameters of the MLR model are optimized and adjusted using a grid search method to obtain the final MLR model.
[0022] Optionally, the performance of the MLR model is verified using the verification set, and the model parameters of the MLR model are optimized and adjusted using a grid search method to obtain the final MLR model, which specifically includes the following steps:
[0023] The validation set is input into the MLR model, and the performance of the MLR model is evaluated and verified using an evaluation index based on the interpolated values output by the MLR model and the measured values in the validation set to obtain an evaluation and verification result.
[0024] It is determined whether the evaluation verification result is greater than an evaluation threshold, and whether to perform parameter optimization on the MLR model according to the determination result.
[0025] When the evaluation verification result is greater than the evaluation threshold, the MLR model is used as the final MLR model.
[0026] When the evaluation verification result is less than or equal to the evaluation threshold, the grid search method is used to optimize and adjust the model parameters of the MLR model, and return to the step of "inputting the verification set into the MLR model, and using the evaluation index to evaluate and verify the performance of the MLR model according to the interpolated values output by the MLR model and the measured values in the verification set to obtain an evaluation verification result", and continue to evaluate and verify the optimized and adjusted MLR model until the evaluation verification result is greater than the evaluation threshold.
[0027] Optionally, the evaluation indicators include PCC, NSE and Pbias.
[0028] Optionally, after the step of inputting the prediction set into the final MLR model to obtain the interpolation value of the meteorological station to be interpolated, the precipitation missing data interpolation construction method further includes the following steps:
[0029] According to the interpolated value of the meteorological station to be interpolated and the measured value in the historical precipitation data, the precipitation process line of the meteorological station to be interpolated is drawn; the precipitation process line is a curve of precipitation change over time, with time as the horizontal axis and precipitation as the vertical axis.
[0030] In a second aspect, the present application further provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the precipitation missing data interpolation construction method described in the first aspect.
[0031] In a third aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the precipitation missing data interpolation and construction method described in the first aspect is implemented.
[0032] In a fourth aspect, the present application further provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, the precipitation missing data interpolation and construction method described in the first aspect is implemented.
[0033] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0034] The present application provides a method, device, medium and product for interpolating missing precipitation data, which combines multiple models such as BPNN model, RF model, SVR model and MLR model, and uses three machine learning models, namely BPNN model, RF model and SVR model, to construct an MLR model for interpolating missing precipitation data. The historical precipitation data is first divided into a training set, a validation set and a prediction set, and the BPNN model, RF model and SVR model are trained respectively using the training set to obtain the final BPNN model, the final RF model and the final SVR model. The validation set is then used to perform performance verification and parameter optimization on the MLR model to obtain the final MLR model, thereby ensuring the interpolation performance of the final MLR model for missing precipitation data. Finally, the missing precipitation data is interpolated by the MLR model to obtain accurate and reliable interpolation values, thereby reducing the uncertainty of interpolation of missing precipitation data, and thus improving the accuracy and reliability of data interpolation of the MLR model. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A flowchart of a method for interpolating missing precipitation data provided in one embodiment of the present application.
[0037] Figure 2A schematic diagram of a precipitation missing data interpolation construction method provided in one embodiment of the present application.
[0038] Figure 3 This is a schematic diagram of the results of the Pearson correlation coefficient PCC2 obtained from the validation set of the adjusted BPNN, RF, SVR, and MLR models provided in an embodiment of the present application under different training set and validation set division conditions.
[0039] Figure 4 This is a schematic diagram of the results of the Nash efficiency coefficient NSE2 obtained from the validation set of the adjusted BPNN, RF, SVR, and MLR models provided in an embodiment of the present application under different training set and validation set division conditions.
[0040] Figure 5 A schematic diagram of the results of the percentage deviation Pbias2 obtained from the validation set of the adjusted BPNN, RF, SVR, and MLR models provided in one embodiment of the present application under different training set and validation set division conditions.
[0041] Figure 6 This is a schematic diagram of the results of the Pearson correlation coefficient PCC1 obtained from the training set and the Pearson correlation coefficient PCC2 obtained from the validation set under different training set and validation set divisions of the adjusted MLR model provided in one embodiment of the present application.
[0042] Figure 7 A schematic diagram of the results of the Nash efficiency coefficient NSE1 obtained from the training set and the Nash efficiency coefficient NSE2 obtained from the validation set under different training set and validation set divisions of the adjusted MLR model provided in one embodiment of the present application.
[0043] Figure 8 A schematic diagram of the results of the percentage deviation Pbias1 obtained from the training set and the percentage deviation Pbias2 obtained from the validation set under different training set and validation set divisions of the adjusted MLR model provided in one embodiment of the present application.
[0044] Fig. 9 A schematic diagram of a precipitation process line result provided in one embodiment of the present application. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0047] like Figure 1 As shown, this embodiment provides a method for interpolating missing precipitation data, and the method for interpolating missing precipitation data includes the following steps.
[0048] Step S1, obtaining historical precipitation data of all meteorological stations in the target watershed, wherein the meteorological stations include the meteorological stations to be interpolated and the remaining meteorological stations in the watershed.
[0049] In this embodiment, step S1 obtains historical precipitation data of all meteorological stations in the target watershed, which specifically includes the following steps.
[0050] Step S11, obtaining precipitation data of each meteorological station in the target basin within a set time period.
[0051] Step S12: sort the precipitation data to obtain time series data.
[0052] Step S13: Generate historical precipitation data based on the time series data.
[0053] This embodiment collects historical precipitation data of each meteorological station in the target watershed, organizes the precipitation date, precipitation amount and other data of the known meteorological stations and the meteorological stations to be interpolated in the target watershed, and obtains the historical precipitation data, specifically including obtaining the precipitation data of multiple meteorological stations or hydrological stations within a certain target watershed within a set time period, and organizes the precipitation data into time series data. The precipitation data includes the precipitation observation data and the precipitation observation date of each meteorological station or hydrological station, and generates historical precipitation data based on the time series data, so as to divide the historical precipitation data into a training set, a validation set and a prediction set.
[0054] Step S2: divide the data set according to the historical precipitation data to determine the training set, the validation set and the prediction set. The training set and the validation set are data corresponding to the period when the precipitation of the meteorological station to be interpolated and the precipitation of the other meteorological stations in the basin are known, and the prediction set is data corresponding to the period when the precipitation of the meteorological station to be interpolated is unknown and the precipitation of the other meteorological stations in the basin is known.
[0055] In this embodiment, step S2 divides the data set according to the historical precipitation data to determine the training set, the validation set and the prediction set, which specifically includes the following steps.
[0056] Step S21, divide the data corresponding to a certain period in which the precipitation of the meteorological station to be interpolated and the precipitation of the remaining meteorological stations in the basin are known in the historical precipitation data into a training set, which is used for the training of machine learning models such as BPNN (Back Propagation Neural Network) model, RF (Random Forest) model and SVR (Support Vector Regression) model.
[0057] Step S22: divide the data corresponding to another period in which the precipitation of the meteorological station to be interpolated and the precipitation of the remaining meteorological stations in the basin are known into a validation set, which is used to verify the accuracy of the MLR (Multiple Linear Regression) model and provide a basis for its parameter adjustment.
[0058] Step S23, divide the data corresponding to the period in the historical precipitation data when the precipitation of the meteorological station to be interpolated is unknown and the precipitation of the remaining meteorological stations in the basin is known into a prediction set for input into the final MLR model and output of the interpolated value.
[0059] Step S3: construct a BPNN model, a RF model and a SVR model respectively, and use the training set to train the BPNN model, the RF model and the SVR model respectively to obtain a final BPNN model, a final RF model and a final SVR model.
[0060] In this embodiment, step S3 specifically includes the following steps.
[0061] Step S31, select the sigmoid function as the activation function of the BPNN model, the purpose of which is to describe the relationship between the input signal and the output signal of the neuron as a monotone differentiable function in (0, 1) to ensure the nonlinear characteristics of the output value. The expression of the sigmoid function is:
[0062]
[0063] Among them, x is the eigenvalue of the input layer.
[0064] Then set the number of hidden layer neuron nodes of the BPNN model, and its empirical formula is:
[0065]
[0066] Among them, n1 is the number of hidden layer nodes; n is the number of input layer nodes; m is the number of output layer nodes; a is a constant ranging from 1 to 10.
[0067] Step S32, set the number of decision trees and the maximum depth of the tree of the RF model. The value range of the number of decision trees is set according to the training set capacity, that is, 1 < number of decision trees < training set capacity. Since it is not sensitive to the impact of random forest, the step size of the number of decision trees is set to 50 in this embodiment, and the maximum depth of the tree is in the range of 1 to 5, with a step size of 1.
[0068] Step S33, select the radial basis function kernel (RBFK) as the kernel function of the SVR model, convert the nonlinear problem into a linear problem, and then find the linear regression relationship more easily. Set the penalty coefficient and kernel function scale of the SVR model. In this embodiment, the penalty coefficient is an integer power of 10, ranging from 0.0001 to 10000, and the kernel function scale ranges from 1 to 10, with a step size of 1.
[0069] Step S34, input the training set data into the BPNN model, randomly assign initial weights to the connecting lines of any two adjacent nodes, randomly assign thresholds to each node, forward propagate the model, weight the input data through each layer, perform nonlinear transformation through the activation function after reaching the threshold at each node, and obtain the training results layer by layer, and calculate the error between the result and the actual value. The error is made to descend along the gradient by back propagation, so as to adjust the connection weight and node threshold. Re-enter the sample data, and judge whether the error between the model output result and the actual data after several iterations meets the training requirements. If not, it is necessary to continue iteration and gradually reduce the error until it meets the training requirements, such as reaching the maximum number of iterations or the error meets the training requirements, and obtain the trained final BPNN model and its training output results.
[0070] Step S35, input the training set data into the RF model, use random sampling to repeat sampling with replacement from the original sample set, and form k new training sets equal to the capacity of the training set, that is, k independent regression decision trees, and train these k sampling sets separately to form corresponding k weak learners. The regression results obtained by the k weak learners are arithmetic averaged to obtain the trained final RF model and its training output results.
[0071] Step S36: The data of the meteorological stations to be interpolated in the training set are used as the target vector, and the remaining data are input into the SVR model as the feature matrix. A function is found according to the preset interval so that most of the data points fall within the interval. The nonlinear function in the low-dimensional space is mapped to the high-dimensional space through the kernel function. The prediction error of the data points outside the interval is minimized by gradient descent to obtain the trained final SVR model and its training output results.
[0072] Step S4: construct an MLR model based on the final BPNN model, the final RF model and the final SVR model, and use the validation set to perform performance verification and parameter optimization on the MLR model to obtain the final MLR model.
[0073] In this embodiment, step S4 constructs an MLR model according to the final BPNN model, the final RF model and the final SVR model, and uses the validation set to perform performance verification and parameter optimization on the MLR model to obtain the final MLR model, which specifically includes the following steps.
[0074] Step S41: The training output results of the final BPNN model, the training output results of the final RF model and the training output results of the final SVR model are used as three input vectors of the MLR model, and the MLR model is constructed using the least squares method.
[0075] Step S42: Use the validation set to verify the performance of the MLR model, and use the grid search method to optimize and adjust the model parameters of the MLR model to obtain the final MLR model.
[0076] In this embodiment, step S42 uses a validation set to verify the performance of the MLR model, and uses a grid search method to optimize and adjust the model parameters of the MLR model to obtain the final MLR model, which specifically includes the following steps.
[0077] Step S421: input the validation set into the MLR model, and evaluate and verify the performance of the MLR model using evaluation indicators based on the interpolated values output by the MLR model and the measured values in the validation set to obtain an evaluation and verification result.
[0078] In this embodiment, the evaluation indicators include PCC (Pearson's Correlation Coefficient), NSE (Nash-Sutcliffe Efficiency coefficient), Pbias (Percent bias), etc. The calculation formulas of each evaluation indicator are as follows.
[0079]
[0080] Among them, Q si is the simulated precipitation on the i-th day; Q oi is the measured precipitation on the ith day; the range of PCC is -1 to 1. The closer it is to 1, the better the simulation effect is.
[0081]
[0082] Among them, Qsi is the simulated precipitation on the i-th day; Q oi is the measured precipitation on the i-th day; the range of NSE is from negative infinity to 1. The closer it is to 1, the higher the quality of the simulation.
[0083]
[0084] Among them, Q si is the simulated precipitation on the i-th day; Q oi is the measured precipitation on the i-th day; when Pbias is closer to 0, the simulation performance is better.
[0085] Step S422: determine whether the MLR model fitting accuracy requirement is met. Specifically, it can be determined whether the evaluation verification result is greater than the evaluation threshold, and whether to optimize the parameters of the MLR model according to the judgment result. There are the following two situations.
[0086] (1) When the evaluation verification result is greater than the evaluation threshold, the MLR model is taken as the final MLR model.
[0087] (2) When the evaluation verification result is less than or equal to the evaluation threshold, the grid search method is used to optimize and adjust the model parameters of the MLR model to improve the accuracy of model prediction, and return to step S421 "input the verification set into the MLR model, and use the evaluation index to evaluate and verify the performance of the MLR model based on the interpolated values output by the MLR model and the measured values in the verification set to obtain the evaluation verification result", and continue to evaluate and verify the optimized and adjusted MLR model until the evaluation verification result is greater than the evaluation threshold.
[0088] In this embodiment, when the model parameters of the MLR model are optimized and adjusted using the grid search method, all possible values of the five parameters, namely, the sigmoid function, the number of hidden layer neuron nodes, the number of decision trees, the maximum tree depth, and the radial basis kernel in step S3, can be arranged and combined, and the space where the five parameters are located can be divided into grids, and the grid points can be tested one by one in turn. Then, the MLR model is evaluated using three-fold cross validation, that is, the training set is first divided into three equal and mutually exclusive subsets, and one of the training subsets is selected in turn without repetition as the parameter adjustment verification set, and the other two training subsets are selected as the parameter adjustment training set, and the parameter adjustment training set is input into the BPNN model, the RF model, and the SVR model respectively, and the MLR model is constructed and the parameter adjustment verification set is input therein to verify the accuracy of the MLR model, which is repeated three times in total, and then the average of the three verification NSEs is taken as the final accuracy evaluation index, so as to ensure that each subset of the training set is verified and reduce the generalization error. Then repeat the above steps until the verification result meets the accuracy requirement, determine the parameters under this condition as the optimal parameter combination, and use the MLR model under this condition as the final MLR model.
[0089] Step S5, input the prediction set into the final MLR model to obtain the interpolation value of the meteorological station to be interpolated; the interpolation value is the interpolation value corresponding to the unknown precipitation in the historical precipitation data of the meteorological station to be interpolated.
[0090] In this embodiment, after the step of inputting the prediction set into the final MLR model to obtain the interpolation value of the meteorological station to be interpolated in step S5, the precipitation missing data interpolation construction method further includes the following steps.
[0091] Step S6, according to the interpolation value of the meteorological station to be interpolated obtained in step S5, combined with the measured value in the historical precipitation data obtained in step S1, so as to obtain complete precipitation data, and then draw the precipitation process line of the meteorological station to be interpolated in combination with the above interpolation value and the measured value. Among them, the precipitation process line is a curve of precipitation change over time drawn with time as the horizontal axis and precipitation as the vertical axis.
[0092] This embodiment constructs a BPNN model, an RF model and an SVR model, and trains the BPNN model, the RF model and the SVR model respectively, and uses the three output vectors of the BPNN model, the RF model and the SVR model to construct an MLR model. The missing precipitation values are interpolated through the MLR model to obtain interpolation values, which can effectively handle the nonlinear relationship between long-term series precipitation data, reduce the uncertainty of missing precipitation data interpolation, and improve the accuracy and reliability of data interpolation. It can also be free from differences in hydrological meteorology and underlying surface conditions in the basin, and improve the universality of the missing precipitation data interpolation method. In addition, the precipitation data used in this embodiment to build and train the model is easy to obtain, which can effectively solve the problems of traditional methods such as difficult to find precipitation data and cumbersome and complicated calculation processes. In addition, this embodiment draws a precipitation process line based on the interpolation value, which helps to intuitively understand the rainfall situation, optimize water resources management and scheduling plans, and promote hydrological and meteorological research and analysis.
[0093] In order to make the technical solution of the present application clearer, the specific implementation process of the technical solution of the present application is described in detail below in the form of examples. Figure 2 As shown, the implementation steps include the following.
[0094] (1) Collect and organize historical precipitation data and determine the training set, validation set, and prediction set.
[0095] (1-1) The measured monthly precipitation data for a total of 360 months from 1991 to 2020 were collected from 10 meteorological stations in a target basin. The precipitation data for all periods of meteorological stations 1 to 8 were complete, the precipitation data for meteorological station 10 was missing for 60 months, and the remaining 300 months were known.
[0096] (1-2) Based on the data obtained in (1-1), in the 300-month data of known precipitation at each meteorological station, 1 / 36, 1 / 18, 1 / 12, 1 / 9, 1 / 6, 1 / 4, 1 / 3, and 1 / 2 of the total data, i.e., 10 months, 20 months, 30 months, 40 months, 60 months, 90 months, 120 months, and 180 months of data are selected as the validation set 2 1 / 36 、Validation set 2 1 / 18 、Validation set 2 1 / 12 、Validation set 2 1 / 9 、Validation set 2 1 / 6 、Validation set 2 1 / 4 、Validation set 2 1 / 3 、Validation set 2 1 / 2 , used for machine learning and model training; the remaining monthly data of the corresponding 300 months are used as training set 1 1 / 36 、Training set 1 1 / 18 、Training set 1 1 / 12 、Training set 11 / 9 、Training set 1 1 / 6 、Training set 1 1 / 4 、Training set 1 1 / 3 、Training set 1 1 / 2 , which is used to verify the accuracy of the model and provide a basis for parameter adjustment; the precipitation data of meteorological stations No. 1 to No. 8 for 60 months in which the precipitation data of meteorological station No. 10 is missing are used as the prediction set to output interpolation data.
[0097] (2) Construct BPNN model, RF model and SVR model and train them.
[0098] (2-1) The sigmoid function is selected as the activation function of the BPNN model. In this embodiment, the training set 1 1 / 2 and validation set 2 1 / 2 For example, the number of neuron nodes in the model input layer is the number of characteristic factors in the training set, that is, 90, and the number of neuron nodes in the model output layer is 1. According to the above-mentioned empirical formula (i.e., formula ) It can be preliminarily determined that the number of neuron nodes in the hidden layer of the model ranges from 10 to 20, and is initially set to 10.
[0099] (2-2) Set the number of decision trees and the maximum depth of the tree in the RF model. Set the value range of the number of decision trees according to the capacity of the training set. In this embodiment, the training set is 1. 1 / 2 and validation set 2 1 / 2 For example, the value range of the number of decision trees is 1<number of decision trees<120, the step size is 50, and it is initially set to 2. The maximum depth of the tree ranges from 1 to 5, the step size is 1, and it is initially set to 1.
[0100] (2-3) Select the radial basis kernel as the kernel function of the SVR model. Set the penalty coefficient and kernel function scale of the SVR model. The penalty coefficient is an integer power of 10, ranging from 0.0001 to 10000, and is initially set to 0.0001. The kernel function scale ranges from 1 to 10, with a step size of 1, and is initially set to 1.
[0101] (2-4) Input the training set data into the BPNN model, randomly assign initial weights to the connection lines between any two adjacent nodes, randomly assign thresholds to each node, and forward propagate the model. The input data is weighted through each layer. After reaching the threshold at each node, a nonlinear transformation is performed through the activation function. The training results are obtained layer by layer, and the error between the calculated result and the actual value is calculated. The error is made to decrease along the gradient through back propagation, so as to adjust the connection weights and node thresholds. Re-input the sample data to determine whether the error between the model output results and the actual data after several iterations meets the training requirements. If not, it is necessary to continue iterating and gradually reduce the error until it meets the training requirements, and obtain the final BPNN model and its training output results.
[0102] (2-5) Input the training set data into the RF model as the sample set, randomly select a sample subset as the training set of the decision tree, randomly select some features as the feature set of the decision tree, build a decision tree based on the training set and the feature set, repeat the above steps, build multiple decision trees, and perform arithmetic averaging on the regression results obtained from multiple decision trees to obtain the final RF model and its training output results.
[0103] (2-6) The precipitation data of the meteorological stations to be interpolated in the training set is used as the target vector, and the remaining data is input into the SVR model as the feature matrix. A function is found according to the preset interval so that most of the data points fall within the interval. The nonlinear function in the low-dimensional space is mapped to the high-dimensional space through the kernel function. The prediction error of the data points outside the interval is minimized by gradient descent to obtain the final SVR model and its training output results.
[0104] (3) Build the MLR model and input the validation set to verify the fitting accuracy of the MLR model.
[0105] (3-1) The training output results of the BPNN model, RF model and SVR model are used as three input vectors, and the MLR model is obtained by the least squares method.
[0106] (3-2) Input the validation set into the MLR model and evaluate the model using evaluation indicators such as PCC, NSE and Pbias.
[0107] (4) Use the grid search method to adjust the model parameters to improve the accuracy until the requirements are met.
[0108] (4-1) Arrange and combine all possible values of the five parameters in step (2), divide the space where the five parameters are located into a grid, and experiment on each grid point one by one.
[0109] (4-2) Use three-fold cross validation to evaluate the model, that is, first divide the training set into three equal and mutually exclusive subsets, select one of the training subsets in turn without duplication as the parameter adjustment verification set, and the other two training subsets as the parameter adjustment training sets, input the parameter adjustment training set into the BPNN model, RF model and SVR model, build the MLR model and input the parameter adjustment verification set into it, verify the model accuracy, repeat three times in total, take the average of the three verification NSE as the final accuracy evaluation indicator, so as to ensure that each training data subset is verified and reduce the generalization error.
[0110] (4-3) Repeat steps (4-1) and (4-2) until the verification result meets the accuracy requirement, determine the parameters under this condition as the optimal parameter combination, and determine the model under this condition as the final MLR model.
[0111] like Figure 3 As shown in the figure, the BPNN, RF, SVR and MLR models adjusted by the grid search method have a higher PCC2 based on the Pearson correlation coefficient PCC2 obtained from the validation set under different training set and validation set divisions, compared with the other three models, and can better improve the interpolation effect.
[0112] like Figure 4 As shown in the figure, the BPNN, RF, SVR and MLR models adjusted by the grid search method have a higher NSE than the other three models under different training set and validation set divisions based on the Nash efficiency coefficient NSE2 obtained based on the validation set, which can better improve the interpolation effect.
[0113] like Figure 5 As shown in the figure, the BPNN, RF, SVR and MLR models adjusted by the grid search method have a lower Pbias than the other three models in terms of the percentage deviation Pbias2 obtained based on the validation set under different training set and validation set divisions, which can better improve the interpolation effect.
[0114] like Figure 6 As shown in the figure, the MLR model adjusted by the grid search method, under different training set and validation set divisions, the Pearson correlation coefficient PCC1 obtained based on the training set and the Pearson correlation coefficient PCC2 obtained based on the validation set, the maximum value of PCC1 is the training set 1 1 / 36 、Prediction set takes prediction set 2 1 / 36 The minimum value of PCC1 is 0.991 when the training set is training set 1. 1 / 2 、Prediction set takes prediction set 2 1 / 2 The maximum value of PCC2 is 0.933 when the training set is training set 1. 1 / 36 、Prediction set takes prediction set 2 1 / 36 The minimum value of PCC2 is 0.975 when the training set is training set 1. 1 / 3 、Prediction set takes prediction set 2 1 / 3 No matter what kind of training set and prediction set are input, the average values of PCC1 and PCC2 are greater than 0.9, which proves that the simulation effect is good.
[0115] like Figure 7 As shown in the figure, the MLR model adjusted by the grid search method, under different training set and validation set divisions, the Nash efficiency coefficient NSE1 obtained based on the training set and the Nash efficiency coefficient NSE2 obtained based on the validation set, the maximum value of NSE1 is the training set 1 1 / 36 、Prediction set takes prediction set 2 1 / 36The minimum value of NSE1 is 0.954 when the training set is training set 1. 1 / 2 、Prediction set takes prediction set 2 1 / 2 The maximum value of NSE2 is 0.884 when the training set is training set 1. 1 / 36 、Prediction set takes prediction set 2 1 / 36 The minimum value of NSE2 is 0.929 when the training set is training set 1. 1 / 3 、Prediction set takes prediction set 2 1 / 3 No matter what training set and prediction set are input, the average values of NSE1 and NSE2 are greater than 0.850, which proves that the simulation quality is high.
[0116] like Figure 8 As shown in the figure, the MLR model adjusted by the grid search method, under different training set and validation set divisions, the percentage deviation Pbias1 obtained based on the training set and the percentage deviation Pbias2 obtained based on the validation set, the maximum value of Pbias1 is the training set taking training set 1 1 / 2 、Prediction set takes prediction set 2 1 / 2 The minimum value of Pbias1 is 2.791% when the training set is training set 1. 1 / 6 、Prediction set takes prediction set 2 1 / 6 0.420% when Pbias2 is the maximum value of training set 1. 1 / 2 、Prediction set takes prediction set 2 1 / 2 The minimum value of Pbias2 is 2.862% when the training set is training set 1. 1 / 18 、Prediction set takes prediction set 2 1 / 18 Regardless of the input training set and prediction set, the average values of Pbias1 and Pbias2 are less than 3%, which proves that the simulation performance is good.
[0117] Furthermore, the above Figure 4 , Figure 5 , Figure 6 It can be proved that under different training set and prediction set conditions, the MLR model has better interpolation effect. Figure 6 , Figure 7 , Figure 8 It can be proved that under different training set and prediction set conditions, the MLR model has higher fitting accuracy and stronger adaptability.
[0118] (5) Input the prediction set into the final MLR model determined in step (4-3), output the corresponding interpolation value, and combine the measured value and interpolation value of the meteorological station to be interpolated to draw the precipitation process line as shown in Fig. 9 shown.
[0119] In an exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the above-mentioned precipitation missing data interpolation construction method is implemented.
[0120] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the above-mentioned precipitation missing data interpolation construction method is implemented.
[0121] In an exemplary embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned precipitation missing data interpolation construction method when executed by a processor.
[0122] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0123] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A method for interpolating missing precipitation data, characterized in that: The precipitation missing data interpolation construction method comprises: Obtain historical precipitation data of all meteorological stations in the target watershed; the meteorological stations include the meteorological stations to be interpolated and the remaining meteorological stations in the watershed; Divide the data set according to the historical precipitation data to determine a training set, a validation set and a prediction set; the training set and the validation set are data corresponding to the period when the precipitation of the meteorological station to be interpolated and the precipitation of the other meteorological stations in the basin are known, and the prediction set is data corresponding to the period when the precipitation of the meteorological station to be interpolated is unknown and the precipitation of the other meteorological stations in the basin is known; Constructing a BPNN model, a RF model and a SVR model respectively, and using the training set to train the BPNN model, the RF model and the SVR model respectively, to obtain a final BPNN model, a final RF model and a final SVR model; According to the final BPNN model, the final RF model and the final SVR model, an MLR model is constructed, and the performance of the MLR model and parameter optimization are performed on the MLR model using the verification set to obtain a final MLR model; The prediction set is input into the final MLR model to obtain the interpolation value of the meteorological station to be interpolated; the interpolation value is the interpolation value corresponding to the unknown precipitation in the historical precipitation data of the meteorological station to be interpolated.
2. The precipitation missing data interpolation construction method according to claim 1, characterized in that: Obtain historical precipitation data for all meteorological stations in the target basin, including: Obtaining precipitation data of each of the meteorological stations in the target watershed within a set period of time; Arranging the precipitation data to obtain time series data; The historical precipitation data is generated according to the time series data.
3. The precipitation missing data interpolation construction method according to claim 1, characterized in that: The data set is divided according to the historical precipitation data to determine the training set, validation set and prediction set, which specifically include: Dividing the data corresponding to a period in which the precipitation of the meteorological station to be interpolated and the precipitation of the remaining meteorological stations in the basin are known in the historical precipitation data into a training set; Dividing the data corresponding to another period in which the precipitation of the meteorological station to be interpolated and the precipitation of the remaining meteorological stations in the basin are known in the historical precipitation data into a validation set; The data corresponding to the period in the historical precipitation data when the precipitation of the meteorological station to be interpolated is unknown and the precipitation of the remaining meteorological stations in the basin is known are divided into a prediction set.
4. The precipitation missing data interpolation construction method according to claim 1, characterized in that: According to the final BPNN model, the final RF model and the final SVR model, an MLR model is constructed, and the performance of the MLR model and parameter optimization are performed on the MLR model using the verification set to obtain the final MLR model, specifically including: The training output result of the final BPNN model, the training output result of the final RF model and the training output result of the final SVR model are used as three input vectors of the MLR model, and the MLR model is constructed by using the least squares method; The performance of the MLR model is verified using the verification set, and the model parameters of the MLR model are optimized and adjusted using a grid search method to obtain the final MLR model.
5. The precipitation missing data interpolation construction method according to claim 4 is characterized in that: The performance of the MLR model is verified by using the verification set, and the model parameters of the MLR model are optimized and adjusted by using a grid search method to obtain the final MLR model, which specifically includes: The validation set is input into the MLR model, and the performance of the MLR model is evaluated and verified using an evaluation index according to the interpolation values output by the MLR model and the measured values in the validation set, to obtain an evaluation and verification result; Determining whether the evaluation verification result is greater than an evaluation threshold, and determining whether to perform parameter optimization on the MLR model according to the determination result; When the evaluation verification result is greater than the evaluation threshold, taking the MLR model as the final MLR model; When the evaluation verification result is less than or equal to the evaluation threshold, the grid search method is used to optimize and adjust the model parameters of the MLR model, and return to the step of "inputting the verification set into the MLR model, and evaluating and verifying the performance of the MLR model using evaluation indicators based on the interpolated values output by the MLR model and the measured values in the verification set to obtain an evaluation verification result", and continue to evaluate and verify the optimized and adjusted MLR model until the evaluation verification result is greater than the evaluation threshold.
6. The precipitation missing data interpolation construction method according to claim 5, characterized in that: The evaluation indicators include PCC, NSE and Pbias.
7. The precipitation missing data interpolation construction method according to claim 1, characterized in that: After the step of inputting the prediction set into the final MLR model to obtain the interpolation value of the meteorological station to be interpolated, the precipitation missing data interpolation construction method further includes: According to the interpolated value of the meteorological station to be interpolated and the measured value in the historical precipitation data, the precipitation process line of the meteorological station to be interpolated is drawn; the precipitation process line is a curve of precipitation change over time, with time as the horizontal axis and precipitation as the vertical axis.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the precipitation missing data interpolation construction method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the precipitation missing data interpolation construction method described in any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the precipitation missing data interpolation construction method described in any one of claims 1 to 7 is implemented.