CST_Calibration {CSTools}R Documentation

Forecast Calibration

Description

Equivalent to function Calibration but for objects of class s2dv_cube.

Usage

CST_Calibration(
  exp,
  obs,
  cal.method = "mse_min",
  eval.method = "leave-one-out",
  multi.model = FALSE,
  na.fill = TRUE,
  na.rm = TRUE,
  apply_to = NULL,
  alpha = NULL,
  memb_dim = "member",
  sdate_dim = "sdate",
  ncores = 1
)

Arguments

exp

an object of class s2dv_cube as returned by CST_Load function, containing the seasonal forecast experiment data in the element named $data.

obs

an object of class s2dv_cube as returned by CST_Load function, containing the observed data in the element named $data.

cal.method

is the calibration method used, can be either bias, evmos, mse_min, crps_min or rpc-based. Default value is mse_min.

eval.method

is the sampling method used, can be either in-sample or leave-one-out. Default value is the leave-one-out cross validation.

multi.model

is a boolean that is used only for the mse_min method. If multi-model ensembles or ensembles of different sizes are used, it must be set to TRUE. By default it is FALSE. Differences between the two approaches are generally small but may become large when using small ensemble sizes. Using multi.model when the calibration method is bias, evmos or crps_min will not affect the result.

na.fill

is a boolean that indicates what happens in case calibration is not possible or will yield unreliable results. This happens when three or less forecasts-observation pairs are available to perform the training phase of the calibration. By default na.fill is set to true such that NA values will be returned. If na.fill is set to false, the uncorrected data will be returned.

na.rm

is a boolean that indicates whether to remove the NA values or not. The default value is TRUE. See Details section for further information about its use and compatibility with na.fill.

apply_to

is a character string that indicates whether to apply the calibration to all the forecast ("all") or only to those where the correlation between the ensemble mean and the observations is statistically significant ("sign"). Only useful if cal.method == "rpc-based".

alpha

is a numeric value indicating the significance level for the correlation test. Only useful if cal.method == "rpc-based" & apply_to == "sign".

memb_dim

is a character string indicating the name of the member dimension. By default, it is set to 'member'.

sdate_dim

is a character string indicating the name of the start date dimension. By default, it is set to 'sdate'.

ncores

is an integer that indicates the number of cores for parallel computations using multiApply function. The default value is one.

Value

an object of class s2dv_cube containing the calibrated forecasts in the element $data with the same dimensions as the one in the exp object.

Author(s)

VerĂ³nica Torralba, veronica.torralba@bsc.es

Bert Van Schaeybroeck, bertvs@meteo.be

See Also

CST_Load

Examples

# Example 1:
mod1 <- 1 : (1 * 3 * 4 * 5 * 6 * 7)
dim(mod1) <- c(dataset = 1, member = 3, sdate = 4, ftime = 5, lat = 6, lon = 7)
obs1 <- 1 : (1 * 1 * 4 * 5 * 6 * 7)
dim(obs1) <- c(dataset = 1, member = 1, sdate = 4, ftime = 5, lat = 6, lon = 7)
lon <- seq(0, 30, 5)
lat <- seq(0, 25, 5)
exp <- list(data = mod1, lat = lat, lon = lon)
obs <- list(data = obs1, lat = lat, lon = lon)
attr(exp, 'class') <- 's2dv_cube'
attr(obs, 'class') <- 's2dv_cube'
a <- CST_Calibration(exp = exp, obs = obs, cal.method = "mse_min", eval.method = "in-sample")
str(a)

[Package CSTools version 4.0.1 Index]