diff --git a/DESCRIPTION b/DESCRIPTION index a136852130f107196cf0d7051ab96a8bebeb4075..7fac5438af4bcfd79bfef990ce0de07dfbd1db4f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: airGR Type: Package Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling -Version: 1.3.2.59 +Version: 1.3.2.60 Date: 2019-11-20 Authors@R: c( person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")), diff --git a/NEWS.md b/NEWS.md index d6a5478552d99f2f2c8bcaae8bfc7504a5017f33..3da7fe440cb5e46cffdf1d555fab4264fbe53bf5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ -### 1.3.2.59 Release Notes (2019-11-19) +### 1.3.2.60 Release Notes (2019-11-20) #### New features @@ -15,6 +15,7 @@ - Fixed bug in <code>TransfoParam_GR1A()</code>. The number of model parameters was wrong (2 instead of 1) which caused an error when the GR1 model during the calibration. - Fixed bug in <code>plot.OutputsModel()</code>. The function does not return any error message when <code>log_scale = TRUE</code>, <code>Qobs = NULL</code> and user want to draw flows time series. - Fixed bug in <code>RunModel_*GR*()</code>. The functions do not return any error message anymore due to slightly negative values returned by GR4H, GR4J, GR5J or GR6J Fortran codes (the message was returned by <code>CreateIniStates()</code> when the final states were created). The <code>RunModel_*GR*()</code> functions now returns zero instead of these slightly negative values, except for the ExpStore where negatives values are allowed. +- Fixed bug in the <code>.ErrorCrit()</code> function. The Box-Cox transformation formula is now corrected when the <code>ErrorCrit*()</code> are used. #### Minor user-visible changes diff --git a/R/Utils.R b/R/Utils.R index bce343222338fbbaf8ebdb9cfb77d5692665876f..435bced0e5c0d218bb70c102da3bb4ef53699c17 100644 --- a/R/Utils.R +++ b/R/Utils.R @@ -148,7 +148,7 @@ warning("zeroes detected in 'Qsim': the corresponding time-steps will be excluded from the criteria computation if the epsilon argument of 'CreateInputsCrit' = NULL", call. = FALSE) } } - if ("epsilon" %in% names(InputsCrit) & !is.null(InputsCrit$epsilon)) { + if ("epsilon" %in% names(InputsCrit) & !is.null(InputsCrit$epsilon) & !(InputsCrit$transfo == "boxcox")) { VarObs <- VarObs + InputsCrit$epsilon VarSim <- VarSim + InputsCrit$epsilon } @@ -173,8 +173,9 @@ InputsCrit$BoolCrit <- sort(InputsCrit$BoolCrit, decreasing = TRUE) } if (InputsCrit$transfo == "boxcox") { - VarSim <- (VarSim^0.25 - 0.01 * mean(VarSim, na.rm = TRUE)) / 0.25 - VarObs <- (VarObs^0.25 - 0.01 * mean(VarObs, na.rm = TRUE)) / 0.25 + muTransfoVarObs <- (0.01 * mean(VarObs, na.rm = TRUE))^0.25 + VarSim <- (VarSim^0.25 - muTransfoVarObs) / 0.25 + VarObs <- (VarObs^0.25 - muTransfoVarObs) / 0.25 } if (grepl("\\^", InputsCrit$transfo)) { VarObs <- VarObs^transfoPow @@ -221,7 +222,6 @@ CritCompute = CritCompute, TS_ignore = TS_ignore, Ind_TS_ignore = Ind_TS_ignore) - }