Commit be85a67c authored by Dorchies David's avatar Dorchies David
Browse files

feat(CreateInputsCrit_DeLavenne): use transfo="sqrt" by default

As in De Lavenne et al. 2019

Refs #111
Showing with 5 additions and 4 deletions
+5 -4
...@@ -7,7 +7,7 @@ CreateInputsCrit_DeLavenne <- function(FUN_CRIT = ErrorCrit_KGE, ...@@ -7,7 +7,7 @@ CreateInputsCrit_DeLavenne <- function(FUN_CRIT = ErrorCrit_KGE,
AprCrit = 1, AprCrit = 1,
k = 0.15, k = 0.15,
BoolCrit = NULL, BoolCrit = NULL,
transfo = "", transfo = "sqrt",
epsilon = NULL) { epsilon = NULL) {
# Check parameters # Check parameters
......
...@@ -23,7 +23,7 @@ CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE, ...@@ -23,7 +23,7 @@ CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE,
AprCrit = 1, AprCrit = 1,
k = 0.15, k = 0.15,
BoolCrit = NULL, BoolCrit = NULL,
transfo = "", transfo = "sqrt",
epsilon = NULL) epsilon = NULL)
} }
...@@ -47,7 +47,7 @@ CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE, ...@@ -47,7 +47,7 @@ CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE,
\item{BoolCrit}{(optional) [boolean] boolean (the same length as \code{Obs}) giving the time steps to consider in the computation (all time steps are considered by default. See details)} \item{BoolCrit}{(optional) [boolean] boolean (the same length as \code{Obs}) giving the time steps to consider in the computation (all time steps are considered by default. See details)}
\item{transfo}{(optional) [character] name of the transformation applied to the variables (e.g. \code{""}, \code{"sqrt"}, \code{"log"}, \code{"inv"}, \code{"sort"}, \code{"boxcox"} or a numeric value for power transformation for \code{FUN_CRIT}. See details of \code{\link{CreateInputsCrit}}} \item{transfo}{(optional) [character] name of the transformation applied to the variables (e.g. \code{""}, \code{"sqrt"}, \code{"log"}, \code{"inv"}, \code{"sort"}, \code{"boxcox"} or a numeric value for power transformation for \code{FUN_CRIT}. Default value is \code{"sqrt"}. See details of \code{\link{CreateInputsCrit}}}
\item{epsilon}{(optional) [numeric] small value to add to all observations and simulations for \code{FUN_CRIT} when \code{"log"} or \code{"inv"} transformations are used [same unit as \code{Obs}]. See details of \code{\link{CreateInputsCrit}}} \item{epsilon}{(optional) [numeric] small value to add to all observations and simulations for \code{FUN_CRIT} when \code{"log"} or \code{"inv"} transformations are used [same unit as \code{Obs}]. See details of \code{\link{CreateInputsCrit}}}
} }
......
...@@ -32,7 +32,8 @@ test_that("should return KGE*(1-k)+k with parameters matching a priori parameter ...@@ -32,7 +32,8 @@ test_that("should return KGE*(1-k)+k with parameters matching a priori parameter
IC_KGE <- CreateInputsCrit(ErrorCrit_KGE, IC_KGE <- CreateInputsCrit(ErrorCrit_KGE,
InputsModel = InputsModel, InputsModel = InputsModel,
RunOptions = RunOptions, RunOptions = RunOptions,
Obs = BasinObs$Qmm[Ind_Run]) Obs = BasinObs$Qmm[Ind_Run],
transfo = "sqrt")
expect_equal(ErrorCrit_KGE(IC_KGE, OutputsModel)$CritValue * (1 - k) + k, expect_equal(ErrorCrit_KGE(IC_KGE, OutputsModel)$CritValue * (1 - k) + k,
ErrorCrit(IC_DL, OutputsModel)$CritValue) ErrorCrit(IC_DL, OutputsModel)$CritValue)
}) })
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment