Improve CST_QuantileMapping documentation
Hi,
Working with @vtorralb2 (o @vtorralba) CST_QuantileMapping() we noticed that the documentation can be improved.
exp_cor A multidimensional array with named dimensions in which the quantile mapping correction should be applied. If it is not specified, the correction is applied to object 'exp' using leave-one-out cross-validation. This is useful to correct a forecast when the hindcast is provided in parameter 'exp'.
window_dim A character string indicating the dimension name in which extra samples are stored. This dimension is joined to the 'member' dimension. This is useful to correct daily data, for which robust statistics can be obtained by creating a window of dates around the target date.
Do you like these definitions more, @vtorralb2 ?
By the way, I have created a tests to check the function works as expected in this case:
library(CSTools)
set.seed(123)
exp <- as.numeric(1:prod(6,10,15))
dim(exp) <- c(member = 6, syear = 10, window = 15)
obs <- as.numeric(rnorm(prod(1,10,15), 50))
dim(obs) <- c(member = 1, syear = 10, window = 15)
fcst <- 100*(1:prod(8,1,1))
dim(fcst) <- c(member = 8, syear = 1, swindow = 1)
QuantileMapping(exp = exp, obs = obs, exp_cor = fcst, memb_dim = 'member', sdate_dim = 'syear', window_dim = 'window')
dim(exp) <- c(member = 6*15, syear = 10)
dim(obs) <- c(member = 15, syear = 10)
exp_cor <- fcst
applied <- exp_cor * NA
adjust <- fitQmap(as.vector(obs), as.vector(exp), method ='QUANT')
applied <- doQmap(as.vector(exp_cor), adjust)
Cheers,
Núria