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.framecontaining the columns specified by thetruthandestimatearguments.- ...
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, anumericvector.- estimate
The column identifier for the predicted results (that is also
numeric). As withtruththis can be specified different ways but the primary method is to use an unquoted variable name. For_vec()functions, anumericvector.- na_rm
A
logicalvalue indicating whetherNAvalues 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 Good –
nse()> 0.8Good – 0.6 <=
nse()<= 0.8Satisfactory – 0.5 <
nse()< 0.6Poor –
nse()<= 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