
Nash-Sutcliffe efficiency between sim
and obs
, with treatment of missing values.
NSE(sim, obs, ...)# S3 method for default
NSE(sim, obs, na.rm=TRUE, FUN=NULL,
epsilon=c(0, "Pushpalatha2012", "other"), epsilon.value=NA, ...)
# S3 method for data.frame
NSE(sim, obs, na.rm=TRUE, FUN=NULL,
epsilon=c(0, "Pushpalatha2012", "other"), epsilon.value=NA, ...)
# S3 method for matrix
NSE(sim, obs, na.rm=TRUE, FUN=NULL,
epsilon=c(0, "Pushpalatha2012", "other"), epsilon.value=NA, ...)
# S3 method for zoo
NSE(sim, obs, na.rm=TRUE, FUN=NULL,
epsilon=c(0, "Pushpalatha2012", "other"), epsilon.value=NA, ...)
numeric, zoo, matrix or data.frame with simulated values
numeric, zoo, matrix or data.frame with observed values
a logical value indicating whether 'NA' should be stripped before the computation proceeds.
When an 'NA' value is found at the i-th position in obs
OR sim
, the i-th value of obs
AND sim
are removed before the computation.
function to be applied to sim
and obs
in order to obtain transformed values thereof before computing the Nash-Sutcliffe efficiency.
argument used to define a numeric value to be added to both sim
and obs
before applying FUN
.
It is was designed to allow the use of logarithm and other similar functions that do not work with zero values.
Valid values are:
1) 0: zero is added to both sim
and obs
.
2) "Pushpalatha2012": one hundredth of the mean observed values is added to both sim
and obs
, as described in Pushpalatha et al., (2012).
3) "other": the numeric value defined in the epsilon.value
argument is added to both sim
and obs
numeric value to be added to both sim
and obs
when epsilon="other"
.
further arguments passed to FUN
.
Nash-Sutcliffe efficiency between sim
and obs
.
If sim
and obs
are matrixes, the returned value is a vector, with the Nash-Sutcliffe efficiency between each column of sim
and obs
.
The Nash-Sutcliffe efficiency (NSE) 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).
NSE indicates how well the plot of observed versus simulated data fits the 1:1 line.
Nash-Sutcliffe efficiencies range from -Inf to 1. Essentially, the closer to 1, the more accurate the model is. -) NSE = 1, corresponds to a perfect match of modelled to the observed data. -) NSE = 0, indicates that the model predictions are as accurate as the mean of the observed data, -) -Inf < NSE < 0, indicates that the observed mean is better predictor than the model.
Nash, J. E. and J. V. Sutcliffe (1970), River flow forecasting through conceptual models part I -A discussion of principles, Journal of Hydrology, 10 (3), 282-290
http://en.wikipedia.org/wiki/Nash%E2%80%93Sutcliffe_model_efficiency_coefficient
Pushpalatha, R., Perrin, C., Le Moine, N. and Andreassian, V. (2012). A review of efficiency criteria suitable for evaluating low-flow simulations. Journal of Hydrology, 420, 171-182. DOI: 10.1016/j.jhydrol.2011.11.055
# NOT RUN {
obs <- 1:10
sim <- 1:10
NSE(sim, obs)
obs <- 1:10
sim <- 2:11
NSE(sim, obs)
#################
# Computing NSE on the (natural) logarithm of simulated and observed values
obs <- 1:10/10
sim <- 2:11/10
NSE(sim=sim, obs=obs, FUN=log)
##################
# Loading daily streamflows of the Ega River (Spain), from 1961 to 1970
data(EgaEnEstellaQts)
obs <- EgaEnEstellaQts
# Generating a simulated daily time series, initially equal to the observed series
sim <- obs
# Computing the 'NSE' for the "best" (unattainable) case
NSE(sim=sim, obs=obs)
# Randomly changing the first 2000 elements of 'sim', by using a normal distribution
# with mean 10 and standard deviation equal to 1 (default of 'rnorm').
sim[1:2000] <- obs[1:2000] + rnorm(2000, mean=10)
# Computing the new 'NSE'
NSE(sim=sim, obs=obs)
# }
Run the code above in your browser using DataLab