Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ProbBins

Computes 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(
  ano,
  fcyr = "all",
  thr,
  quantile = TRUE,
  posdates = 3,
  posdim = 2,
  compPeriod = "Full period"
)

Arguments

ano

Array of anomalies from Ano().
Must be of dimension (nexp/nobs, nmemb, nsdates, nleadtime, nlat, nlon)

fcyr

Indices of the forecast years of the anomalies which 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'.

thr

Values used as thresholds to bin the anomalies.

quantile

If quantile is TRUE (default), the threshold ('thr') are quantiles.
If quantile is FALSE the thresholds ('thr') introduced are the absolute thresholds of the bins.

posdates

Position of the dimension in ano that corresponds to the start dates (default = 3).

posdim

Position of the dimension in ano which will be combined with 'posdates' to compute the quantiles (default = 2, ensemble members).

compPeriod

Three options: "Full period"/"Without fcyr"/"Cross-validation" (The probabilities are computed with the terciles based on ano/ano with all 'fcyr's removed/cross-validation). The default is "Full period".

Value

Array with probabilistic information and dimensions:
c(length('thr') + 1, length(fcyr), nmemb/nparam, nmod/nexp/nobs, nltime, nlat, nlon)
The values along the first dimension take values 0 or 1 depending on which of the 'thr'+1 cathegories the forecast/observation at the corresponding grid point, time step, member and starting date belongs to.

Author(s)

History:
1.0 - 2013 (F.Lienert) - Original code
2.0 - 2014-03 (N. Gonzalez and V. Torralba, veronica.torralba@bsc.es) - Debugging 2.1 - 2017-02 (V. Torralba and N. Manubens, veronica.torralba@bsc.es) - Fix bug with cross-validation

Examples

# See examples on Load() to understand the first lines in this example
 ## Not run: 
data_path <- system.file('sample_data', package = 's2dverification')
expA <- list(name = 'experiment', path = file.path(data_path,
            'model/$EXP_NAME$/$STORE_FREQ$_mean/$VAR_NAME$_3hourly',
            '$VAR_NAME$_$START_DATE$.nc'))
obsX <- list(name = 'observation', path = file.path(data_path,
            '$OBS_NAME$/$STORE_FREQ$_mean/$VAR_NAME$',
            '$VAR_NAME$_$YEAR$$MONTH$.nc'))

# Now we are ready to use Load().
startDates <- c('19851101', '19901101', '19951101', '20001101', '20051101')
sampleData <- Load('tos', list(expA), list(obsX), startDates,
                  output = 'lonlat', latmin = 27, latmax = 48, 
                  lonmin = -12, lonmax = 40)
 
## End(Not run)
 
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, posdates = 3,
              posdim = 2)

s2dverification

Set of Common Tools for Forecast Verification

v2.10.0
Apache License 2.0
Authors
BSC-CNS [aut, cph], Virginie Guemas [aut], Nicolau Manubens [aut], An-Chi Ho [ctb, cre], Nuria Perez-Zanon [ctb], Javier Garcia-Serrano [aut], Neven Fuckar [aut], Louis-Philippe Caron [aut], Omar Bellprat [aut], Luis Rodrigues [aut], Veronica Torralba [aut], Alasdair Hunter [aut], Chloe Prodhomme [aut], Martin Menegoz [aut], Domingo Manubens [ctb], Constantin Ardilouze [ctb], Lauriane Batte [ctb], Fabian Lienert [ctb], Julia Giner [ctb], Jean-Philippe Baudouin [ctb], Nube Gonzalez [ctb], Ludovic Auger [ctb], Nicola Cortesi [ctb], Eleftheria Exarchou [ctb], Ruben Cruz [ctb], Isabel Andreu-Burillo [ctb], Ramiro Saurral [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.