# 曼–肯德尔检验（Mann–Kendall test）

曼–肯德尔检验是一种非参数统计检验，用于检测时间序列中的单调上升或下降趋势，而不要求数据服从任何特定分布。它是肯德尔秩相关（Kendall's rank correlation）在观测值与时间之间的应用，并作为非参数趋势方法广泛应用于大气与水文研究，通常与森氏斜率估计量（Sen's slope estimator）配合使用，以量化趋势的幅度。<sup>[1](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)</sup><sup> • </sup><sup>[2](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)</sup><sup> • </sup><sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup>

| 关键事实 | 详情 |
|---|---|
| 检验内容 | \( H_0 \)：观测值在时间上随机排列（无单调趋势）；\( H_1 \)：存在单调上升或下降趋势<sup>[4](https://vsp.pnnl.gov/help/vsample/design_trend_mann_kendall.htm)</sup> |
| 检验统计量 | \( S = \sum \sum \mathrm{sgn}(X_j - X_k) \)，即正负成对差值个数之差；通过 \( \tau = S/D \) 与肯德尔τ（Kendall's tau）相关<sup>[1](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)</sup> |
| 方差（含结值） | \( \mathrm{Var}(S) = [n \cdot (n-1) \cdot (2n+5) - \sum t \cdot (t-1) \cdot (2t+5)]/18 \)，其中 t 为每个结值组的大小<sup>[2](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)</sup> |
| 近似 | \( n < 10 \) 时使用 S 的精确分布；\( n \ge 10 \) 时使用带连续性校正 Z 的正态近似<sup>[4](https://vsp.pnnl.gov/help/vsample/design_trend_mann_kendall.htm)</sup><sup> • </sup><sup>[5](https://assets.ctfassets.net/hli0qi7fbbos/13FdMo2tNxoNSafOSWeDSb/d4d74afb17a65426b8002ab2b5b82b6e/MAKESENS-Manual_2002.pdf)</sup> |
| 效率 | 在正态、线性趋势备择假设下，相对于参数回归斜率检验的渐近相对效率为 0.98<sup>[2](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)</sup> |
| 主要要求 | 数据序列独立；正自相关会抬高假阳性率<sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup> |
| 季节性变体 | 季节性肯德尔检验（Seasonal Kendall test）按月（或季）分别计算 S，并对统计量和方差求和<sup>[2](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)</sup> |

## 工作原理

给定 n 个连续观测值，该检验考察数值是否随时间趋于增大或减小。统计量 S 统计所有观测对中，后一个观测值大于前一个观测值的次数，减去后一个观测值小于前一个观测值的次数：<sup>[1](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)</sup>

\[ S = \sum_{j>k} \mathrm{sgn}(X_j - X_k) \]

在随机性的原假设下，\( \mathrm{E}[S] = 0 \)。S 是肯德尔τ的分子，肯德尔τ表示序列与时间之间的秩相关；无结值时 \( \tau = S/D \)，其中 D 按观测对数量进行归一化。<sup>[1](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)</sup> 曼（Mann，1945）将该过程描述为一种针对趋势的非参数随机性检验，是肯德尔相关性检验的一种特定应用。<sup>[2](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)</sup>

带结值校正的方差为<sup>[2](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)</sup>

\[ \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 \cdot (n-1) \cdot (2n+5)/18 \)。<sup>[6](https://www.stats.uwo.ca/faculty/mcleod/2003/DBeirness/MannKendall.pdf)</sup>

## 实施方法

实践者根据所有成对符号比较计算 S，对 \( \mathrm{Var}(S) \) 应用结值校正，并通过连续性校正将 S 转换为标准正态统计量：<sup>[4](https://vsp.pnnl.gov/help/vsample/design_trend_mann_kendall.htm)</sup>

\[ 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 协议中，\( \alpha = 0.1, 0.05, 0.01, \) 和 0.001）；对于 \( n \ge 10 \) 使用正态近似。<sup>[4](https://vsp.pnnl.gov/help/vsample/design_trend_mann_kendall.htm)</sup><sup> • </sup><sup>[5](https://assets.ctfassets.net/hli0qi7fbbos/13FdMo2tNxoNSafOSWeDSb/d4d74afb17a65426b8002ab2b5b82b6e/MAKESENS-Manual_2002.pdf)</sup> 缺失值和低于检出限的值可以处理，但性能会受到不利影响。<sup>[4](https://vsp.pnnl.gov/help/vsample/design_trend_mann_kendall.htm)</sup>

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

## 起源

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

## 变体

季节性肯德尔检验按月分别计算肯德尔得分，并对月度得分和方差求和，使检验对季节性不敏感。当数据具有季节性周期时需要使用该检验。如果不同季节的趋势方向相反，该检验会产生误导；对于具有 3 年及以上记录的月度数据，正态近似是合适的。<sup>[2](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)</sup><sup> • </sup><sup>[10](https://vsp.pnnl.gov/help/vsample/Design_Trend_Seasonal_Kendall.htm)</sup> 赫希–斯莱克变体处理季节内的序列相依性，并且由于完全基于秩，对非正态性和删失具有稳健性。<sup>[8](https://doi.org/10.1029/wr020i006p00727)</sup>

R 的 trend 包采用利比塞勒（Libiseller）和格里姆瓦尔（Grimvall，2002）的表述，其偏曼–肯德尔检验（partial Mann–Kendall test）可去除河流流量等协变量的影响。<sup>[1](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)</sup><sup> • </sup><sup>[11](https://doi.org/10.1002/env.507)</sup> 方差校正类修改针对自相关调整 \( \mathrm{Var}(S) \)：哈米德和拉奥（Hamed and Rao，1998）通过有效样本量进行调整，<sup>[12](https://doi.org/10.1016/s0022-1694%2897%2900125-x)</sup> 岳和王（Yue and Wang，2004）从去趋势序列计算有效样本量，<sup>[13](https://doi.org/10.1023/b:warm.0000043140.61082.60)</sup> 哈米德（Hamed，2007）在长期持续性的标度假设下进行调整。<sup>[14](https://doi.org/10.1016/j.jhydrol.2007.11.009)</sup> MKC3 在方差校正中加入三阶累积量项。<sup>[15](https://www.nature.com/articles/s41598-025-30034-0)</sup>

预白化（prewhitening）在检验前去除估计的滞后1阶 AR(1) 成分；它恢复了正确的第一类错误率，但在存在趋势时损失功效，因为趋势会使自相关估计产生偏差。<sup>[16](https://www.hvonstorch.de/klima/pdf/kulkarni.1995.pdf)</sup><sup> • </sup><sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup> 趋势无关预白化（TFPW）先去除趋势，再进行预白化；它恢复了功效，但提高了第一类错误率，而王和斯韦尔（Wang and Swail）的迭代 TFPW 在恢复低第一类错误率的同时不损失功效。<sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup> 方差校正利用独立观测的有效数量来放大 \( \mathrm{Var}(S) \)，这一概念来自贝利和哈默斯利（Bayley and Hammersley，1946）。<sup>[13](https://doi.org/10.1023/b:warm.0000043140.61082.60)</sup><sup> • </sup><sup>[17](https://doi.org/10.2307/2983560)</sup> 块自助法（block bootstrap）方法按块重采样序列，以保留相依性。<sup>[18](https://doi.org/10.1002/hyp.8438)</sup>

## 应用

该检验广泛应用于大气与水文研究，相关实现也广泛可得。R 包 trend 提供曼–肯德尔检验、季节性检验、偏检验和多变量检验，以及森氏斜率。<sup>[1](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)</sup> R 包 Kendall 实现曼–肯德尔检验和季节性检验，并支持针对自相关序列的块自助法。<sup>[19](https://cran.r-project.org/web/packages/Kendall/Kendall.pdf)</sup> pyMannKendall 将几乎整个检验家族引入 Python，包括哈米德–拉奥和岳方差校正以及泰尔–森斜率估计量。<sup>[20](https://www.theoj.org/joss-papers/joss.01556/10.21105.joss.01556.pdf)</sup> 面向 R 和 Python 的 mannkendall 包将检验与可选的预白化方法结合，在 R 中默认使用 3PW，在 Python 中默认使用 TFPW_WS。<sup>[21](https://mannkendall.github.io/R/running.html)</sup><sup> • </sup><sup>[22](https://mannkendall.github.io/Python/running.html)</sup> 美国地质调查局和基于 SAS 的工具可追溯至 1983 年的 SEASKEN 过程，<sup>[9](https://doi.org/10.3133/ofr83550)</sup> 而 2025 年的 MKC3 修改是在 pymannkendall 之上实现的。<sup>[15](https://www.nature.com/articles/s41598-025-30034-0)</sup>

## 局限与替代方法

该检验假设数据序列独立，而正自相关会通过增大 S 的方差同时抬高第一类错误率和第二类错误率。在 1000 条长度为 100 的 AR(1) 序列的蒙特卡洛模拟中，名义 5% 拒绝率仅在自相关低于 0.1 时成立；在自相关为 0.3 时，拒绝率为 15%，是名义率的三倍。<sup>[16](https://www.hvonstorch.de/klima/pdf/kulkarni.1995.pdf)</sup> 功效随趋势斜率和样本量增大而提高，随样本方差增大而下降。<sup>[23](https://www.frontiersin.org/journals/earth-science/articles/10.3389/feart.2020.00014/full)</sup> 近期理论工作表明，对于自相关的有限序列，检验统计量的高斯近似可能失效，实际有效性判据取决于自相关结构和序列长度。<sup>[24](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0333224)</sup>

在正态、线性趋势备择假设下，相对于回归斜率的参数检验，曼–肯德尔检验的渐近相对效率为 0.98，因此为换取分布稳健性而牺牲的功效很少。<sup>[2](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)</sup> 蒙特卡洛比较显示，其功效与斯皮尔曼ρ（Spearman's rho）几乎无法区分，二者都取决于显著性水平、趋势幅度、样本量和变异程度。<sup>[25](https://www.sciencedirect.com/science/article/abs/pii/S0022169401005947)</sup> 佩蒂特变点检验（Pettitt's change-point test，1979）回答的是另一个问题，即检测单一突变，而不是渐进单调趋势；一项研究建议在趋势分析之前先进行变点检测。<sup>[26](https://doi.org/10.2307/2346729)</sup><sup> • </sup><sup>[27](https://ideas.repec.org/a/spr/waterr/v28y2014i1p227-240.html)</sup> 比较模拟发现，没有任何单一修正方法在所有情形下表现最佳；原始检验在大样本下仍然可靠，而一项实用建议是对给定数据集至少采用两种校正方法。<sup>[15](https://www.nature.com/articles/s41598-025-30034-0)</sup><sup> • </sup><sup>[28](https://www.redalyc.org/pdf/908/90829242014.pdf)</sup> 赫希、斯莱克和史密斯本人建议，最好将该检验视为一种探索性分析，用于识别变化显著或幅度较大的站点。<sup>[4](https://vsp.pnnl.gov/help/vsample/design_trend_mann_kendall.htm)</sup>

## References

1. [trend: Non-Parametric Trend Tests and Change-Point Detection (R package vignette, Pohlert)](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)
2. [Techniques of Trend Analysis for Monthly Water Quality Data (Hirsch, Slack & Smith, 1982, Water Resources Research 18:107–121)](http://tampabay.wateratlas.usf.edu/upload/documents/Techniques-of-Trend-Analysis-for-Monthly-Water-Quality-Data.pdf)
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)](https://amt.copernicus.org/articles/13/6945/2020/)
4. [Design Trend Mann-Kendall (US DOE PNNL VSP documentation)](https://vsp.pnnl.gov/help/vsample/design_trend_mann_kendall.htm)
5. [MAKESENS Excel template manual (Finnish Meteorological Institute, Salmi et al. 2002)](https://assets.ctfassets.net/hli0qi7fbbos/13FdMo2tNxoNSafOSWeDSb/d4d74afb17a65426b8002ab2b5b82b6e/MAKESENS-Manual_2002.pdf)
6. [Appendix: Mann-Kendall Trend Tests (McLeod, UWO)](https://www.stats.uwo.ca/faculty/mcleod/2003/DBeirness/MannKendall.pdf)
7. [Henry B. Mann (1945). Nonparametric Tests Against Trend. Econometrica.](https://doi.org/10.2307/1907187)
8. [Robert M. Hirsch, James R. Slack (1984). A Nonparametric Trend Test for Seasonal Data With Serial Dependence. Water Resources Research.](https://doi.org/10.1029/wr020i006p00727)
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.](https://doi.org/10.3133/ofr83550)
10. [Design Trend Seasonal Kendall (US DOE PNNL VSP documentation)](https://vsp.pnnl.gov/help/vsample/Design_Trend_Seasonal_Kendall.htm)
11. [Claudia Libiseller, Anders Grimvall (2002). Performance of partial Mann–Kendall tests for trend detection in the presence of covariates. Environmetrics.](https://doi.org/10.1002/env.507)
12. [A modified Mann-Kendall trend test for autocorrelated data (Journal of Hydrology, 1998)](https://doi.org/10.1016/s0022-1694%2897%2900125-x)
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.](https://doi.org/10.1023/b:warm.0000043140.61082.60)
14. [Khaled H. Hamed (2007). Trend detection in hydrologic data: The Mann–Kendall trend test under the scaling hypothesis. Journal of Hydrology.](https://doi.org/10.1016/j.jhydrol.2007.11.009)
15. [Modified Mann-Kendall with higher-order statistics for trend analysis (Scientific Reports, 2025)](https://www.nature.com/articles/s41598-025-30034-0)
16. [Simulationsexperimente zur Wirkung serieller Korrelation auf den Mann-Kendall Trend test (Kulkarni & Von Storch, Meteorologische Zeitschrift, 1995)](https://www.hvonstorch.de/klima/pdf/kulkarni.1995.pdf)
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).](https://doi.org/10.2307/2983560)
18. [Bihrat Önöz, Mehmetcik Bayazit (2011). Block bootstrap for Mann–Kendall trend test of serially dependent data. Hydrological Processes.](https://doi.org/10.1002/hyp.8438)
19. [Kendall: Kendall Rank Correlation and Mann-Kendall Trend Test (R package documentation, McLeod, version 2.2.2)](https://cran.r-project.org/web/packages/Kendall/Kendall.pdf)
20. [pyMannKendall: a python package for non parametric Mann Kendall family of trend tests (JOSS, 2019)](https://www.theoj.org/joss-papers/joss.01556/10.21105.joss.01556.pdf)
21. [Running mannkendall (R), mannkendall (R) documentation](https://mannkendall.github.io/R/running.html)
22. [Running mannkendall (Python), mannkendall (Python) documentation](https://mannkendall.github.io/Python/running.html)
23. [Re-evaluation of the Power of the Mann-Kendall Test for Detecting Monotonic Trends in Hydrometeorological Time Series (Frontiers in Earth Science, 2020)](https://www.frontiersin.org/journals/earth-science/articles/10.3389/feart.2020.00014/full)
24. [On the Gaussian distribution of the Mann-Kendall tau in the case of autocorrelated data (PLOS One, 2025)](https://journals.plos.org/plosone/article?id=10.1371%2Fjournal.pone.0333224)
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)](https://www.sciencedirect.com/science/article/abs/pii/S0022169401005947)
26. [A. N. Pettitt (1979). A Non-Parametric Approach to the Change-Point Problem. Journal of the Royal Statistical Society Series C (Applied Statistics).](https://doi.org/10.2307/2346729)
27. [Temporal Change Analysis Based on Data Characteristics and Nonparametric Test (Water Resources Management, 2014)](https://ideas.repec.org/a/spr/waterr/v28y2014i1p227-240.html)
28. [The modified Mann-Kendall test: on the performance of three variance correction approaches (Blain; Bragantia)](https://www.redalyc.org/pdf/908/90829242014.pdf)

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

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

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/mann-kendall-test

English original: https://www.edgepedia.org/mann-kendall-test
