A method and system for correcting precipitation forecast bias based on quantile mapping
By using a method based on quantile mapping and matrix operations, a mapping function from predicted precipitation to observed precipitation is constructed, which solves the problem of low accuracy in correcting predicted precipitation bias in existing technologies and achieves higher-precision climate simulation data correction.
Patent Information
- Application Number
- CN202411384417.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-09-30
AI Technical Summary
Existing technologies are insufficient to effectively improve the accuracy of precipitation forecast bias corrections, especially when considering the zero value, skewed distribution, and variance of forecast precipitation, leading to inconsistencies between climate simulation results and observational data.
A quantile-based mapping method is adopted to construct a mapping function from predicted precipitation to observed precipitation, and matrix operations are used to correct the correlation between predicted precipitation and temperature data variables, thereby achieving correction of univariate and multivariate data.
It improves the accuracy and precision of precipitation forecast bias correction, and effectively reduces the systematic error between climate simulation results and observational data.
Smart Images

Figure CN119357546B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of precipitation forecast correction technology, and more specifically, to a method and system for correcting precipitation forecast bias based on quantile mapping. Background Technology
[0002] As climate change research deepens, an increasing number of impact assessment studies, such as those in hydrology, environmental science, and economics, are using simulation results from Global Climate Models (GCMs) and Regional Climate Models (RCMs) as input data. This trend reflects the growing importance of climate models in scientific research and highlights the crucial impact of climate simulation data quality on interdisciplinary research. However, despite continuous scientific progress in climate modeling, biases persist between climate simulation results and observational data. These biases manifest in statistical characteristics such as mean, variance, extreme values, and even the dependency structure between multiple variables and / or multiple locations, which may differ significantly from results calculated based on historical records. The existence of these biases underscores the inconsistency between climate model output data and actual observations, posing a significant problem for impact assessment studies that rely on such data.
[0003] Currently, methods such as quantile mapping, joint probability distribution, Bayesian joint probability model, and ensemble model output statistics have been proposed for correcting precipitation forecast errors. However, due to the characteristics of precipitation forecasts, such as containing a large number of zero values, following a skewed distribution, and having variance in error difference, it is difficult to obtain high-accuracy correction results using only the above methods. Summary of the Invention
[0004] To overcome the shortcomings of existing technologies in obtaining high-accuracy forecast precipitation bias correction results, this invention provides a forecast precipitation bias correction method and system based on quantile mapping.
[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows:
[0006] A method for correcting forecast precipitation bias based on quantile mapping includes the following steps:
[0007] Acquire historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data to be corrected, and preprocess them to obtain a time-dimensional aligned dataset within the target spatiotemporal range;
[0008] The distribution of the dataset is fitted to obtain a distribution function model;
[0009] Based on the distribution function model, the distribution function and its inverse function of different data are quantified. Based on the quantile mapping, a mapping function from predicted precipitation to observed precipitation is constructed to correct the univariate future predicted precipitation data, and the corrected univariate predicted precipitation data is obtained.
[0010] By using matrix operations, the correlation between forecast precipitation and temperature data variables is corrected, resulting in corrected multivariate forecast precipitation data.
[0011] Furthermore, this invention proposes a precipitation forecast bias correction system based on quantile mapping, applying the precipitation forecast bias correction method proposed in this invention. The system includes:
[0012] The data acquisition module is used to acquire historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data to be corrected, and to preprocess them to obtain a time-dimensional aligned dataset within the target spatiotemporal range;
[0013] The fitting module is used to fit the distribution of the dataset to obtain a distribution function model;
[0014] The univariate correction module is used to quantify the distribution function and its inverse function of different data based on the distribution function model, and to construct a mapping function from forecast precipitation to observed precipitation based on quantile mapping. This module is used to correct the univariate future forecast precipitation data to obtain the corrected univariate forecast precipitation data.
[0015] The multivariate correction module is used to correct the correlation between forecast precipitation and temperature data variables using matrix operations, so as to obtain corrected multivariate forecast precipitation data.
[0016] Furthermore, the present invention also proposes an apparatus comprising a memory and a processor, wherein the memory stores computer-readable instructions, wherein when the computer-readable instructions are executed by the processor, the processor causes the processor to perform all or part of the steps of the forecast precipitation deviation correction method as described in the present invention.
[0017] Furthermore, the present invention also proposes a storage medium storing computer-readable instructions thereon, wherein when the computer-readable instructions are executed by a processor, all or part of the steps of the forecast precipitation deviation correction method as described in the present invention are implemented.
[0018] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0019] This invention constructs a mapping function based on quantile mapping to map forecast precipitation to observed precipitation, which is used to correct systematic errors between forecast and observed data, effectively improving forecast accuracy. By using matrix operation methods, the correlation between variables in forecast precipitation data is corrected, realizing the correction of univariate and multivariate data, effectively improving the accuracy of multivariate forecast precipitation bias correction results. Attached Figure Description
[0020] Figure 1 This is a flowchart illustrating a method for correcting forecast precipitation deviations according to an embodiment of the present invention.
[0021] Figure 2 This is a schematic flowchart illustrating a method for correcting forecast precipitation deviations according to an embodiment of the present invention.
[0022] Figure 3 This is a schematic diagram illustrating the univariate correction result according to an embodiment of the present invention.
[0023] Figure 4 This is a schematic diagram illustrating the correlation correction result according to an embodiment of the present invention.
[0024] Figure 5 This is a time series plot of univariate correction results according to an embodiment of the present invention.
[0025] Figure 6 This is a schematic diagram of the forecast precipitation deviation correction system according to an embodiment of the present invention. Detailed Implementation
[0026] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention as detailed in the appended claims.
[0027] The terminology used in this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The singular forms “a,” “the,” and “the” used in this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0028] It should be understood that although the terms first, second, third, etc., may be used in this invention to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of this invention, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0029] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0030] Example 1
[0031] This embodiment proposes a method for correcting forecast precipitation bias based on quantile mapping, such as... Figure 1 , 2 The diagram shown is a flowchart of the forecast precipitation deviation correction method in this embodiment.
[0032] The precipitation forecast bias correction method based on quantile mapping proposed in this embodiment includes the following steps:
[0033] S1. Acquire historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data to be corrected, and preprocess them to obtain a time-dimensional aligned dataset within the target spatiotemporal range;
[0034] S2. Fit the distribution to the dataset to obtain the distribution function model;
[0035] S3. Based on the distribution function model, quantify the distribution function and its inverse function of different data, and construct a mapping function from predicted precipitation to observed precipitation based on quantile mapping. This function is used to correct the univariate future predicted precipitation data to obtain the corrected univariate predicted precipitation data.
[0036] S4. Using matrix operations, the correlation between the forecast precipitation and temperature data variables is corrected to obtain the corrected multivariate forecast precipitation data.
[0037] In this embodiment, a mapping function is constructed based on quantile mapping to map forecast data to observed data, which is used to correct systematic errors between forecast data and observed data, effectively improving forecast accuracy. Matrix operations are used to correct the correlation between forecast precipitation and temperature data variables, realizing the correction of univariate and multivariate data, effectively improving the accuracy of multivariate forecast precipitation deviation correction results.
[0038] In an optional embodiment, step S1 involves preprocessing the historical observed precipitation data, historical forecast precipitation data, and future forecast precipitation data to be corrected, including the following steps:
[0039] The historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data are divided into extreme data and normal data.
[0040] The data is cropped and aligned along the time dimension according to the preset time and latitude / longitude ranges.
[0041] For example, the time period from “year-month-day” to “year-month-day” and the spatial range of [“longitude range”, “latitude range”] entered as strings determine the target spatiotemporal range for which forecast corrections need to be performed.
[0042] For example, data can be divided into extreme and normal data using methods such as quantiles, indexes, or thresholds.
[0043] In an optional embodiment, step S2 involves fitting a distribution to the dataset, including the following steps: fitting the distribution using one or more of the empirical distribution, gamma distribution, normal distribution, log-normal distribution, and Kappa distribution to construct a distribution function model.
[0044] Alternatively, before fitting the data to the distribution, simulation of historical precipitation distribution can also be included.
[0045] The process of selecting all data based on the preset time and latitude / longitude range is as follows:
[0046] Read all historical observation data and use vectors. express: Among them, o i This represents the value observed for the target, where p is the total length of the target data matrix over time.
[0047] Read the observation information within the input time range and use vector... express: Where n and m are the start and end times of the target time period, respectively;
[0048] Select historical observation data that falls within both the target data range and the target time range, and use vector... express:
[0049] The historical observation data includes historical precipitation data and historical temperature data.
[0050] Similarly, by reading the corresponding historical forecast data, forecast data that falls within both the target data and the target time range is obtained, and vector data is used. express:
[0051] The historical forecast data includes historical forecast precipitation data and historical forecast temperature data.
[0052] Similarly, by reading the future forecast precipitation data to be corrected, we obtain the forecast precipitation that falls within both the target data and the target time range, and then use vector... express.
[0053] The target data includes all observational and forecast data used.
[0054] Alternatively, for precipitation data, a gamma distribution can be used to construct the distribution function model; for temperature data, a normal distribution can be used to construct the distribution function model; and for precipitation data with a high degree of heavy tails, a Kappa distribution can be used to construct the distribution function model.
[0055] In one optional embodiment, the construction of the mapping function from predicted precipitation to observed precipitation based on quantile mapping includes: constructing the mapping function using one of the following methods: classical quantile mapping, quantile increment mapping, detrended quantile mapping, equidistant CDF matching, and CDF transformation.
[0056] Further, optionally, when correcting the future precipitation forecast data using the classical quantile mapping (QM) method, the following steps are included:
[0057] Calculate the quantiles of future forecast precipitation data in historical forecast precipitation data, map them to historical observed precipitation data to establish a mapping relationship between quantiles, and then convert the future forecast precipitation data to be corrected into the corresponding observed data quantiles; the expression is:
[0058]
[0059] in, This indicates the revised future precipitation forecast data; CDF represents the inverse function of the distribution function of historical observed precipitation data. m,h (·) represents the distribution function of historical forecast precipitation data; f t This indicates future precipitation forecast data that is yet to be revised.
[0060] The QM method is a simple statistical interpolation method used to correct forecast data from climate models to observed data. Its principle is to calculate the quantiles of the observed data and the forecast data to be corrected, establish a mapping relationship between the quantiles, and then convert the forecast data to be corrected into the corresponding observed data quantiles to achieve the purpose of correction or standardization. It is characterized by its simplicity and ease of implementation, and better preservation of the overall distribution characteristics of the data.
[0061] Further, optionally, when correcting the future precipitation forecast data using the quantile delta mapping (QDM) method, the following steps are included:
[0062] Estimate the empirical distribution function of forecast precipitation at time t over future periods, and calculate the position of the data point to be corrected within the future empirical distribution function:
[0063]
[0064] Then, based on the location, the ratio between observed precipitation and forecast precipitation is calculated as the scaling factor:
[0065]
[0066] Finally, the scaling coefficient is combined with the traditional quantile mapping model; its expression is:
[0067]
[0068] Among them, f m,p (t) represents the forecast precipitation data at time t; τ m,p (t) represents the position of the data point to be corrected in the future empirical distribution function; It represents the inverse function of the distribution function of historical forecast precipitation data.
[0069] When using QDM for correction, the distribution relationship between historical observation data and future forecast precipitation data is combined, and the internal variation trend of future forecast precipitation is preserved to correct the bias in future precipitation forecasts. While correcting for future precipitation bias, the QDM method also preserves the relative changes in the quantile values of historical and future precipitation. This means that if forecast precipitation shows a trend of increasing or decreasing in the future, this trend will be retained in the corrected data.
[0070] Further, optionally, when correcting the future forecast precipitation data using the detrend quantile mapping (DQM) method, the following steps are included:
[0071] The predicted precipitation data is detrended, and then a quantile mapping relationship is established between the detrended predicted precipitation data and historical observed precipitation data. Finally, the observed distribution is restored based on the trend; the expression is:
[0072]
[0073] in, The average of historical forecast precipitation data. This represents the average of future forecast precipitation data.
[0074] Optionally, when detrending, multiplication is generally used for precipitation and temperature; addition can be used for certain interval variables. This reduces extrapolation caused by trends. If the predicted value exceeds the historical range, some form of extrapolation is needed, such as using parametric distribution methods or constant correction methods.
[0075] Furthermore, one way to avoid frequent extrapolation is to explicitly consider changes in the predicted values. For example, before plotting the magnitudes, first remove the model trend of the long-term average, which will change the future distribution to tend to the support range of the historical distribution, and then reapply the trend.
[0076] Detrending Quadrature Method (DQM) is a commonly used univariate post-processing method for climate change conditions, designed to improve upon the shortcomings of traditional Quadrature Method (QM), particularly considering the relative changes in the mean of model-simulated precipitation. The basic idea of DQM is to remove the long-term trend (e.g., linear trend) from the predicted precipitation before performing quantile mapping, then perform quantile mapping, and finally restore the observed distribution based on the trend. By detrending, DQM better preserves the bias between model-simulated precipitation and observed values, while reducing the impact of systematic biases (e.g., trend bias) on the mapping results. Because DQM more accurately reflects the relationship between model-simulated and observed precipitation, it can improve prediction accuracy.
[0077] Further, optionally, when correcting the future precipitation forecast data using the equidistant CDF matching method, the following steps are included:
[0078] Several equidistant points are selected on the distribution function model of future precipitation forecast data, and the cumulative probability values corresponding to the equidistant points are mapped to the corresponding predicted precipitation data values. Based on the mapping results, each value in the predicted precipitation data is adjusted; the expression is as follows:
[0079]
[0080] Among them, CDF m,p (·) represents the distribution function of future forecast precipitation data; f m,p This indicates the predicted precipitation data value.
[0081] This embodiment takes into account that the traditional QM method can adjust all moments of the observed distribution. Its basic assumption is that the climate distribution does not change significantly over time; that is, its variance and skewness are fixed, and only the mean changes. For a given percentile, we assume that the difference between the model and the observations during training also applies to future periods. This means that the adjustment function remains unchanged, and only a linear shift is needed.
[0082] The equidistant CDF matching method can significantly reduce the differences between observed precipitation data and forecast precipitation caused by scale and location variations, thus enabling a more accurate comparison of their distributions.
[0083] Further, optionally, when correcting the future precipitation forecast data using the CDF-t method, the following steps are included:
[0084] By mapping the distribution function of future forecast precipitation data to the distribution function of historical forecast precipitation data, and performing quantile mapping for each variable individually, the corrected forecast precipitation data is obtained; its expression is:
[0085]
[0086] Among them, CDF m,p (f m,p ) represents the CDF function for forecasting future precipitation data.
[0087] The CDF-t method is mainly based on the characteristics of the cumulative distribution function (CDF). It corrects the forecast precipitation data to be corrected by linearly or nonlinearly transforming the cumulative probability distribution between historical forecast precipitation and the forecast precipitation to be corrected.
[0088] Specifically, this method relates the cumulative distribution function (CDF) of the variable of interest in the model simulation to the CDF of the reference dataset by applying a univariate transformation function T. The CDF-t assumption holds that the transformation equation T remains valid under climatic conditions different from the calibration period, thus generating a new CDF for the bias-corrected variables for the forecast period. Subsequently, the bias-corrected data is obtained by performing a quantile-quantile mapping method between the new (reference) CDF and the CDF simulated in the forecast period. This two-step process allows for consideration of potential changes in the univariate distribution between the calibration and forecast periods during the correction process, representing an extension of the quantile mapping method.
[0089] Specifically, suppose we perform quantile mapping for each variable individually:
[0090] Suppose there exists a transformation T such that the prediction f m,p Can be converted into observation o h :T(CDF o,h (x))=CDF m,h (x);
[0091] The first step in completing the transformation is to estimate the transformation T:
[0092] Assuming the above formula still holds true in the future:
[0093] T(CDFo,p (f))=CDF m,p (f)
[0094]
[0095] Then in CDF s,f After (·) is estimated, the correction result can be calculated according to the following formula:
[0096]
[0097] The calculation was performed based on empirical estimates. Estimating CDF m,p (·)
[0098] In an optional embodiment, step S4 involves using matrix operations to correct the correlation between the forecast precipitation and temperature data variables, including: employing the MBCn method, the TSQM method, and R... 2 D 2 One of the methods, the EC-BC method, adjusts the correlation between variables in the forecast precipitation data.
[0099] Optionally, the correlation relationship can be adjusted using the MBCn (Multivariate Bias Correction with N-dimensional probability density function transform) method, including the following steps:
[0100] The marginal distribution of each variable is corrected based on quantile mapping;
[0101] In each iteration, an orthogonal rotation matrix is generated. The orthogonal rotation matrix is randomly combined with each variable. The marginal distribution of the rotated variables is then corrected using the quantile increment mapping method. The adjusted forecast precipitation data is then obtained based on the quantile mapping. Correlation analysis is performed on the adjusted forecast precipitation data until the similarity of the internal correlation with historical observation data is lower than a preset threshold. Then, the iteration stops and the corrected multivariate forecast precipitation data is output.
[0102] Among them, the MBCn method is a multivariate bias correction technique based on probability density function transformation, used to correct multivariate biases in climate models or other complex system simulations. This method aims to simultaneously consider the dependencies and marginal distributions among multiple variables, such as correlation and covariance, to provide more accurate and comprehensive simulation results.
[0103] Specifically, the MBCn algorithm is used to construct multivariate internal correlations through random matrices, where an orthogonal rotation matrix R can be generated for each iteration j.[j] :
[0104]
[0105] A random combination of initial variables can be obtained by using an orthogonal rotation matrix. This algorithm converges under the background of multivariate Gaussian distribution and random vector iteration. For the rotated variables, the marginal distribution is corrected by the QDM method, and then the inverse transformation is used to obtain the iteration data for the (j+1)th iteration.
[0106]
[0107] After each iteration, the results can be tested for Spearman correlation or Pearson correlation. If there is no significant difference from the internal correlation of the observed data, it can be considered that a relatively good correction result has been obtained.
[0108] Optionally, the correlation relationship can be adjusted using the TSQM (Two-Stage Quantile Mapping) method, including the following steps:
[0109] Historical precipitation forecast data and corrected univariate precipitation forecast data are each constructed into an m×n matrix. and Calculate matrix and The rank of each column is calculated, and its normal score is obtained by normalizing it to obtain its VanderWarden scores matrix. The test statistic is then calculated based on this matrix; its expression is:
[0110] [E m,h ]=[Φ -1 {i / (n+1)}]
[0111] Among them, W m,h Represents the normalized historical forecast matrix; Φ represents the CDF function of the standard normal distribution; i represents... The sorting order of each element in this column; n represents the number of elements in each column;
[0112] Construct the correlation coefficient covariance matrix, and calculate the correction matrix based on the correlation coefficient covariance matrix. and The data were rearranged to obtain the corrected multivariate precipitation forecast; its expression is:
[0113]
[0114] in, and Represents the van der Waals matrix of historical and future forecasts after corrected sorting; [W m,h ] and [W m,p [C] represents the van der Waals matrix of historical and future forecasts before reordering; m,h ] and [C o,f These are the correlation coefficient and covariance matrices of historical forecasts and historical observations, respectively. This represents the inverse matrix of the Cholesky decomposition of the correlation coefficient matrix between precipitation and temperature in historical forecasts; [P o,h [] represents the Cholesky decomposition result of the correlation coefficient matrix between precipitation and temperature in historical observations; This represents the inverse matrix of the Cholesky decomposition of the correlation coefficient matrix between precipitation and temperature in future forecasts.
[0115] In the TSQM method used in this embodiment, the forecast is first corrected using a univariate method, and then the internal relationships are corrected using a shuffle method to improve the accuracy of future climate change predictions.
[0116] Further, alternatively, R can be used. 2 D 2 The (Rank Resampling For Distributions and Dependences) method adjusts the relevance relationship, including the following steps:
[0117] The marginal distribution of each climate variable is adjusted based on the CDF-t method:
[0118]
[0119] Calculate the rank of all dimensions over time t in the corrected future forecast precipitation data and historical observed precipitation data; its expression is:
[0120]
[0121] and [R] o,h [ ] represents the rank set of the corrected future forecast precipitation data and the historical observed precipitation data, respectively. This represents the corrected matrix of future precipitation forecasts; This represents a matrix of historical precipitation data; d = 1, 2, ..., D, where D is the total number of dimensions.
[0122] For any dimension, select a dimension d that will not change before and after the correction as a reference dimension. For each predicted time t, find a time ti. * Make The reconstruction matrix is obtained:
[0123]
[0124] Among them, R o,h (t * ) represents the set matrix of the observation ranks of the matrices after the order has been adjusted; Represents time t in dimension d * The ranking of historical observations; The reconstruction matrix R represents the ordering of future forecasts at time t in dimension d; o,h (t * ) represents the rank matrix of the precipitation-temperature relationship during the observation period;
[0125] The future precipitation forecast data are rearranged based on the reconstruction matrix to obtain corrected multivariate precipitation forecast data.
[0126] Among them, R 2 D 2 This method is a multivariate bias correction approach for high-dimensional climate simulations. It aims to provide a more comprehensive and accurate correction by not only adjusting the distribution of individual variables but also considering the statistical dependencies between different variables and locations. Specifically, in this embodiment, R... 2 D 2 The method is based on the Schaake Shuffle reordering technique, which reorders the samples so that their rank structure corresponds to the rank structure of the reference samples, thereby reconstructing the multivariate dependency structure.
[0127] Alternatively, the EC-BC (Empirical Copula-Bias Correction) method can be used to adjust the correlation, including the following steps:
[0128] The Schaake Shuffle method was used to reconstruct the relationships between variables. The data after univariate bias correction were reordered so that their time series were the same as the time series of historical forecast precipitation data, thus obtaining the corrected multivariate forecast precipitation data.
[0129] The EC-BC method works as follows: First, forecast corrections are applied to each variable. Second, the data after univariate bias correction are reordered so that their time series matches that of the reference sample. This univariate bias correction, performed separately for each variable, allows us to reproduce the time, location, and variable dependencies of the reference data.
[0130] Furthermore, in an optional embodiment, the method further includes the following steps: drawing and visualizing spatial maps and diagnostic maps based on the corrected multivariate forecast precipitation data.
[0131] Example 2
[0132] This embodiment applies the precipitation forecast bias correction method proposed in Embodiment 1 to the open-source Python language platform, forming a precipitation forecast bias correction method for NC files. The steps include:
[0133] (1) Use the Dataset function of the open-source third-party library netcdf and the load_mfdataset of xarray to read the precipitation and temperature data in the .nc file and extract the corresponding precipitation measurement data and spatiotemporal dimensions (time, latitude and longitude) and other information.
[0134] (2) Determine the spatiotemporal regions that need to be corrected for forecasts based on the time period “year-month-day” to “year-month-day” and the spatial range of [“longitude range”, “latitude range”] entered in string form.
[0135] (3) Spatiotemporal analysis was performed using Python third-party libraries xarray and dask. The main contents are as follows: extract the dimensional information of precipitation and temperature, trim the spatial dimension of precipitation and temperature data according to the latitude and longitude of the selected spatial region; trim the temporal dimension of precipitation and temperature data according to the input time range; and align the precipitation and temperature data.
[0136] (4) Using Python's NumPy and SciPy libraries, the precipitation and temperature data are segmented and fitted into specified statistical distributions.
[0137] (5) Using the NumPy and SciPy libraries, the CDF function and its inverse function of different data are quantified. Then, based on the specified mapping relationship between variable distributions, a function is formed that maps the forecast to the observation, and finally, a corrected univariate forecast is formed.
[0138] (6) Using matrix operation methods based on NumPy, the correlation between variables is corrected to obtain the corrected multivariate forecast precipitation data.
[0139] (7) Visualize the attribution results data using Python third-party libraries geopandas and cartopy.
[0140] When plotting the spatial plot, the `plt.subplots` function in Matplotlib is used to set the appropriate sub-canvas size; the `ccrs.PlateCarree()` function in cartopy is used to call the `geoaxes` object in Matplotlib to control its projection type; and the `ax.pcolormesh` method is used to plot the spatial plot. The `fig.add_axes` method is used to add subplots that control the position of the colorbar, the `fig.colorbar` method is used to set the position of the colorbar, the `cbar.set_ticks` method is used to set the tick mark positions, and tick labels are used to display the content. Finally, the `savefig` method of `matplotlib.figure.Figure` is used to save the plotted spatial plot to the specified path.
[0141] For example, the precipitation bias correction method proposed in Example 1 is applied to the precipitation and temperature correction of the CMIP6 model in the Yangtze River Basin from 1901 to 2020.
[0142] Specifically, the precipitation observation data (NetCDF file) and temperature observation data (NetCDF file) required for plotting are first stored in the selected folder, and the variables path_precipitation and path_temperature are defined and their corresponding paths are stored. These files are then read and merged using the xarray.open_mfdataset and geopandas.read_file functions.
[0143] Input the target spatiotemporal range as a string, perform spatiotemporal range clipping using Python third-party libraries xarray and numpy, and correct precipitation and temperature data using Python's numpy and scipy libraries:
[0144] 1) Use xarray.dataset to extract precipitation and observation data. Use the broadcast interface of numpy functions in xarray and filter the precipitation and observation data in set S using the .sel method;
[0145] 2) Use NumPy and SciPy methods to divide the data into extreme and non-extreme events based on a specified method (quantiles, index, or threshold);
[0146] 3) Extract the cropped temperature and precipitation data and correct them:
[0147] First, the `distribution_transform` method is used based on the selected model type and the fitted distribution parameters. Second, the relationships between variables are corrected using either N-pdf or shuffle-based methods. Based on the results of these two steps, the effectiveness of the correction is quantified, as shown below. Figure 3 , 4 The diagrams shown illustrate the univariate correction results and the correlation correction results.
[0148] 4) Use the apply_func broadcast method in xarray and a for loop in Python to repeat the above process for data at different spatial locations to obtain data for visualization.
[0149] Furthermore, spatial plots and diagnostic plots are drawn using the Python third-party libraries Mpl_toolkits and Matplotlib:
[0150] 1) Set the map projection to PlateCarree using the cartopy.crs.ccrs method of cartopy;
[0151] 2) Use the plt.subplots function in the third-party visualization library Matplotlib to set the size of the canvas to be plotted, and use the cartopy.set_extent method to set the latitude and longitude spatial area to be plotted;
[0152] 3) Use the ax.pcolormesh method to draw the spatial map corresponding to the category;
[0153] 4) Use the fig.add_axes method to add subgraphs that control the position of the colorbar, use the cbar.set_ticks method to set the tick positions, and use tick labels to display the content;
[0154] 5) Use the `savefig` method of `matplotlib.figure.Figure` to save the plotted precipitation data visualization to a specified path, such as... Figure 5 The figure shows a time series plot of the univariate correction results.
[0155] Example 3
[0156] This embodiment applies the precipitation forecast bias correction method proposed in Embodiment 1, and proposes a precipitation forecast bias correction system based on quantile mapping, such as... Figure 6 The diagram shown is an architecture diagram of the precipitation forecast deviation correction system based on quantile mapping in this embodiment.
[0157] The precipitation forecast bias correction system based on quantile mapping proposed in this embodiment includes:
[0158] The data acquisition module is used to acquire historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data to be corrected, and to preprocess them to obtain a time-dimensional aligned dataset within the target spatiotemporal range;
[0159] The fitting module is used to fit the distribution of the dataset to obtain a distribution function model;
[0160] The univariate correction module is used to quantify the distribution function and its inverse function of different data based on the distribution function model, and to construct a mapping function from forecast precipitation to observed precipitation based on quantile mapping. This module is used to correct the univariate future forecast precipitation data to obtain the corrected univariate forecast precipitation data.
[0161] The multivariate correction module is used to correct the correlation between forecast precipitation and temperature data variables using matrix operations, so as to obtain corrected multivariate forecast precipitation data.
[0162] It is understood that the system in this embodiment corresponds to the method in Embodiment 1 above, and the options in Embodiment 1 above are also applicable to this embodiment, so they will not be described again here.
[0163] Example 4
[0164] This embodiment proposes a computer device, including a memory and a processor. The memory stores computer-readable instructions, which, when executed by the processor, cause the processor to perform all or part of the steps of the forecast precipitation deviation correction method proposed in Embodiment 1.
[0165] Example 5
[0166] This embodiment proposes a storage medium storing computer-readable instructions, wherein when the computer-readable instructions are executed by a processor, they implement all or part of the steps of the forecast precipitation deviation correction method proposed in Embodiment 1.
[0167] By way of example, the storage medium includes, but is not limited to, USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks or optical disks, and other media capable of storing program code.
[0168] By way of example, the instructions, programs, code sets, or instruction sets may be implemented using conventional programming languages.
[0169] By way of example, the processor includes, but is not limited to, smartphones, personal computers, servers, network devices, etc., for performing all or part of the steps of the forecast precipitation deviation correction method described in Example 1.
[0170] The various embodiments in this invention are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely exemplary. The modules described as separate components may or may not be physically separate. When implementing the present invention, the functions of each module can be implemented in one or more software and / or hardware. Alternatively, some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0171] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art can make other variations or modifications based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A method for correcting forecast precipitation bias based on quantile mapping, characterized in that, Includes the following steps: Acquire historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data to be corrected, and preprocess them to obtain a time-dimensional aligned dataset within the target spatiotemporal range; The distribution of the dataset is fitted to obtain a distribution function model; Based on the distribution function model, the distribution function and its inverse function of different data are quantified. Based on the quantile mapping, a mapping function from predicted precipitation to observed precipitation is constructed to correct the univariate future predicted precipitation data, and the corrected univariate predicted precipitation data is obtained. The mapping function includes the CDF transformation method; The predicted precipitation data is corrected based on the CDF transformation method, including: By mapping the distribution function of future forecast precipitation data to the distribution function of historical forecast precipitation data, and performing quantile mapping for each variable individually, the corrected forecast precipitation data is obtained; its expression is: Among them, CDF m,p (f m,p (t) represents the CDF function for future precipitation forecasts; f m,p (t) represents the future forecast precipitation data to be corrected; CDF m,h (·) represents the distribution function of historical forecast precipitation data; CDF represents the inverse function of the distribution function of historical forecast precipitation data. m,p (·) represents the distribution function of future forecast precipitation data. This indicates the revised future precipitation forecast data; By using matrix operations, the correlation between forecast precipitation and temperature data variables is corrected, resulting in corrected multivariate forecast precipitation data.
2. The method for correcting forecast precipitation deviations according to claim 1, characterized in that, The preprocessing of the historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data to be corrected includes the following steps: The historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data are divided into extreme data and normal data. The data is cropped and aligned along the time dimension according to the preset time and latitude / longitude ranges.
3. The method for correcting forecast precipitation deviations according to claim 1, characterized in that, Fitting a distribution to the dataset includes the following steps: The distribution function model is constructed by fitting one or more of the empirical distribution, gamma distribution, normal distribution, log-normal distribution, and Kappa distribution.
4. The method for correcting forecast precipitation deviations according to any one of claims 1 to 3, characterized in that, The method for constructing a mapping function from predicted precipitation to observed precipitation based on quantile mapping also includes: The mapping function is constructed using one of the following methods: classical quantile mapping, quantile increment mapping, detrended quantile mapping, and equal-distance CDF matching.
5. The method for correcting forecast precipitation deviations according to claim 4, characterized in that, The step of constructing a mapping function from predicted precipitation to observed precipitation based on quantile mapping to obtain corrected univariate predicted precipitation data includes any of the following steps: (1) Correcting the future precipitation forecast data based on the classical quantile mapping method, including: Calculate the quantiles of future forecast precipitation data in historical forecast precipitation data, map them to historical observed precipitation data to establish a mapping relationship between quantiles, and then convert the future forecast precipitation data to be corrected into the corresponding observed data quantiles; the expression is: in, It represents the inverse function of the distribution function of historical observed precipitation data; (2) Correcting the future precipitation forecast data based on the quantile increment mapping method, including: Estimate the empirical distribution function of the predicted precipitation at time t over a future period, calculate the position of the data point to be corrected in the future empirical distribution function, then calculate the scaling factor between observed precipitation and predicted precipitation based on the position, and finally combine the scaling factor with the traditional quantile mapping model; its expression is: Where, τ m,p (t) represents the position of the data point to be corrected in the future empirical distribution function; (3) Correcting the future precipitation forecast data based on the detrended quantile mapping method, including: The predicted precipitation data is detrended, and then a quantile mapping relationship is established between the detrended predicted precipitation data and historical observed precipitation data. Finally, the observed distribution is restored based on the trend; the expression is: in, The average of historical forecast precipitation data. This represents the average of future forecast precipitation data; (4) Correcting the future precipitation forecast data based on the equidistant CDF matching method, including: Several equidistant points are selected on the distribution function model of future precipitation forecast data, and the cumulative probability values corresponding to the equidistant points are mapped to the corresponding predicted precipitation data values. Based on the mapping results, each value in the predicted precipitation data is adjusted; the expression is as follows: Among them, CDF m,p (·) represents the distribution function of future forecast precipitation data.
6. The method for correcting forecast precipitation deviations according to any one of claims 1 to 3, characterized in that, The method of using matrix operations to correct the correlation between forecast precipitation and temperature data variables includes: Using the MBCn method, TSQM method, and R 2 D 2 One of the methods, the EC-BC method, adjusts the correlation between variables in the forecast precipitation data.
7. The method for correcting forecast precipitation deviations according to claim 6, characterized in that, The method of using matrix operations to correct the correlation between forecast precipitation and temperature data variables includes any of the following steps: (1) The MBCn method was used to adjust the correlation, including: The marginal distribution of each variable is corrected based on quantile mapping; In each iteration, an orthogonal rotation matrix is generated. The orthogonal rotation matrix is randomly combined with each variable. The marginal distribution of the rotated variables is then corrected using the quantile increment mapping method. The adjusted forecast precipitation data is then obtained based on the quantile mapping. Correlation analysis is performed on the adjusted forecast precipitation data until the similarity of the internal correlation with historical observation data is lower than a preset threshold. Then, the iteration stops and the corrected multivariate forecast precipitation data is output. (2) The TSQM method is used to adjust the correlation, including: Historical precipitation forecast data and corrected univariate precipitation forecast data are each constructed into an m×n matrix. and Calculate matrix and The rank of each column is calculated, and its normalized form is used to obtain the VanderWalden fraction matrix; its expression is: [W m,h ]=[Φ -1 {i / (m+1)}] Among them, [W m,h ] represents the normalized historical forecast matrix; Φ represents the CDF function of the standard normal distribution; i represents the matrix. The sorting size of each element in this column; m represents the number of elements in each column; Construct the correlation coefficient covariance matrix, and calculate the correction matrix based on the correlation coefficient covariance matrix. and The data were rearranged to obtain the corrected multivariate precipitation forecast; its expression is: in, and Represents the van der Waals matrix of historical and future forecasts after corrected sorting; [W m,h ] and [W m,p [C] represents the van der Waals matrix of historical and future forecasts before reordering; m,h ] and [C o,f These are the correlation coefficient and covariance matrices of historical forecasts and historical observations, respectively. This represents the inverse matrix of the Cholesky decomposition of the correlation coefficient matrix between precipitation and temperature in historical forecasts; [P o,h [] represents the Cholesky decomposition result of the correlation coefficient matrix between precipitation and temperature in historical observations; This represents the inverse matrix of the Cholesky decomposition of the correlation coefficient matrix between precipitation and temperature in future forecasts; (3) Using R 2 D 2 The method adjusts the correlation, including: The marginal distribution of each climate variable is adjusted based on the CDF-t method; Calculate the rank of all dimensions over time t in the corrected future forecast precipitation data and historical observed precipitation data; its expression is: in, and [R] o,h [ ] represents the rank set of the corrected future forecast precipitation data and the historical observed precipitation data, respectively. This represents the corrected matrix of future precipitation forecasts; This represents a matrix of historical precipitation data; d = 1, 2, ..., D, where D is the total number of dimensions. For any dimension, select a dimension d that will not change before and after the correction as a reference dimension. For each predicted time t, find a time ti. * Make The reconstruction matrix is obtained: Among them, R o,h (t * ) represents the reconstructed rank set matrix after adjusting for the precipitation-temperature relationship during the observation period; Represents time t in dimension d * The ordering of historical observations; This represents the ordering of future forecasts at time t in dimension d; based on the reconstruction matrix R o,h (t * The future precipitation forecast data is rearranged to obtain corrected multivariate precipitation forecast data; (4) The EC-BC method was used to adjust the correlation, including: The Schaake Shuffle method was used to reconstruct the relationships between variables. The data after univariate bias correction were reordered so that their time series were the same as the time series of historical forecast precipitation data, thus obtaining the corrected multivariate forecast precipitation data.
8. A precipitation forecast bias correction system based on quantile mapping, employing the precipitation forecast bias correction method according to any one of claims 1 to 7, characterized in that, include: The data acquisition module is used to acquire historical observed precipitation and temperature data, historical forecast precipitation and temperature data, and future forecast precipitation data to be corrected, and to preprocess them to obtain a time-dimensional aligned dataset within the target spatiotemporal range; The fitting module is used to fit the distribution of the dataset to obtain a distribution function model; The univariate correction module is used to quantify the distribution function and its inverse function of different data based on the distribution function model, and to construct a mapping function from forecast precipitation to observed precipitation based on quantile mapping. This module is used to correct the univariate future forecast precipitation data to obtain the corrected univariate forecast precipitation data. The multivariate correction module is used to correct the correlation between forecast precipitation and temperature data variables using matrix operations, so as to obtain corrected multivariate forecast precipitation data.
9. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, characterized in that, When the computer-readable instructions are executed by the processor, the processor performs all or part of the steps of the forecast precipitation deviation correction method as described in any one of claims 1 to 7.
10. A computationally readable storage medium having computer-readable instructions stored thereon, characterized in that, When the computer-readable instructions are executed by a processor, they implement all or part of the steps of the forecast precipitation deviation correction method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Monthly rainfall forecast correction method coupled with gamma and Gaussian distribution
CN112415635A
STGCN-based flood forecast error real-time correction method and system
CN115755219A