Mann-Kendall Tau-b with Sen's Method (enhanced)
by Jeff Burkey
25 May 2006
(Updated 14 Oct 2009)
Code covered by BSD License
A non-parametric trend test including Sen's slope method using Mann-Kendall Tau-b technique
Download Now
|
Watch this File
|
| File Information |
| Description |
The Mann-Kendall Tau-b non-parametric function computes a coefficient representing strength and direction of a trend for equally spaced data. While you do not need the Statistics Toolbox to compute Taub, you do need it to test for significance. This function will compute Tau-b (now tau-a as well), significance (and the various supporting statistics), and also a non-parametric slope method: Sens Method.
Note: Statistics Toolbox is only needed in this function to test for significance. Otherwise, there is nothing required beyond Matlab itself.
Enhancements include: now supports a seasonal kendall trend test recently submitted (sktt.m). Will allow for multiple observations in the same time index. Confidence intervals are added for Sens slope. Also a plot can be turned on/off.
Second enhancement: test for anomalies in trends, fixes, and notifies the user. Reference is in the comments of the function.
Given the speed of computers today, avoiding loops in Matlab is not as important for some computations as it has been in the past. Nevertheless, writing functions without loops is a form of elegance I think some people may appreciate. As such, this function is written without any loops. Example syntax to use the function is:
[taub tau h sig Z S sigma sen n senplot cilower ciupper] = ktaub(datain, alpha,wantplot) |
| Required Products |
Statistics Toolbox
|
| MATLAB release |
MATLAB 7.7 (R2008b)
|
| Zip File Content |
|
| Other Files |
ex1.mat, ktaub.m, license.txt
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (22) |
| 09 Oct 2006 |
Gerald Corzo
|
|
|
| 27 Nov 2006 |
Till Ruprecht
|
|
|
| 10 Apr 2007 |
mostafa abd elhameed
|
|
|
| 21 Apr 2007 |
Jeff Bukkey
|
|
|
| 29 Jun 2007 |
Ryan Galley
|
|
|
| 25 Jul 2007 |
R Peterson
|
|
|
| 01 Feb 2008 |
Domingo ALCARAZ-SEGURA
|
|
|
| 01 Apr 2008 |
qassi tarawne
|
|
|
| 11 Apr 2008 |
Jeff Burkey
|
|
|
| 24 Apr 2008 |
Li Zhi
|
|
|
| 23 May 2008 |
Jeff Burkey
|
|
|
| 23 May 2008 |
Jeff Burkey
|
|
|
| 16 Jun 2008 |
Hakan Moral
|
|
|
| 23 Jun 2008 |
Hakan Moral
|
|
|
| 30 Jun 2008 |
Izi Krneki
|
|
|
| 04 Jul 2008 |
Nicholas Cutler
|
|
|
| 19 Jul 2008 |
Jeff Burkey
|
|
|
| 17 Feb 2009 |
Ian Chien
|
|
|
| 19 Feb 2009 |
Jeff Burkey
|
|
|
| 10 Aug 2009 |
Kristina
|
|
|
| 25 Aug 2009 |
Kristina
|
|
|
| 25 Aug 2009 |
Jeff Burkey
|
|
|
| Updates |
| 27 May 2008 |
Bug Fix: S statistic should have been adjusted for datasets with n >= 10, not n <= 10. |
| 27 May 2008 |
After making correction, I wanted to output S unadjusted. This version has the correction, but still outputs S unadjusted. |
| 16 Jun 2008 |
When maintaining S I forgot to assign s = S for small datasets. Also trap error if user enters in NaNs. Added plotting routine at the end of the function to display a figure if the trend is significant. Uncomment this to get this utility. |
| 22 Jul 2008 |
My last upload must have been too recent after the previous upload. As Nicholas mentioned s wasn't assigned for small N. Also the plotting routine didn't get uploaded with the last attempt. Here is another attempt. |
| 10 Dec 2008 |
Updated the function to account for multiple observations per time index, also modifed outputs to support the newly added Seasonal Kendall trend test- sktt.m. |
| 11 Dec 2008 |
Try number 3. The webpage timed out on my try 2. |
| 12 Dec 2008 |
Sorry type-o in the description. This enhanced function WILL allow for multiple observations in the time index, ties, mission values, etc. |
| 12 Dec 2008 |
I need to get used to uploading files. I uploaded the wrong version. Sorry. The version previously uploaded had a glitch in the Confidence interval calculations. Same glitch is in the seasonal kendall (sktt.m). Fixed now. |
| 16 Jan 2009 |
Now will test for anomalies in trend estimates. Fixes and notifies the user. See comments in function for more detail and the paper used for this enhancement. |
| 19 Feb 2009 |
I've gotten a couple of inquiries asking for example dataset to use. I've included a MAT file that can be used with the m-file. |
| 14 Oct 2009 |
Updated comments. |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com