rsimilarity: Similarity of net rainfall time series

View source: R/rsimilarity.R

rsimilarityR Documentation

Similarity of net rainfall time series

Description

Calculate the similarity of net rainfall time series

Usage

rsimilarity(Rn, FUN = "invKGE", parallel = FALSE, cores = NULL)

Arguments

Rn

net rainfall matrix of gauged catchments (rows for time index, and columns for catchment index)

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. Higher values should indicate a higher probability of similarity. Predefined functions include: "KGE" (Kling–Gupta efficiency), "invRMSE" (inverse of root mean square error), "invKGE" (inverse of (KGE-1)) and "RMSE" (root mean square error, should not be directly used as a similarity metric). The default is "invKGE"

parallel

logical indicating whether the computation 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()

Value

A square matrix of the similarity metric between each pair of catchments

See Also

rsimilarity_model

Examples

data(Oudon)
obs <- as_transfr(st = Oudon$obs, hl = Oudon$hl)
obs <- velocity(obs, method = "loire2016")
obs <- uh(obs)
obs <- lagtime(obs)
obs <- rapriori(obs)
obs <- inversion(obs, parallel = TRUE, cores=2)
msim <- rsimilarity(Rn = obs$st$RnInv, FUN="KGE", parallel = TRUE, cores=2)

transfR documentation built on April 4, 2025, 2:41 a.m.