This MR stems from #127, which involved testing the RPSS()
and BrierScore()
functions. With @nperez, we noted that while the prob_thresholds
parameter is well documented, it can substantially affect the output. As also discussed with @vagudets, making the parameter mandatory could be a good solution, but it would break backward compatibility (and also the parameter is not needed when the inputs are probabilities and the reference forecast is provided).
Therefore, to help users better understand how their inputs are handled, this MR introduces a warning that is triggered when prob_terciles
is not explicit provided. The warning gives one of three context-specific messages, explaining how the default value c(1/3, 2/3)
is applied depending on the user’s input:
## prob_thresholds
if (is.null(cat_dim) || (!is.null(cat_dim) && is.null(ref))) {
...
if (missing(prob_thresholds)) {
if (is.null(cat_dim) && is.null(ref)) {
.warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n",
"Since the inputs are ensemble members (i.e., 'cat_dim' is NULL) and no reference ",
"forecast is provided, this default will be used both to compute category ",
"probabilities and the reference climatology.")
} else if (is.null(cat_dim) && !is.null(ref)) {
.warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n",
"Since the inputs are ensemble members (i.e., 'cat_dim' is NULL), this default will ",
"be used to compute category probabilities.")
} else { # if (!is.null(cat_dim) && is.null(ref))
.warning("Parameter 'prob_thresholds' is not provided. Default value c(1/3, 2/3) is used.\n",
"Since no reference forecast is provided, this default will be used to compute ",
"the reference climatology.")
}
}
}
Ariadna