赞
踩
%% Mann-Kendall Tau (aka Tau-b) with Sen's Method (enhanced)
% A non-parametric monotonic trend test computing Mann-Kendall Tau, Tau-b,
% and Sen抯 Slope written in Mathworks-MATLAB implemented using matrix
% rotations.
%
% Suggested citation:
%
% Burkey, Jeff. May 2006. A non-parametric monotonic trend test computing
% Mann-Kendall Tau, Tau-b, and Sen抯 Slope written in Mathworks-MATLAB
% implemented using matrix rotations. King County, Department of Natural
% Resources and Parks, Science and Technical Services section.
% Seattle, Washington. USA.
% http://www.mathworks.com/matlabcentral/fileexchange/authors/23983
%
%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%
% Important Note:
% I have also posted a Seasonal Kendell function at Mathworks
% sktt.m
%
%http://www.mathworks.com/matlabcentral/fileexchange/22389-seasonal-kendall
%-test-with-slope-for-serial-dependent-data
%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
%
% revised 12/1/2008- Computed variance now takes into account ties in the
% time index with multiple observations per index.
% Added in confidence intervals for Sens Slope
%
% Syntax:
% [taub tau h sig Z S sigma sen n senplot CIlower CIupper D Dall C3]
% = ktaub(datain, alpha, wantplot)
%
% where:
% datain = (N x 2) double
% alpha = (scalar) double
% wantplot is a flag
% ~= 0 means create plot, otherwise do not plot
%
% taub = Mann-Kendall coefficient adjusted for ties
% tau = Mann-Kendall coefficient not adjusted for ties
% n(n-1)/2
% h = hypothesis test (h=1 : is significant)
% sig = p value (two tailed)
% Z = Z score
% sigma = standard deviation
% sen = sen's slope
% plotofslope = data used to plot data and sen's slope
% cilower = lower confidence interval for sen's slope
% ciupper = upper confidence interval for sen's slope
%
% These next two variables are output because they are needed in the
% Seasonal Kendall function: sktt.m
% D = denominator used for calculating Tau-b
% Dall = denominator used for calculating Tau
% C3 = individual seasonal slopes aggregated for Sens Seasonal Slope
% nsigma = an assumed variance with all ties reconsidered but set to
% equal number of positive and negative differences.
%
%
% Modifications:
% 12/1/2008 - Taub = denominator is adjusted
% Tau = denominator is NOT adjusted
% (matches USGS Kendall.exe output)
%
% 1/17/2009 - checks for anomalies and provides solutions and/or
% notifications. In support of this for the Seasonal Kendall
% (which was also updated 1/17/2009), another term was added to
% the output of this function-- nsigma.
%
% 6/15/2011 - updated plotting confidence inter
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。