pastas.stats.metrics.nse#

nse(obs, sim=None, res=None, missing='drop', weighted=False, max_gap=30)[source]#

Compute the (weighted) Nash-Sutcliffe Efficiency (NSE).

Parameters
  • obs (pandas.Series) – Series with the observed values.

  • sim (pandas.Series, optional) – The Series with the simulated values.

  • res (pandas.Series, optional) – The Series with the residual values. If time series for the residuals are provided, the sim and obs arguments are ignored. Note that the residuals must be computed as obs - sim here.

  • missing (str, optional) – string with the rule to deal with missing values. Only “drop” is supported now.

  • weighted (bool, optional) – If weighted is True, the variances are computed using the time step between observations as weights. Default is False.

  • max_gap (int, optional) – maximum allowed gap period in days to use for the computation of the weights. All time steps larger than max_gap are replace with the max_gap value. Default value is 30 days.

Return type

float

Notes

NSE computed according to Nash and Sutcliffe [1970]

\[\text{NSE} = 1 - \frac{\sum(h_s-h_o)^2}{\sum(h_o-\mu_{h,o})}\]