Code covered by the BSD License  

Highlights from
Nash-Sutcliffe Model Accuracy Metric

4.0

4.0 | 1 rating Rate this file 8 Downloads (last 30 days) File Size: 2.25 KB File ID: #14178

Nash-Sutcliffe Model Accuracy Metric

by Jeff Burkey

 

06 Mar 2007 (Updated 08 Mar 2007)

A metric to measure the ability of a model to predict observed values

| Watch this File

File Information
Description

Nash-Sutcliffe model accuracy statistic. Nash-Sutcliffe coefficient is an indicator of the model?s ability to predict about the 1:1 line between observed and simulated data.

The Nash-Sutcliffe coefficient is calculated as:
 
                 sum(Qobs - Qsim)^2
NS = 1 - ----------------------------
                 sum(Qobs - Qmean)^2
 
With the Nash-Sutcliffe measure, an r-square coefficient is calculated using coefficient values equal to 1 indicate a perfect fit between observed and predicted data, and r-square values equal to or less than 0 indicate that the model is predicting no better than using the average of the observed data. Thus Ockham's razor should be applied.

Dimensions of Observed data array does not have to equal simulated data. An intersection is used to pair up observed data to simulated. This function is setup to pair up the first column in the observed data matrix and the first column in the simulated data matrix. Data values are located in column 2 of both matricies.

One critical assumption to this measurement is the data are normal.

 Syntax:
     [NSout metric_id] = nashsutcliffe(obsDATA, simDATA)

 where:
     obsData = N x 2
     simData = N x 2

For convenience, I?ve also posted a skillscore function which is a derivation of the Nash-Sutcliffe. Both these functions submitted are not much more than a novelty given the simplistic nature of the statistic. And my plug on a highly valuable statistic I submitted a while ago, is non-parametric trend test, the Mann-Kendall Tau-b (named ktaub.m in the Earth Sciences category). Besides the dire need for such a statistic in MATLAB, the design has some elegance in it.

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
16 Jun 2008 Clare Jeffers

It works! This has saved me an hour or two of my life so thanks very much.

It would be excellent except I didn't find the comments that easy to follow. What is going on with this:

    % Set metric id for optional use. This is arbitrarily set to 1001
    % for this metric and used in other applications not associated to this
    % function. The user can either ignore or remove from the function.

?

Maybe it is just me being dim but I couldn't work out the point of that.

Thanks again for posting this.

02 Nov 2008 Jeff Burkey

Sorry about that. It's more for legacy work done in the past, and I probably should take it out. I was working on a project where we were running hundreds of variants of metrics and differentiating by name gets messy, hence using a database to track which statistic was used. - Jeff

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Jeff Burkey 22 Oct 2008 09:02:52
probability Jeff Burkey 22 Oct 2008 09:02:52
nash sutcliffe prediction Jeff Burkey 22 Oct 2008 09:02:52

Contact us at files@mathworks.com