File Exchange

image thumbnail

Mann-Kendall Modified test

version 1.0 (2.44 KB) by

Mann-Kendall non-parametric trend test modified to account for autocorrelations.



View License

The code performs two tailed Mann-Kendall test modified to account for autocorrelation on the time series (Hamed and Rao, 1998).
The null hypothesis of trend absence in the vector V is tested, against the alternative of trend. The result of the test is returned in H = 1 indicates a rejection of the null hypothesis at the alpha significance level. H = 0 indicates a failure to reject the null hypothesis at the alpha significance level.

Comments and Ratings (8)

hui tao

Hi, how can i get the Z value ? thanks

Hi I am using this code for my analysis so are the comments true. Do we need to correct the code or its good to go without modification of the code for
"I = tiedrank(V);". please reply

M Bateni

in complement to comment of Jens Wilhelmi and Md. Manjurul, if you don't want ranks for tied values to be not averaged, you can use [~,~,I]=unique(V).

Md. Manjurul

Jens Wilhelmi is right. Line 70

"[V,I]=sort(V); %% I = ranks"

is replace by

"I = tiedrank(V);"

Jens Wilhelmi

There seems to be a bug in
line 70:
[V,I]=sort(V); %% I = ranks

IMHO the variable "I" contains the indexes of the values of "V"
rather than the ranks.
From my side of view
I = tiedrank(V);
should be used here instead.

Jens Wilhelmi


david (view profile)

cai onion

MATLAB Release
MATLAB 7.5 (R2007b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video