Difference between revisions of "Performance measures"

From SourceWiki
Jump to navigation Jump to search
 
Line 11: Line 11:
  
  
   NSeff <- function (Qobs, Qsim)  
+
   NSeff <- function (Qobs, Qsim){
  {
 
 
       Qsim <- Qsim[!is.na(Qobs)]
 
       Qsim <- Qsim[!is.na(Qobs)]
 
       Qobs <- Qobs[!is.na(Qobs)]
 
       Qobs <- Qobs[!is.na(Qobs)]
Line 20: Line 19:
 
       return(NS)
 
       return(NS)
 
   }
 
   }
 
 
 
   Eff <- NSeff(Qobs,Qsim)
 
   Eff <- NSeff(Qobs,Qsim)

Revision as of 04:38, 5 May 2008

Introduction

Here is a selection of measures you can use for assessing the performance of your model.


Nash-Sutcliffe efficiency

This one is implemented as NSeff() in the topmodel package, and takes two vectors, containing the simulated (Qsim) and observed (Qobs) discharge:


  NSeff <- function (Qobs, Qsim){
     Qsim <- Qsim[!is.na(Qobs)]
     Qobs <- Qobs[!is.na(Qobs)]
     Qobs <- Qobs[!is.na(Qsim)]
     Qsim <- Qsim[!is.na(Qsim)]
     NS <- 1 - (sum((Qobs - Qsim)^2)/sum((Qobs - mean(Qobs))^2))
     return(NS)
  }
  Eff <- NSeff(Qobs,Qsim)