Rn: net rainfall matrix of gauged catchments (rows for time index, and columns for catchment index)
msim: similarity matrix of net rainfall time series (as produced by rsimilarity )
predictors: a list of at least two squared matrices that could be used to predict similarity of net rainfall. The matrices should be squared to describe the similarity of each pair of gauged catchments. High values should indicate high probability of similarity in net rainfall
newpredictors: a matrix or a data.frame of predictors, to be used as new input to the model being built, and from which we want to predict net rainfall similarity. Typically, a similarity between an ungauged catchment and several gauged catchments that we want to weight as donors. Each column should correspond to each predictors, and each row should correspond to each pair of catchments analysed.
FUN: either a function or a character string specifying the name of a predifined function to quantify the similarity of two net rainfall time series. See rsimilarity for more details
power: exponent applied on Rn time series when computing Rn similarity (generally between -1 and 1, a lower value emphasising the similarity of low flows). Default value is 0.5
symmetrize: a function to combine FUN(Rn[,i],Rn[,j]) and FUN(Rn[,j],Rn[,i]) into one similarity value (typically if FUN=KGE, KGE(Rn[,i],Rn[,j])!=KGE(Rn[,j],Rn[,i])). Default is mean
model: the method to estimate similarity of Rn from descriptors. This must be one of "lm", "glmnet"
args_glmnet: list of arguments to be passed to glmnet::cv.glmnet()
standardisation: boolean indicating whether the predictors should be standardised (in particular to make their coefficient comparable)
first_model: a first model to use for predicting similarity (generally based on distance, see two_steps of mixr ). The actual model will be built on residuals of the first one
parallel: logical indicating whether the computation of Rn similarities should be parallelised
cores: the number of cores to use for parallel execution if parallel is TRUE. If not specified, the number of cores is set to the value of parallel::detectCores()
verbose: boolean indicating if warning messages should be written to the console
seed: integer value to be used by set.seed() for reproducible results. Used only if model="glmnet"