edgepedia

物质世界与数学 / 数学与统计学 / 统计学与概率论 / Statistical inference, estimation, sampling, and testing / Hypothesis testing

综合 · Edgepedia阅读需 9 分钟

曼–肯德尔检验(Mann–Kendall test)

阅读英文原文

曼–肯德尔检验是一种非参数统计检验,用于检测时间序列中的单调上升或下降趋势,而不要求数据服从任何特定分布。它是肯德尔秩相关(Kendall's rank correlation)在观测值与时间之间的应用,并作为非参数趋势方法广泛应用于大气与水文研究,通常与森氏斜率估计量(Sen's slope estimator)配合使用,以量化趋势的幅度。1 • 2 • 3

关键事实详情
检验内容H0 H_0 :观测值在时间上随机排列(无单调趋势);H1 H_1 :存在单调上升或下降趋势4
检验统计量S=∑∑sgn(Xj−Xk) S = \sum \sum \mathrm{sgn}(X_j - X_k) ,即正负成对差值个数之差;通过 τ=S/D \tau = S/D 与肯德尔τ(Kendall's tau)相关1
方差(含结值)Var(S)=[n⋅(n−1)⋅(2n+5)−∑t⋅(t−1)⋅(2t+5)]/18 \mathrm{Var}(S) = [n \cdot (n-1) \cdot (2n+5) - \sum t \cdot (t-1) \cdot (2t+5)]/18 ,其中 t 为每个结值组的大小2
近似n<10 n < 10 时使用 S 的精确分布;n≥10 n \ge 10 时使用带连续性校正 Z 的正态近似4 • 5
效率在正态、线性趋势备择假设下,相对于参数回归斜率检验的渐近相对效率为 0.982
主要要求数据序列独立;正自相关会抬高假阳性率3
季节性变体季节性肯德尔检验(Seasonal Kendall test)按月(或季)分别计算 S,并对统计量和方差求和2

工作原理

给定 n 个连续观测值,该检验考察数值是否随时间趋于增大或减小。统计量 S 统计所有观测对中,后一个观测值大于前一个观测值的次数,减去后一个观测值小于前一个观测值的次数:1

S=∑j>ksgn(Xj−Xk) S = \sum_{j>k} \mathrm{sgn}(X_j - X_k)

在随机性的原假设下,E[S]=0 \mathrm{E}[S] = 0 。S 是肯德尔τ的分子,肯德尔τ表示序列与时间之间的秩相关;无结值时 τ=S/D \tau = S/D ,其中 D 按观测对数量进行归一化。1 曼(Mann,1945)将该过程描述为一种针对趋势的非参数随机性检验,是肯德尔相关性检验的一种特定应用。2

带结值校正的方差为2

Var(S)=n⋅(n−1)⋅(2n+5)−∑tt⋅(t−1)⋅(2t+5)18 \mathrm{Var}(S) = \frac{n \cdot (n-1) \cdot (2n+5) - \sum_t t \cdot (t-1) \cdot (2t+5)}{18}

其中求和遍历每个结值组,t 为该组的大小。对于 n ≥ 10 且无结值时,该式简化为 n⋅(n−1)⋅(2n+5)/18 n \cdot (n-1) \cdot (2n+5)/18 。6

实施方法

实践者根据所有成对符号比较计算 S,对 Var(S) \mathrm{Var}(S) 应用结值校正,并通过连续性校正将 S 转换为标准正态统计量:4

Z={(S−1)/Var(S)S>00S=0(S+1)/Var(S)S<0 Z = \begin{cases} (S-1)/\sqrt{\mathrm{Var}(S)} & S > 0 \\ 0 & S = 0 \\ (S+1)/\sqrt{\mathrm{Var}(S)} & S < 0 \end{cases}

对于单侧上升趋势,当 Z ≥ Z₍₁₋α₎ 时拒绝 H₀;对于单侧下降趋势,当 Z ≤ −Z₍₁₋α₎ 时拒绝;对于双侧检验,当 |Z| ≥ Z₍₁₋α/2₎ 时拒绝。对于 n < 10,将 S 的精确分布与显著性表进行比较(在 MAKESENS 协议中,α=0.1,0.05,0.01, \alpha = 0.1, 0.05, 0.01, 和 0.001);对于 n≥10 n \ge 10 使用正态近似。4 • 5 缺失值和低于检出限的值可以处理,但性能会受到不利影响。4

为量化趋势,森氏斜率估计量取所有 N=n⋅(n−1)/2 N = n \cdot (n-1)/2 个成对斜率 Qᵢ = (X_j − X_i)/(j − i) 并返回其中位数。100(1−α)% 置信区间使用 C_α = Z₍₁₋α/2₎·√Var(S),其上下限由位于 M1=(N−Cα)/2 M_1 = (N - C_{\alpha})/2 和 M2+1=(N+Cα)/2+1 M_2 + 1 = (N + C_{\alpha})/2 + 1 位置的有序斜率给出。该估计量受单个数据错误或离群值的影响不大,并且对于 n≥2 n \ge 2 可以计算;显著性检验至少需要 4 个值,斜率的置信区间至少需要 10 个值。5

起源

亨利·B·曼(Henry B. Mann)在《非参数趋势检验》(“Nonparametric Tests Against Trend”,《计量经济学》,1945)中提出了该检验。7 针对月度水质数据的季节性扩展——季节性肯德尔检验——由罗伯特·M·赫希(Robert M. Hirsch)、詹姆斯·R·斯莱克(James R. Slack)和理查德·A·史密斯(Richard A. Smith)于 1982 年在《水资源研究》(Water Resources Research)中提出。2 赫希和斯莱克于 1984 年再次将其扩展,以处理具有序列相依性的季节性数据。8 该检验很早就进入常规使用:克劳福德(Crawford)、斯莱克和赫希于 1983 年将其实现为 SAS 过程 SEASKEN,并由美国地质调查局(U.S. Geological Survey)作为开放文件报告 83-550 分发。9

变体

季节性肯德尔检验按月分别计算肯德尔得分,并对月度得分和方差求和,使检验对季节性不敏感。当数据具有季节性周期时需要使用该检验。如果不同季节的趋势方向相反,该检验会产生误导;对于具有 3 年及以上记录的月度数据,正态近似是合适的。2 • 10 赫希–斯莱克变体处理季节内的序列相依性,并且由于完全基于秩,对非正态性和删失具有稳健性。8

R 的 trend 包采用利比塞勒(Libiseller)和格里姆瓦尔(Grimvall,2002)的表述,其偏曼–肯德尔检验(partial Mann–Kendall test)可去除河流流量等协变量的影响。1 • 11 方差校正类修改针对自相关调整 Var(S) \mathrm{Var}(S) :哈米德和拉奥(Hamed and Rao,1998)通过有效样本量进行调整,12 岳和王(Yue and Wang,2004)从去趋势序列计算有效样本量,13 哈米德(Hamed,2007)在长期持续性的标度假设下进行调整。14 MKC3 在方差校正中加入三阶累积量项。15

预白化(prewhitening)在检验前去除估计的滞后1阶 AR(1) 成分;它恢复了正确的第一类错误率,但在存在趋势时损失功效,因为趋势会使自相关估计产生偏差。16 • 3 趋势无关预白化(TFPW)先去除趋势,再进行预白化;它恢复了功效,但提高了第一类错误率,而王和斯韦尔(Wang and Swail)的迭代 TFPW 在恢复低第一类错误率的同时不损失功效。3 方差校正利用独立观测的有效数量来放大 Var(S) \mathrm{Var}(S) ,这一概念来自贝利和哈默斯利(Bayley and Hammersley,1946)。13 • 17 块自助法(block bootstrap)方法按块重采样序列,以保留相依性。18

应用

该检验广泛应用于大气与水文研究,相关实现也广泛可得。R 包 trend 提供曼–肯德尔检验、季节性检验、偏检验和多变量检验,以及森氏斜率。1 R 包 Kendall 实现曼–肯德尔检验和季节性检验,并支持针对自相关序列的块自助法。19 pyMannKendall 将几乎整个检验家族引入 Python,包括哈米德–拉奥和岳方差校正以及泰尔–森斜率估计量。20 面向 R 和 Python 的 mannkendall 包将检验与可选的预白化方法结合,在 R 中默认使用 3PW,在 Python 中默认使用 TFPW_WS。21 • 22 美国地质调查局和基于 SAS 的工具可追溯至 1983 年的 SEASKEN 过程,9 而 2025 年的 MKC3 修改是在 pymannkendall 之上实现的。15

局限与替代方法

该检验假设数据序列独立,而正自相关会通过增大 S 的方差同时抬高第一类错误率和第二类错误率。在 1000 条长度为 100 的 AR(1) 序列的蒙特卡洛模拟中,名义 5% 拒绝率仅在自相关低于 0.1 时成立;在自相关为 0.3 时,拒绝率为 15%,是名义率的三倍。16 功效随趋势斜率和样本量增大而提高,随样本方差增大而下降。23 近期理论工作表明,对于自相关的有限序列,检验统计量的高斯近似可能失效,实际有效性判据取决于自相关结构和序列长度。24

在正态、线性趋势备择假设下,相对于回归斜率的参数检验,曼–肯德尔检验的渐近相对效率为 0.98,因此为换取分布稳健性而牺牲的功效很少。2 蒙特卡洛比较显示,其功效与斯皮尔曼ρ(Spearman's rho)几乎无法区分,二者都取决于显著性水平、趋势幅度、样本量和变异程度。25 佩蒂特变点检验(Pettitt's change-point test,1979)回答的是另一个问题,即检测单一突变,而不是渐进单调趋势;一项研究建议在趋势分析之前先进行变点检测。26 • 27 比较模拟发现,没有任何单一修正方法在所有情形下表现最佳;原始检验在大样本下仍然可靠,而一项实用建议是对给定数据集至少采用两种校正方法。15 • 28 赫希、斯莱克和史密斯本人建议,最好将该检验视为一种探索性分析,用于识别变化显著或幅度较大的站点。4

References

  1. trend: Non-Parametric Trend Tests and Change-Point Detection (R package vignette, Pohlert)
  2. Techniques of Trend Analysis for Monthly Water Quality Data (Hirsch, Slack & Smith, 1982, Water Resources Research 18:107–121)
  3. Effects of the prewhitening method, the time granularity, and the time segmentation on the Mann–Kendall trend detection and the associated Sen's slope (AMT, Copernicus, 2020)
  4. Design Trend Mann-Kendall (US DOE PNNL VSP documentation)
  5. MAKESENS Excel template manual (Finnish Meteorological Institute, Salmi et al. 2002)
  6. Appendix: Mann-Kendall Trend Tests (McLeod, UWO)
  7. Henry B. Mann (1945). Nonparametric Tests Against Trend. Econometrica.
  8. Robert M. Hirsch, James R. Slack (1984). A Nonparametric Trend Test for Seasonal Data With Serial Dependence. Water Resources Research.
  9. Charles G. Crawford, James R. Slack, Robert M. Hirsch (1983). Nonparametric tests for trends in water-quality data using the statistical analysis system. USGS Open-File Report 83-550.
  10. Design Trend Seasonal Kendall (US DOE PNNL VSP documentation)
  11. Claudia Libiseller, Anders Grimvall (2002). Performance of partial Mann–Kendall tests for trend detection in the presence of covariates. Environmetrics.
  12. A modified Mann-Kendall trend test for autocorrelated data (Journal of Hydrology, 1998)
  13. Sheng Yue, ChunYuan Wang (2004). The Mann-Kendall Test Modified by Effective Sample Size to Detect Trend in Serially Correlated Hydrological Series. Water Resources Management.
  14. Khaled H. Hamed (2007). Trend detection in hydrologic data: The Mann–Kendall trend test under the scaling hypothesis. Journal of Hydrology.
  15. Modified Mann-Kendall with higher-order statistics for trend analysis (Scientific Reports, 2025)
  16. Simulationsexperimente zur Wirkung serieller Korrelation auf den Mann-Kendall Trend test (Kulkarni & Von Storch, Meteorologische Zeitschrift, 1995)
  17. G. V. Bayley, J. M. Hammersley (1946). The “Effective” Number of Independent Observations in an Autocorrelated Time Series. Journal of the Royal Statistical Society Series B (Statistical Methodology).
  18. Bihrat Önöz, Mehmetcik Bayazit (2011). Block bootstrap for Mann–Kendall trend test of serially dependent data. Hydrological Processes.
  19. Kendall: Kendall Rank Correlation and Mann-Kendall Trend Test (R package documentation, McLeod, version 2.2.2)
  20. pyMannKendall: a python package for non parametric Mann Kendall family of trend tests (JOSS, 2019)
  21. Running mannkendall (R), mannkendall (R) documentation
  22. Running mannkendall (Python), mannkendall (Python) documentation
  23. Re-evaluation of the Power of the Mann-Kendall Test for Detecting Monotonic Trends in Hydrometeorological Time Series (Frontiers in Earth Science, 2020)
  24. On the Gaussian distribution of the Mann-Kendall tau in the case of autocorrelated data (PLOS One, 2025)
  25. Power of the Mann–Kendall and Spearman's rho tests for detecting monotonic trends in hydrological series (Yue, Pilon, Cavadias, Journal of Hydrology, 2002)
  26. A. N. Pettitt (1979). A Non-Parametric Approach to the Change-Point Problem. Journal of the Royal Statistical Society Series C (Applied Statistics).
  27. Temporal Change Analysis Based on Data Characteristics and Nonparametric Test (Water Resources Management, 2014)
  28. The modified Mann-Kendall test: on the performance of three variance correction approaches (Blain; Bragantia)

Initially written Sep 29, 2026 · Edited: Oct 15, 2026; Oct 21, 2026

© 2026 Biostate AI。依据 Edgepedia Community License,注明出处即可免费使用。 嵌入参考卡片。

报告错误

曼–肯德尔检验(Mann–Kendall test)

请至少选择一个原因。