Hi @cdelgado
As we talk some time ago, Threshold function may need a parameter to compute quantiles on a temporal window. Parameter 'window' has added in this branch. See the example below for window of length 3. It would be great if you can review it and add some automatic tests.
source("/esarchive/scratch/nperez/git/csindicators/R/Threshold.R")
data <- array(1:(2*3*20), c(member = 2, sdate = 3, time = 20))
thres <- Threshold(data, 0.8, window = 3)
> thres
[1] 14.6 20.6 26.6 32.6 38.6 44.6 50.6 56.6 62.6 68.6 74.6 80.6
[13] 86.6 92.6 98.6 104.6 110.6 116.6
> quantile(data[,,1:3], 0.8)
80%
14.6
From my side, there is no hurry on reviewing this enhancement. We may need to confirm with other CS member that there is no inconvenience for adding it... I don't think so.
Cheers,
Núria