曼–肯德尔检验(Mann–Kendall test)
曼–肯德尔检验是一种非参数统计检验,用于检测时间序列中的单调上升或下降趋势,而不要求数据服从任何特定分布。它是肯德尔秩相关(Kendall's rank correlation)在观测值与时间之间的应用,并作为非参数趋势方法广泛应用于大气与水文研究,通常与森氏斜率估计量(Sen's slope estimator)配合使用,以量化趋势的幅度。1 • 2 • 3
| 关键事实 | 详情 |
|---|---|
| 检验内容 | :观测值在时间上随机排列(无单调趋势);:存在单调上升或下降趋势4 |
| 检验统计量 | ,即正负成对差值个数之差;通过 与肯德尔τ(Kendall's tau)相关1 |
| 方差(含结值) | ,其中 t 为每个结值组的大小2 |
| 近似 | 时使用 S 的精确分布; 时使用带连续性校正 Z 的正态近似4 • 5 |
| 效率 | 在正态、线性趋势备择假设下,相对于参数回归斜率检验的渐近相对效率为 0.982 |
| 主要要求 | 数据序列独立;正自相关会抬高假阳性率3 |
| 季节性变体 | 季节性肯德尔检验(Seasonal Kendall test)按月(或季)分别计算 S,并对统计量和方差求和2 |
工作原理
给定 n 个连续观测值,该检验考察数值是否随时间趋于增大或减小。统计量 S 统计所有观测对中,后一个观测值大于前一个观测值的次数,减去后一个观测值小于前一个观测值的次数:1
在随机性的原假设下,。S 是肯德尔τ的分子,肯德尔τ表示序列与时间之间的秩相关;无结值时 ,其中 D 按观测对数量进行归一化。1 曼(Mann,1945)将该过程描述为一种针对趋势的非参数随机性检验,是肯德尔相关性检验的一种特定应用。2
带结值校正的方差为2
其中求和遍历每个结值组,t 为该组的大小。对于 n ≥ 10 且无结值时,该式简化为 。6
实施方法
实践者根据所有成对符号比较计算 S,对 应用结值校正,并通过连续性校正将 S 转换为标准正态统计量:4
对于单侧上升趋势,当 Z ≥ Z₍₁₋α₎ 时拒绝 H₀;对于单侧下降趋势,当 Z ≤ −Z₍₁₋α₎ 时拒绝;对于双侧检验,当 |Z| ≥ Z₍₁₋α/2₎ 时拒绝。对于 n < 10,将 S 的精确分布与显著性表进行比较(在 MAKESENS 协议中, 和 0.001);对于 使用正态近似。4 • 5 缺失值和低于检出限的值可以处理,但性能会受到不利影响。4
为量化趋势,森氏斜率估计量取所有 个成对斜率 Qᵢ = (X_j − X_i)/(j − i) 并返回其中位数。100(1−α)% 置信区间使用 C_α = Z₍₁₋α/2₎·√Var(S),其上下限由位于 和 位置的有序斜率给出。该估计量受单个数据错误或离群值的影响不大,并且对于 可以计算;显著性检验至少需要 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 方差校正类修改针对自相关调整 :哈米德和拉奥(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 方差校正利用独立观测的有效数量来放大 ,这一概念来自贝利和哈默斯利(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
- trend: Non-Parametric Trend Tests and Change-Point Detection (R package vignette, Pohlert)
- Techniques of Trend Analysis for Monthly Water Quality Data (Hirsch, Slack & Smith, 1982, Water Resources Research 18:107–121)
- 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)
- Design Trend Mann-Kendall (US DOE PNNL VSP documentation)
- MAKESENS Excel template manual (Finnish Meteorological Institute, Salmi et al. 2002)
- Appendix: Mann-Kendall Trend Tests (McLeod, UWO)
- Henry B. Mann (1945). Nonparametric Tests Against Trend. Econometrica.
- Robert M. Hirsch, James R. Slack (1984). A Nonparametric Trend Test for Seasonal Data With Serial Dependence. Water Resources Research.
- 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.
- Design Trend Seasonal Kendall (US DOE PNNL VSP documentation)
- Claudia Libiseller, Anders Grimvall (2002). Performance of partial Mann–Kendall tests for trend detection in the presence of covariates. Environmetrics.
- A modified Mann-Kendall trend test for autocorrelated data (Journal of Hydrology, 1998)
- 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.
- Khaled H. Hamed (2007). Trend detection in hydrologic data: The Mann–Kendall trend test under the scaling hypothesis. Journal of Hydrology.
- Modified Mann-Kendall with higher-order statistics for trend analysis (Scientific Reports, 2025)
- Simulationsexperimente zur Wirkung serieller Korrelation auf den Mann-Kendall Trend test (Kulkarni & Von Storch, Meteorologische Zeitschrift, 1995)
- 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).
- Bihrat Önöz, Mehmetcik Bayazit (2011). Block bootstrap for Mann–Kendall trend test of serially dependent data. Hydrological Processes.
- Kendall: Kendall Rank Correlation and Mann-Kendall Trend Test (R package documentation, McLeod, version 2.2.2)
- pyMannKendall: a python package for non parametric Mann Kendall family of trend tests (JOSS, 2019)
- Running mannkendall (R), mannkendall (R) documentation
- Running mannkendall (Python), mannkendall (Python) documentation
- Re-evaluation of the Power of the Mann-Kendall Test for Detecting Monotonic Trends in Hydrometeorological Time Series (Frontiers in Earth Science, 2020)
- On the Gaussian distribution of the Mann-Kendall tau in the case of autocorrelated data (PLOS One, 2025)
- Power of the Mann–Kendall and Spearman's rho tests for detecting monotonic trends in hydrological series (Yue, Pilon, Cavadias, Journal of Hydrology, 2002)
- A. N. Pettitt (1979). A Non-Parametric Approach to the Change-Point Problem. Journal of the Royal Statistical Society Series C (Applied Statistics).
- Temporal Change Analysis Based on Data Characteristics and Nonparametric Test (Water Resources Management, 2014)
- 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,注明出处即可免费使用。 嵌入参考卡片。