Cressman | R Documentation |
The Cressman objective analysis computes values at grid points Z_{ij}^a
(where i
and j
are the grid point indices for a 2D grid)
as the weighted average of the difference between observed values Z_k^o
and background values interpolated to the
observation locations Z_k^b
(i.e., Z_k^o - Z_k^b
, called the observation increment) plus the background value
at the grid point Z_{ij}^b
.
Cressman(
BD_Obs,
BD_Coord,
shapefile,
grid_resolution,
search_radius,
training = 1,
n_round = NULL,
stat_validation = NULL,
Rain_threshold = NULL,
save_model = FALSE
)
BD_Obs |
A
The dataset should be structured as follows: > BD_Obs # A data.table or data.frame with n rows (dates) and m+1 columns (stations + Date) Date ST001 ST002 ST003 ST004 ... <date> <dbl> <dbl> <dbl> <dbl> ... 1 2015-01-01 0 0 0 0 ... 2 2015-01-02 0 0 0 0.2 ... 3 2015-01-03 0.1 0 0 0.1 ...
|
BD_Coord |
A
|
shapefile |
A shapefile defining the study area, used to constrain the interpolation to the region of interest.
The shapefile must be of class |
grid_resolution |
A numeric value indicating the resolution of the interpolation grid in kilometers ( |
search_radius |
A numeric vector indicating the search radius in kilometers ( |
training |
Numerical value between 0 and 1 indicating the proportion of data used for model training. The remaining data are used for validation. Note that if you enter, for example, 0.8 it means that 80 % of the data will be used for training and 20 % for validation. If you do not want to perform validation, set training = 1. (Default training = 1). |
n_round |
An integer specifying the number of decimal places to round the interpolated results.
If set to |
stat_validation |
A character vector specifying the names of the stations to be used for validation. This option should only be filled in when it is desired to manually enter the stations used for validation. If this parameter is NULL, and the formation is different from 1, a validation will be performed using random stations. The vector must contain the names of the stations selected by the user for validation. For example, stat_validation = c(“ST001”, “ST002”). (Default stat_validation = NULL). |
Rain_threshold |
List of numerical vectors defining precipitation thresholds to classify precipitation into different categories according to its intensity. This parameter should be entered only when the validation is to include categorical metrics such as Critical Success Index (CSI), Probability of Detection (POD), False Alarm Rate (FAR), etc. Each list item should represent a category, with the category name as the list item name and a numeric vector specifying the lower and upper bounds of that category. Note: See the "Notes" section for additional details on how to define categories, use this parameter for validation, and example configurations. |
save_model |
Logical value indicating whether the interpolation file should be saved to disk. The default value is |
The return value depends on whether validation has been performed.
Without validation: The function returns a list
, where each element is a SpatRaster
object containing the interpolated values for a specific search radius defined in search_radius
. The number of elements in this list matches the length of search_radius
.
With validation: The function returns a named list
with two elements:
Ensamble
: A list
where each element corresponds to a SpatRaster
object containing the interpolated values for a specific search radius in search_radius
.
Validation
: A list
where each element is a data.table
containing the validation results for the corresponding interpolated SpatRaster
. Each data.table
incluye métricas de bondad de ajuste como RMSE, MAE y Kling-Gupta Efficiency (KGE), junto con métricas categóricas si se proporciona Rain_threshold
.
The number of elements in both the Ensamble
and Validation
lists matches the length of search_radius
, ensuring that each interpolation result has an associated validation dataset.
The Cressman method is defined by the following equation:
Z_{ij}^a = Z_{ij}^b + \frac{\sum_{k=1}^{n} w_k (Z_k^o - Z_k^b)}{\sum_{k=1}^{n} w_k}
where:
Z_{ij}^a
is the analysis value at grid point i,j
.
Z_{ij}^b
is the background value at grid point i,j
.
Z_k^o
is the observed value at station k
.
Z_k^b
is the background value interpolated to station k
.
w_k
is the weight assigned to station k
.
n
is the total number of stations used.
The weight w_k
is a function of the distance r = \sqrt{(x_{ij} - x_k)^2 + (y_{ij} - y_k)^2}
between the individual observation k
and grid point (i, j)
. R
is the influence radius.
Beyond the influence radius, the weight is set to zero. R
is therefore often referred to as
the cut-off radius.
The search_radius
parameter defines the influence range for the Cressman interpolation method.
It determines the maximum distance (in kilometers) within which observational data points contribute
to the interpolated value at a given location. A larger radius results in smoother interpolated fields
but may oversmooth local variations, while a smaller radius preserves finer details but may introduce noise.
The Cressman method typically applies an iterative approach, where the search radius is progressively reduced to refine the interpolation. Each iteration recalculates interpolated values with a smaller radius, allowing a better representation of small-scale features in the dataset.
The search_radius
should be defined as a numeric vector representing the influence range in kilometers (km
)
for each interpolation iteration. For example, setting search_radius = c(50, 20, 10)
means the first iteration
considers a 50 km influence radius, the second iteration uses 20 km, and the final iteration refines
the interpolation with a 10 km radius. The number of elements in search_radius
determines the total number of iterations.
The Rain_threshold
parameter is used to calculate categorical metrics such as the Critical Success Index (CSI),
Probability of Detection (POD), False Alarm Rate (FAR), success ratio (SR), Hit BIAS (HB),Heidke Skill Score (HSS);
Hanssen-Kuipers Discriminant (HK); Equal Threat Score (ETS) or Gilbert Skill Score.
The parameter should be entered as a named list, where each item represents a category and the name of the item is the category name.
The elements of each category must be a numeric vector with two values: the lower and upper limits of the category.
For example:
Rain_threshold = list(
no_rain = c(0, 1),
light_rain = c(1, 5),
moderate_rain = c(5, 20),
heavy_rain = c(20, 40),
violent_rain = c(40, Inf)
)
Precipitation values will be classified into these categories based on their intensity. Users can define as many categories as necessary, or just two (e.g., "rain" vs. "no rain"). It is important that these categories are entered according to the study region, as each study region may have its own categories.
Jonnathan Landi jonnathan.landi@outlook.com
Cressman, G. P., 1959: An operational objective analysis system. Mon. Wea. Rev., 87, 367-374, doi:10.1175/1520-0493(1959)087%3C0367:AOOAS%3E2.0.CO;2.
# Load data from on-site observations
data("BD_Obs", package = "InterpolateR")
data("BD_Coord", package = "InterpolateR")
# Load the study area where the interpolation is performed.
shp_path = system.file("extdata", "study_area.shp", package = "InterpolateR")
shapefile = terra::vect(shp_path)
# Perform the interpolation
Interpolated_Cressman <- Cressman(BD_Obs, BD_Coord, shapefile, grid_resolution = 5,
search_radius = 10, training = 1, n_round = 2,
stat_validation = "M001", Rain_threshold = NULL,
save_model = FALSE)
# Results ("Ensamble with 10 km radius")
Radius_10 <- Interpolated_Cressman$Ensamble$`10 km`
# Validation statistics
# Validation results with a 10 km radius
Validation_results_10 = Interpolated_Cressman$Validation$`10 km`
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.