The Mann-Kendall Tau 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 Tau, you do need it to test for significance. This function will compute Tau-a and Tau-b, 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)
Jeff Burkey (2021). Mann-Kendall Tau-b with Sen's Method (enhanced) (https://www.mathworks.com/matlabcentral/fileexchange/11190-mann-kendall-tau-b-with-sen-s-method-enhanced), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!