undefined value returned when asking for transform 'inv'/'log'/'pow' with negative exponent with missing observations
In deterministic evaluation, the small value added (epsilon) to avoid zero divide/log(0) is computed using the mean of the observations, but when the observed streamflow series contains missing values (NaN), its mean evaluates to NaN, and the metric value returned is also undefined (NaN).
This is because xt::mean
is used (instead of xt::nanmean
) on the following lines:
- https://gitlab.irstea.fr/HYCAR-Hydro/evalhyd/evalhyd-cpp/-/blob/a8c62cd26901feb3ff1d745a24569a3814d0f023/include/evalhyd/evald.hpp#L394
- https://gitlab.irstea.fr/HYCAR-Hydro/evalhyd/evalhyd-cpp/-/blob/a8c62cd26901feb3ff1d745a24569a3814d0f023/include/evalhyd/evald.hpp#L404
- https://gitlab.irstea.fr/HYCAR-Hydro/evalhyd/evalhyd-cpp/-/blob/a8c62cd26901feb3ff1d745a24569a3814d0f023/include/evalhyd/evald.hpp#L422
While waiting for a new version release, the easy solution is obviously to compute the epsilon value manually (e.g. taking 1% of the mean observed streamflow series) and give it to evalhyd
's evald
via the epsilon parameter.