R/NSE.R

Defines functions NSE

Documented in NSE

#' @title Nash-Sutcliffe efficiency (NSE)
#' @description Nash-Sutcliffe efficiency (NSE)
#' @param obs measured values
#' @param sim predicted values
#' @references Nash, J. E., and J.V. Sutcliffe (1970): River flow forecasting through conceptual models. 1. a discussion of principles. Journal of Hydrology 10, 282–290.
#' @export

NSE <- function(obs, sim) {

  stopifnot(length(obs) == length(sim))
  1- ((sum((obs - sim)^2))/(sum((obs - mean(obs))^2)))
}

Try the SoilHyP package in your browser

Any scripts or data that you put into this service are public.

SoilHyP documentation built on Feb. 16, 2023, 7:06 p.m.