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
parent 9ad805e3
......@@ -7,7 +7,7 @@ CreateInputsCrit_DeLavenne <- function(FUN_CRIT = ErrorCrit_KGE,
AprCrit = 1,
k = 0.15,
BoolCrit = NULL,
transfo = "",
transfo = "sqrt",
epsilon = NULL) {
# Check parameters
......
......@@ -23,7 +23,7 @@ CreateInputsCrit_DeLavenne(FUN_CRIT = ErrorCrit_KGE,
AprCrit = 1,
k = 0.15,
BoolCrit = NULL,
transfo = "",
transfo = "sqrt",
epsilon = NULL)
}
......@@ -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{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}}}
}
......
......@@ -32,7 +32,8 @@ test_that("should return KGE*(1-k)+k with parameters matching a priori parameter
IC_KGE <- CreateInputsCrit(ErrorCrit_KGE,
InputsModel = InputsModel,
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,
ErrorCrit(IC_DL, OutputsModel)$CritValue)
})
......
Markdown is supported
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