# Deterministic metrics

Tip

All the metrics listed below are accessible via evald, the deterministic entry point of evalhyd.

For example, the Nash-Sutcliffe efficiency can be computed as follows:

#include <xtensor/xtensor.hpp>
#include <xtensor/xio.hpp>
#include <evalhyd/evald.hpp>

xt::xtensor<double, 2> obs = {{4.7, 4.3, 5.5, 2.7}};
xt::xtensor<double, 2> prd = {{5.3, 4.2, 5.7, 2.3}};

std::cout << evalhyd::evald(obs, prd, {"NSE"})[0] << std::endl;
// {{{ 0.862981}}}

>>> import numpy
... obs = numpy.array([[4.7, 4.3, 5.5, 2.7]])
... prd = numpy.array([[5.3, 4.2, 5.7, 2.3]])
>>> import evalhyd
... evalhyd.evald(obs, prd, ["NSE"])
[array([[[0.86298077]]])]

> obs <- rbind(c(4.7, 4.3, 5.5, 2.7))
> prd <- rbind(c(5.3, 4.2, 5.7, 2.3))
> library(evalhyd)
> evalhyd::evald(obs, prd, c("NSE"))
[[1]]
, , 1

[,1]
[1,] 0.8629808

\$ ./evalhyd evald "obs.csv" "prd.csv" "NSE"
{{{ 0.862981}}}


## MAE

Mean Absolute Error ("MAE").

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples)

## MARE

Mean Absolute Relative Error ("MARE").

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples)

## MSE

Mean Square Error ("MSE").

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples)

## RMSE

Root Mean Square Error ("RMSE").

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples)

## NSE

Nash-Sutcliffe Efficiency ("NSE") as per Nash and Sutcliffe (1970).

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples)

## KGE

Kling-Gupta Efficiency1 ("KGE") as per Gupta et al., 2009.

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples)

## KGE_D

Kling-Gupta Efficiency Decomposition1 ("KGE_D") into its three components $$r_{pearson}$$, $$\alpha$$, $$\beta$$, in this order.

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples, 3)

## KGEPRIME

Modified Kling-Gupta Efficiency1 ("KGEPRIME") as per Kling et al., 2012.

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples)

## KGEPRIME_D

Modified Kling-Gupta Efficiency Decomposition1 ("KGEPRIME_D") into its three components $$r_{pearson}$$, $$\gamma$$, $$\beta$$, in this order.

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples, 3)

## KGENP

Non-Parametric Kling-Gupta Efficiency1 ("KGENP") as per Pool et al., 2018.

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples)

## KGENP_D

Non-Parametric Kling-Gupta Efficiency Decomposition1 ("KGENP_D") into its three components $$r_{spearman}$$, $$\alpha_{NP}$$, $$\beta$$, in this order.

Required inputs

Output shape

q_obs, q_prd

(series, subsets, samples, 3)

## CONT_TBL

Cells of the Contingency Table ("CONT_TBL"), i.e. the hits $$a$$, the false alarms $$b$$, the misses $$c$$, and the correct rejections $$d$$, in this order.

Required inputs

Output shape

q_obs, q_prd, q_thr, events

(series, subsets, samples, thresholds, 4)

Footnotes

1(1,2,3,4,5,6)

Using a log-transform for this metric is not recommended (see Santos et al., 2018).