ProbBins {s2dv}R Documentation

Compute probabilistic information of a forecast relative to a threshold or a quantile

Description

Compute probabilistic bins of a set of forecast years ('fcyr') relative to the forecast climatology over the whole period of anomalies, optionally excluding the selected forecast years ('fcyr') or the forecast year for which the probabilistic bins are being computed (see 'compPeriod').

Usage

ProbBins(
  data,
  thr,
  fcyr = "all",
  time_dim = "sdate",
  memb_dim = "member",
  quantile = TRUE,
  compPeriod = "Full period",
  ncores = NULL
)

Arguments

data

An numeric array of anomalies with the dimensions 'time_dim' and 'memb_dim' at least. It can be generated by Ano().

thr

A numeric vector used as the quantiles (if 'quantile' is TRUE) or thresholds (if 'quantile' is FALSE) to bin the anomalies. If it is quantile, it must be within [0, 1].

fcyr

A numeric vector of the indices of the forecast years (i.e., time_dim) to compute the probabilistic bins for, or 'all' to compute the bins for all the years. E.g., c(1:5), c(1, 4), 4, or 'all'. The default value is 'all'.

time_dim

A character string indicating the dimension along which to compute the probabilistic bins. The default value is 'sdate'.

memb_dim

A character string indicating the name of the member dimension or the dimension to be merged with 'time_dim' for probabilistic calculation. The default value is 'member'.

quantile

A logical value indicating if the thresholds ('thr') are quantiles (TRUE) or the absolute thresholds of the bins (FALSE). The default value is TRUE.

compPeriod

A character string referring to three computation options:
"Full period": The probabilities are computed based on 'data';
"Without fcyr": The probabilities are computed based on 'data' with all 'fcyr' removed;
"Cross-validation": The probabilities are computed based on leave-one-out cross-validation.
The default value is "Full period".

ncores

An integer indicating the number of cores to use for parallel computation. The default value is NULL.

Value

A numeric array of probabilistic information with dimensions:
c(bin = length of 'thr' + 1, time_dim = length of 'fcyr', memb_dim, the rest of dimensions of 'data')
The values along the 'bin' dimension take values 0 or 1 depending on which of the 'thr' + 1 cathegories the forecast or observation at the corresponding grid point, time step, member and start date belongs to.

Examples


clim <- Clim(sampleMap$mod, sampleMap$obs)
ano_exp <- Ano(sampleMap$mod, clim$clim_exp)
PB <- ProbBins(ano_exp, fcyr = 3, thr = c(1/3, 2/3), quantile = TRUE)


[Package s2dv version 2.0.0 Index]