Difference between revisions of "Performance measures"

From SourceWiki
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
Here is a selection of measures you can use for assessing the performance of your model.
 
Here is a selection of measures you can use for assessing the performance of your model.
 +
  
 
===Nash-Sutcliffe efficiency===
 
===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:
+
The [http://en.wikipedia.org/wiki/Nash-Sutcliffe_efficiency_coefficient Nash-Sutcliffe efficiency] is a widely used performance measure based on the error variance. It is implemented as ''NSeff()'' in the topmodel package. It takes two vectors, containing the simulated (Qsim) and observed (Qobs) discharge:
 +
 
 +
  Eff <- NSeff(Qobs,Qsim)
 +
 
 +
The underlying code is very simple:
  
 
   NSeff <- function (Qobs, Qsim){
 
   NSeff <- function (Qobs, Qsim){
Line 17: Line 22:
 
       return(NS)
 
       return(NS)
 
   }
 
   }
   Eff <- NSeff(Qobs,Qsim)
+
 
 +
 
 +
===Coefficient of determination===
 +
 
 +
The [http://en.wikipedia.org/wiki/R-squared coefficient of determination] is the square of the Pearson's product-moment correlation coefficient. Note that the COD only evaluates linear relations between variables!
 +
 
 +
   COD <- cor(Qobs, Qsim, use="complete.obs")^2
 +
 
 +
 
 +
===Root mean squared error===
 +
 
 +
As the name suggests, the root mean squared error is the square root of the [http://en.wikipedia.org/wiki/Mean_squared_error mean squared error]:
 +
 
 +
  RMSE <- (mean((Qobs - Qsim)^2))^0.5

Latest revision as of 15:08, 15 September 2008

Introduction

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


Nash-Sutcliffe efficiency

The Nash-Sutcliffe efficiency is a widely used performance measure based on the error variance. It is implemented as NSeff() in the topmodel package. It takes two vectors, containing the simulated (Qsim) and observed (Qobs) discharge:

  Eff <- NSeff(Qobs,Qsim)

The underlying code is very simple:

  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)
  }


Coefficient of determination

The coefficient of determination is the square of the Pearson's product-moment correlation coefficient. Note that the COD only evaluates linear relations between variables!

  COD <- cor(Qobs, Qsim, use="complete.obs")^2


Root mean squared error

As the name suggests, the root mean squared error is the square root of the mean squared error:

  RMSE <- (mean((Qobs - Qsim)^2))^0.5