I'm trying to bootstrap the statistic, Nash-Sutcliffe Efficiency (NSE), in R. It's used to evaluate the performance of hydrologic model simulation data against observed data. A function within the package 'hydroGOF' exists to calculate the statistic (NSE()). The definition of the statistic is as follows:
Description
Nash-Sutcliffe efficiency between sim and obs, with treatment of missing values.
Usage
NSE(sim, obs, ...)
I can successfully bootstrap the correlation coefficient using this code (The object 'Run' is a two-column data frame (observed runoff and simulated runoff):
mycorRun <- function(Run, i) cor(Run[i,])[1,2]
bootcorRun <- boot(Run, mycorRun,R=10000)
However, when I try to imitate this with the NSE function I get the following error:
library(hydroGOF)
observed.runoff <- c(0.3, 0.5, 1.1, 0.6, 0.1)
simulated.runoff <- c(0.5, 0.7, 0.8, 0.4, 0.3)
runoff <- data.frame(observed.runoff, simulated.runoff)
myNSERun <- function(runoff, i) NSE(runoff[i,])[1,2]
bootNSERun <- boot(runoff, myNSERun, R=10000)
Error in as.matrix(obs) : argument "obs" is missing, with no default
Any thoughts on how to write the statistic function? I've tried creating my own function with x & y variables instead of observed & simulated, but it gives me the same error.