Skip to contents

Calculate the Nash-Sutcliffe efficiency (Nash & Sutcliffe, 1970). Dimensionless (from \(-\infty\) to 1). nse() indicates how well the plot of observed versus simulated data fits the 1:1 line.

Usage

nse(data, ...)

# S3 method for class 'data.frame'
nse(data, truth, estimate, na_rm = TRUE, performance = FALSE, ...)

nse_vec(truth, estimate, na_rm = TRUE, performance = FALSE, ...)

Arguments

data

A data.frame containing the columns specified by the truth and estimate arguments.

...

Not currently used.

truth

The column identifier for the true results (that is numeric). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a numeric vector.

estimate

The column identifier for the predicted results (that is also numeric). As with truth this can be specified different ways but the primary method is to use an unquoted variable name. For _vec() functions, a numeric vector.

na_rm

A logical value indicating whether NA values should be stripped before the computation proceeds.

performance

The optional column, indicating should the nse() return metric interpretation. See details.

Value

A tibble with columns .metric, .estimator, and .estimate and 1 row of values.

For grouped data frames, the number of rows returned will be the same as the number of groups.

For nse_vec(), a single numeric value (or NA).

Details

The Nash-Sutcliffe efficiency is a normalized statistic that determines the relative magnitude of the residual variance ("noise") compared to the measured data variance ("information"; Nash and Sutcliffe, 1970).

The formula for NSE is:

$$ NSE = 1 - \frac{ \sum_{i=1}^{n}{(sim_i - obs_i)^2} }{ \sum_{i=1}^{n}{(obs_i - \mu_{obs})^2} } $$ where:

  • \(sim\) defines model simulations at time step \(i\)

  • \(obs\) defines model observations at time step \(i\)

  • \(\mu_{obs}\) defines mean of model observations

According to Moriasi et al. (2015) the metric interpretation can be as follows:

  • Excellent/Very Goodnse() > 0.8

  • Good – 0.6 <= nse() <= 0.8

  • Satisfactory – 0.5 < nse() < 0.6

  • Poornse() <= 0.5

References

Nash, J. E., & Sutcliffe, J. V. (1970). River flow forecasting through conceptual models part I — A discussion of principles. Journal of Hydrology, 10(3), 282–290. doi:10.1016/0022-1694(70)90255-6

Moriasi, D. N., Gitau, M. W., Pai, N., & Daggupati, P. (2015). Hydrologic and Water Quality Models: Performance Measures and Evaluation Criteria. Transactions of the ASABE, 58(6), 1763–1785. doi:10.13031/trans.58.10715

See also

Other numeric metrics: kge(), kge2012(), mse(), pbias(), press(), sfe()

Other accuracy metrics: kge(), kge2012(), mse(), pbias(), press(), sfe()

Examples

library(tidyhydro)
data(avacha)

# Supply truth and predictions as bare column names
nse(avacha, obs, sim)
#> # A tibble: 1 × 3
#>   .metric .estimator .estimate
#>   <chr>   <chr>          <dbl>
#> 1 nse     standard       0.895

# Or as numeric vectors
nse_vec(avacha$obs, avacha$sim)
#> [1] 0.895008