Skip to content

Crossval calibration category limits

Hi @nperez (fyi @alacima @vtorralba ),

I've noticed that in line 399 of Crossval_calibration.R it seems like the category limits that get saved are the ones from observations:

cat_lims = list(obs = lims)

which is what appears when you explore the limits after calibration:

> summary(data$cat_lims)
    Length Class  Mode
obs 3      -none- list

but if I trace back the the limits calculation I see that lims have been computed from the hindcast, as they should be (lines 268-278):

  # Limits calculation with full hindcast period
  lims <- list()
  lims <- Apply(obs, target_dims = c('syear', 'ensemble'),
                fun = function(x, prob_lims) {
                  lapply(prob_lims, function(ps) {
                         as.array(quantile(as.vector(x), ps,
                                           na.rm = TRUE))})},
                  output_dims = lapply(categories, function(x) {'bin'}),
                  prob_lims = categories,
                  ncores = ncores)

Is there an error and instead of obs = lims it should say hcst = lims at the end of the script (line 399)? If there's not an error here, why are we saving the limits from observations and not (also) from the hindcast?

Many thanks,

Paloma