Several issues on the BoxCox transformation calculation
It appears that there are several mistakes in the case the boxcox calculation is used in .ErrorCrit.
First, an epsilon is added to Qobs and Qsim although it is not necessary for BoxCox:
if ("epsilon" %in% names(InputsCrit) & !is.null(InputsCrit$epsilon)) {
VarObs <- VarObs + InputsCrit$epsilon
VarSim <- VarSim + InputsCrit$epsilon
}
should become
if ("epsilon" %in% names(InputsCrit) & !is.null(InputsCrit$epsilon) & !(InputsCrit$transfo == "boxcox")) {
VarObs <- VarObs + InputsCrit$epsilon
VarSim <- VarSim + InputsCrit$epsilon
}
Then, the formula is wrong:
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
should be replaced with
VarSim <- (VarSim^0.25 – (0.01 * mean(VarObs, na.rm = TRUE))^0.25 ) / 0.25
VarObs <- (VarObs^0.25 – (0.01 * mean(VarObs, na.rm = TRUE))^0.25 ) / 0.25