Skip to contents

Calculates Goodness-of-Fit functions for two runoff series

Usage

calc_hydroGOF(GOF_fun, Qsim, Qobs, na.rm = TRUE)

Arguments

GOF_fun

a function, or (todo consider only a functional) a string with function name, of the format GOF_fun(Qsim, Qobs, na.rm = "TRUE"), typically from the hydroGOF package

Qsim

vector, matrix, data.frame etc of simulated runoff values

Qobs

vector, matrix, data.frame etc of observed runoff values

na.rm

a logical value indicating if NA should be removed

Value

transformed runoff in same format as input

Note

This function requires the hydroGOF package to be installed. Not imported as this package depends on deprecated packages as sp etc.

See also

Examples

# hydroGOF must be loaded
library(hydroGOF)
calc_hydroGOF(KGE, 1:10, seq(0, 9))
#> [1] 0.7777778
# this is NA
calc_hydroGOF("KGE", 1:10, rep(0, 10))
#> Warning: the standard deviation is zero
#> [1] NA
# this is also NA
calc_hydroGOF(KGE, 1:10, as.numeric(rep(NA, 10)))
#> Warning: 'sim' and 'obs' are empty or they do not have any common pair of elements with data !!
#> Warning: There are no pairs of 'sim' and 'obs' without missing values !
#> [1] NA