Code covered by the BSD License  

Highlights from
Seasonal Kendall Test with Slope for Serial Dependent Data

Be the first to rate this file! 10 Downloads (last 30 days) File Size: 12.96 KB File ID: #22389

Seasonal Kendall Test with Slope for Serial Dependent Data

by Jeff Burkey

 

10 Dec 2008 (Updated 19 Feb 2009)

Seasonal trends using tau-a,b and seasonal slope with intervals, accounts for serial dependence.

| Watch this File

File Information
Description

Seasonal Kendall Trend Test for Data with and without Searial Dependance.

Tau-b seasonal: takes into account ties (and multiple observations, except, the data are preprocessed in a subfucntion and multiple observatiosn per a given season are averaged using median).

Tau-a seasonal: does not consider multiple observations per season as ties. The data are preprocessed, seasons with multiple observations are summarized with a median value.

This routine will take into data evenly spaced by seasons. Compute Seasonal Tau-b, Tau, Sen's slope and it's confidence intervals.

!!! SERIAL CORRELATION IS COMPLETE AND VERIFIED !!!

Accounting for Serial Correlation is based on the below paper:
 Hirsch, R. M., Slack, J. R., A Nonparametric Trend Test for Seasonal Data with Serial Dependence. Water Resources Research Vol 20, No. 6, pages 727-732, June 1984.

Modifications:
   12/13/2008 - added Homogeneity test of trends for different seasons.
   12/17/2008 - added adjustments to significance with serial
   correlations removed by computing covariance instead of assuming zero.
   Starting season can be users specified.
   12/18/2008 - mulitiple observations in a single season are median averaged.
   1/17/2009 - checks for anomalies and provides solutions and/or
               notifications. Also requires the updated ktaub.m file
               because of the need for a computed variance with no ies
               removed.

Dependencies: ktaub.m
                    Statistics Toolbox

This function does require ktaub.m which has also been revised to support this function, so if you've previously downloaded ktuab.m, please check to make sure you have the most recent version.

Note: Calculating the covariance depends on when your seasons start in the year. For example, the USGS program Kendall.exe will automatically assume that Season 1 is the start of a water year (i.e. Season 1 = October, Season 12 = September). True that the 1984 Hirsch paper is dervied using 12-seasons (i.e. months), it is certainly reasonable to assume that the number of seasons can be something other than 12 months, and not necessariliy starting in October. So this function allows for the user to specify when Season 1 is to start. This nuance is critical because incomplete years are filled in with mid-ranks in the covariance.

These seasonal statistics were inspired by: Richard O. Gilbert, Pacific Northwest National Laboratories, "Statistical methods for Environmental Pollution Monitoring", 1987, Van Nostrand Reinhold, New York Publishing, ISBN 0-442-23050-8.

A good supporting statistic that may prove useful is performing a global trend test evaluating homogeneity of trends for different stations and seasons.
   See the posted function namged: GlobalTrends.m
datain structure is assumed to vary as the following:
datain(:,1) = Time (e.g. year)
datain(:,2) = season
datain(:,3) = data
alpha = assumed level of confidence
wantplot = flag if ~= 0 then a figure will be created if Tau-b is
significant. StartSeason = shift seasons to start with this one.
   Example: StartSeason = 10 will shift seasons 10 = 1, then years are adjusted to start with the new season shift.

Syntax:
   [taubsea tausea Sens h sig sigAdj Zs Zmod Ss Sigmas CIlower CIupper]
                = sktt(datain,alpha,wantplot,StartSeason)

Required Products Statistics Toolbox
MATLAB release MATLAB 7.7 (R2008b)
Other requirements ktaub.m (updated 1/17/2009)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
19 Feb 2009 Jeff Burkey

I've included a MAT file with example data to run the function. I hope this helps.

Please login to add a comment or rating.
Updates
12 Dec 2008

I had an error in the plotting routine. It's fixed.

18 Dec 2008

Now includes calculation of the covariance to account for serial dependence of data.

19 Dec 2008

I noticed I had left in some hard code of the startSeasons function. Fixed to be dynamic.

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. This update also requires the updated ktaub.m function 1/17/2009.

02 Feb 2009

Updated comments in the m-file.

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.

Tag Activity for this File
Tag Applied By Date/Time
probability Cristina McIntire 11 Dec 2008 14:33:22
statistics Jeff Burkey 11 Dec 2008 14:33:27
trends Jeff Burkey 11 Dec 2008 14:33:27
seasonal kendall test Jeff Burkey 11 Dec 2008 14:33:27
trend test Jeff Burkey 11 Dec 2008 14:33:27
mannkendall Jeff Burkey 11 Dec 2008 14:33:27
timeseries Jeff Burkey 11 Dec 2008 14:33:27
seasonal trend slope Jeff Burkey 11 Dec 2008 14:33:27
hydrology Jeff Burkey 11 Dec 2008 14:33:27
hydrologic Jeff Burkey 11 Dec 2008 14:33:27
taub Jeff Burkey 11 Dec 2008 14:33:27
mannkendall zapissa 22 Jul 2010 11:51:22

Contact us at files@mathworks.com