Skip to content
Method note

Mann-Kendall trend testMann-Kendall: no universal best test, only a diagnostics-based legal choice

The Mann-Kendall trend test is a rank-based test for a monotone trend. It is robust to non-normality and resistant to outliers, but it assumes independent observations. Real environmental and business series rarely are. This page explains the six variants in the workspace and the evidence that selects between them.

Reproducible procedure

This is the procedure the workspace executes for this method, in order. Each step has an action, a rule that can stop the step, and a defined output.

  1. 01

    Drop the points removed by the denoising rules and record how many were dropped.

    Rule
    Every method must run on the same rows, otherwise the comparison between them is meaningless.
    Output
    The analysis sample and its size.
  2. 02

    Choose the Mann-Kendall variant that the diagnostics support.

    Rule
    Significant lag-1 autocorrelation selects a variance-corrected variant; a detected cycle selects the seasonal variant.
    Output
    The selected variant and the diagnostic reason for it.
  3. 03

    Compute S, its variance, the z statistic and the p-value.

    Rule
    TFPW is never the sole headline, because pre-whitening can weaken a real trend.
    Output
    S, var(S), z, p and the rank correlation.
  4. 04

    Estimate the rate of change with the Theil-Sen slope and its interval.

    Rule
    The slope is always reported with a confidence interval, never as a point estimate alone.
    Output
    Slope and 95% interval.
  5. 05

    Run the remaining variants and compare their conclusions.

    Rule
    If the significance decision changes between variants, both results are reported side by side.
    Output
    The method sensitivity table.

The standard test and its effect size

The score S adds +1 for every pair where the later value is larger and −1 when it is smaller. The variance includes a tie correction. A continuity-corrected Z gives the p-value; dividing S by the number of pairs gives Kendall’s τ, the effect size. For n ≤ 10 without ties, the workspace uses the exact permutation distribution instead of the normal approximation.

A small p-value with a tiny τ is “significant but weak”. The interface always shows τ, the Theil–Sen slope and its interval next to the p-value so the size of the effect cannot hide behind the significance label.

Mann–Kendall S
S = Σ_{i<j} sign(x_j − x_i)
What this computes:
Add +1 for every pair where the later value is larger, −1 when smaller; a positive sum means overall rising, negative means falling.
Example:
10 of 12 pairs larger-later → S is positive.
Caution:
Autocorrelation underestimates Var[S].

Mann-Kendall trend test and autocorrelation: the most common silent error

Positive serial correlation reduces the effective number of independent observations. The standard test then underestimates the variance of S and reports false confidence. The Yue–Wang correction inflates Var[S] by n/n*, where n* is the effective sample size computed from the autocorrelation function. The correction can turn a “significant” trend into a non-significant one; that is honesty, not a bug.

Yue–Wang variance correction
n/n* = 1 + 2Σ_{k=1}^{n−1}(1 − k/n)ρ_k, Var*[S] = Var[S] · n/n*
What this computes:
Autocorrelation reduces the effective independent sample, so the variance is inflated to compensate.
Example:
100 strongly autocorrelated points may behave like 20 independent ones.
Caution:
The correction can turn a “significant” trend into a non-significant one — that is honesty, not a bug.
  • If lag-1 autocorrelation exceeds the 95% white-noise band, or Ljung–Box rejects independence, a corrected result is mandatory.
  • The uncorrected result stays on screen next to the corrected one. The workspace does not let you hide method sensitivity.

TFPW: pre-whitening and its cost

Trend-free pre-whitening removes the Theil–Sen trend, removes lag-1 autocorrelation, adds the trend back and runs the standard test. It can reduce false significance from persistence, but it can also remove part of the real trend and reduce power. The workspace always shows the uncorrected result beside it.

Seasonal Mann–Kendall

SMK compares each season with itself across cycles and combines the evidence. The variance includes covariance terms between seasons. Ignoring a strong seasonal cycle in the standard test can mistake a repeating pattern for a trend; applying SMK to a series with no cycle wastes power and can distort the variance. The cycle length must therefore be inferred or confirmed, never assumed silently.

MKRD and MKC3: available, but unvalidated here

Rank-detrended MK and the third-cumulant correction address autocorrelation created by the trend itself and non-linear dependence. Both are implemented and available in the workspace, but no installed reference implementation was available for independent comparison. They carry a permanent UNVALIDATED badge and never become the headline when a validated method exists.

Multiple columns and false discovery

Testing twenty columns at α = 0.05 gives roughly a 64% chance of at least one false positive. Benjamini–Hochberg FDR adjusts the family of p-values; the workspace reports the number of significant columns before and after correction and refuses to present an uncorrected multi-column result as “significant”.

Benjamini–Hochberg FDR
q_(i) = min_{k≥i} (m/k · p_(k))
What this computes:
When testing many columns at once, sort the p-values and adjust them upward to reduce false “significant” flags.
Example:
20 columns, smallest p = 0.001 may become q = 0.02 after correction.
Caution:
Columns no longer significant must not be called “significant”.

Selection rules used by the workspace

No autocorrelation and no cycle: standard MK. Significant autocorrelation: Yue–Wang primary, standard MK mandatory, TFPW available. Identifiable cycle: SMK primary, standard MK as the comparison. Strong autocorrelation with non-linear evidence: MKRD or MKC3 available, never hidden. Fewer than 20 observations: exact p-value, with an explicit warning that power is limited.

Common questions

How do I correct the Mann-Kendall trend test for autocorrelation?

Use the Yue–Wang variance correction: it inflates Var[S] by n/n*, where n* is computed from the autocorrelation function. TFPW is an alternative that pre-whitens the series. This workspace shows the corrected and uncorrected results side by side so the method sensitivity is visible.

How should I interpret a Mann-Kendall p-value?

The p-value is the chance of seeing a trend at least this strong if the series had no trend at all. It is not the probability that the trend is true. Read it together with Kendall τ and the Theil–Sen confidence interval: a tiny p with a tiny τ is significant but weak.

What is the difference between TFPW and Yue–Wang?

TFPW removes the trend, removes lag-1 autocorrelation, adds the trend back and then runs the test. Yue–Wang keeps the series intact and corrects the variance. TFPW can weaken a real trend; Yue–Wang can change significance in either direction. Both are shown with warnings rather than silently selected.

Why is a Theil–Sen confidence interval shown next to the MK result?

The p-value says whether a monotone direction is distinguishable from chance; the Theil–Sen slope says how large that direction is, in the original units, and the interval says how precisely it is estimated. Reporting only the p-value hides the effect size.

Related method notes

Cite this page: Detrend, “Mann-Kendall: no universal best test, only a diagnostics-based legal choice”, https://detrend.datacorp.top/methods/mann-kendall. Last updated 2026-11-15.

Verification matrixFAQAll method notesRSSllms.txt

Run this procedure on your own workbook

The workspace executes exactly these steps locally, selects the method from the diagnostics and keeps every alternative visible.

Open the workspace