# 趋势估计

趋势估计是一组统计方法，用于检测和建模时间序列的长期方向或模式，将该信号与短期噪声以及季节性、周期性变化分离开来。根据方法的不同，它产生拟合曲线或斜率、单调变化的显著性检验，或将序列分解为趋势、季节和剩余成分。

| 关键事实 | 详情 |
|---|---|
| 产出什么 | 拟合的趋势曲线或斜率、单调趋势的假设检验，或如 \( y_{t} = T_{t} + S_{t} + I_{t} \) 的分解，将序列分为趋势、季节和不规则部分 <sup>[1](https://www.mathworks.com/help/econ/parametric-trend-estimation.html)</sup> |
| 两种趋势类型 | 确定性趋势通过去趋势处理；随机性（单位根）趋势通过差分处理，用错方法会使估计产生偏差 <sup>[2](https://pure.uva.nl/ws/files/306761281/Non-Stationarity_in_Time-Series_Analysis.pdf)</sup> |
| 主力检验 | Mann–Kendall 检验配合 Sen 斜率是大气和水文研究中应用最广泛的非参数趋势分析方法 <sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup> |
| 主要陷阱 | 正自相关会增加趋势检验的第一类错误；预白化以增加第二类错误为代价来减少第一类错误 <sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup> |
| 样本要求 | 所需样本长度还取决于显著性水平和趋势幅度，而不仅仅是方差；一项研究发现，在目标功效为 0.9 时，Mann–Kendall 检验在样本方差约为 0.08 时需要约 50 个观测值，而在样本方差为 1.7 时需要约 400 个，这些结果是在该研究的条件下得出的 <sup>[4](https://www.frontiersin.org/journals/earth-science/articles/10.3389/feart.2020.00014/full)</sup> |
| 标准分解 | STL 使用 loess 平滑分解序列，可处理任意季节性，并可设置为对异常值具有稳健性 <sup>[5](https://otexts.com/fpp3/stl.html)</sup> |

## 工作原理

大多数参数化处理从加性分解出发，\( y_{t} = T_{t} + S_{t} + I_{t} \)，其中 \( T_{t} \) 是确定性的、非季节性的长期趋势（通常为线性，也可用更高次多项式），\( S_{t} \) 是具有已知周期性的确定性季节成分，\( I_{t} \) 是可能表现出自相关和不可预测持续时间的周期的随机不规则成分。这种形式适用于无指数增长且季节振幅恒定的序列；给定趋势和季节估计后，不规则成分为 \( I_{t} = y_{t} - T_{t} - S_{t} \)，去趋势后的序列为 \( y_{t} - T_{t} \)。<sup>[1](https://www.mathworks.com/help/econ/parametric-trend-estimation.html)</sup>

确定性趋势与随机性趋势的区分决定了方法的选择。去趋势适用于确定性趋势，而差分适用于随机性趋势；对随机性趋势去趋势或对确定性趋势差分都会导致参数估计有偏。<sup>[2](https://pure.uva.nl/ws/files/306761281/Non-Stationarity_in_Time-Series_Analysis.pdf)</sup> 对带漂移的随机游走去趋势后，残差的方差随 \( t \cdot \sigma^{2} \) 增长，违反弱平稳性并使自回归估计产生偏差。<sup>[2](https://pure.uva.nl/ws/files/306761281/Non-Stationarity_in_Time-Series_Analysis.pdf)</sup> 去趋势方法预设两种过程之一：具有恒定变化率的确定性过程，或具有随机变化率的差分平稳过程。<sup>[6](https://journals.sagepub.com/doi/10.1177/0049124194022004003)</sup> 一个实际问题是，结构突变会使增广 Dickey–Fuller 回归估计量偏向 1，因此即使序列在确定性突变周围是平稳的，检验也会指示存在单位根，Phillips–Perron 类方法也有同样的问题。<sup>[7](https://www.statistik.uni-hannover.de/fileadmin/statistik/Publikationen/Unit_roots__structural_breaks__and_non-linearities.pdf)</sup>

## 如何操作

经典实践基于两种程序：对整个序列拟合选定次数的多项式，几乎总是通过最小二乘法；或使用选定范围和权重的移动平均来确定趋势值。<sup>[8](https://academic.oup.com/jrsssa/article-pdf/104/1/43/49709961/jrsssa_104_1_43.pdf)</sup> 移动平均平滑器用 \( t \) 时刻周围观测值的平均值来表示该时刻的均值，等权重给出简单移动平均，不等权重给出加权移动平均。<sup>[9](https://people.stat.sc.edu/hitchcock/stat520ch3slides.pdf)</sup>

对于显著性检验，Mann–Kendall 检验检验独立同分布实现的零假设与单调趋势的对立假设。<sup>[10](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)</sup> 其统计量 \( S \) 在观测值超过 10 个时服从正态分布，显著性通过将 \( Z = S/[\mathrm{var}(S)]^{0.5} \) 与标准正态变量比较来判断；对于 10 个或更少的观测值，需要 \( S \) 的精确分布。<sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup> 配套使用的 Sen 方法将斜率估计为成对线性斜率的中位数，常见的截距估计是将估计斜率 \( b \) 代入后所得各值 \( y_{i} - b \cdot x_{i} \) 的中位数 <sup>[10](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)</sup>；Theil–Sen 斜率估计是所有点对之间斜率的中位数，该集合大约以 \( n^{2} \) 增长。<sup>[11](https://openair-project.github.io/book/sections/trend-analysis/theil-sen.html)</sup> 其他选项包括斜率的参数化 t 检验以及非参数化的 Mann–Whitney 和 Spearman 检验。<sup>[12](https://math.umd.edu/~slud/s730/Alexandrov12.pdf)</sup>

对于分解，STL（使用 Loess 的季节与趋势分解）通过嵌套在外循环中的内循环应用一系列 loess 平滑器，每次内循环更新季节和趋势成分一次。<sup>[13](https://wessa.net/download/stl.pdf)</sup> 在 R 的实现中，季节成分来自对季节子序列的 loess 平滑，去除季节值后对剩余部分平滑以找到趋势，过程迭代进行；剩余部分是季节加趋势拟合的残差。<sup>[14](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/stl.html)</sup> 两个主要参数——趋势-周期窗口和季节窗口——应为奇数，较小的值允许更快速的变化。<sup>[5](https://otexts.com/fpp3/stl.html)</sup>

## 起源

月度水质数据的季节性 Kendall 检验由罗伯特·M·赫希、詹姆斯·R·斯莱克和理查德·A·史密斯于 1982 年在《水资源研究》上提出。<sup>[15](https://doi.org/10.1029/wr018i001p00107)</sup> 在分解算法中，RobustSTL 由温庆松及其同事于 2018 年报告 <sup>[16](https://doi.org/10.48550/arxiv.1812.01767)</sup>，MSTL 由卡松·班达拉、罗布·J·海因德曼和克里斯托夫·贝格迈尔于 2021 年提出 <sup>[17](https://doi.org/10.48550/arxiv.2107.13462)</sup>，OnlineSTL 由阿比纳夫·米什拉、拉姆·斯里哈沙和钟思辰于 2022 年在《VLDB 基金会会刊》上提出 <sup>[18](https://doi.org/10.14778/3523210.3523219)</sup>，STR 由亚历山大·多库缅托夫和罗布·J·海因德曼于 2022 年提出。<sup>[19](https://doi.org/10.26180/21521289)</sup> BASTION，一个贝叶斯分解框架，由杰森·B·曹和大卫·S·马特森在 PMLR 第 300 卷上发表。<sup>[20](https://raw.githubusercontent.com/mlresearch/v300/main/assets/cho26a/cho26a.pdf)</sup>

## 变体

STL 本身可处理任意类型的季节性，不仅限于月度或季度数据，允许用户控制季节成分的变化速度，并提供稳健选项使偶发的异常观测不致扭曲估计；其缺点是不能自动处理交易日或日历变化，且仅提供加性分解。<sup>[5](https://otexts.com/fpp3/stl.html)</sup> MSTL 通过迭代应用 STL 程序来估计多个季节成分，控制每个季节周期的平滑度，对于非季节序列仅返回趋势和剩余部分；它在 R 的 forecast 包中实现为 `mstl` 函数，在较低计算成本下显示出与其他分解基准相比有竞争力的精度。<sup>[17](https://doi.org/10.48550/arxiv.2107.13462)</sup> STR 通过惩罚回归对季节和趋势成分建模，平滑参数建议通过留一交叉验证来估计。<sup>[19](https://doi.org/10.26180/21521289)</sup> BASTION 处理异常值和异方差性，其作者指出包括 STL、MSTL、STR 和 RobustSTL 在内的现有方法均未明确建模这些特征，而 RobustSTL 和 MSTL 不提供不确定性量化。<sup>[20](https://raw.githubusercontent.com/mlresearch/v300/main/assets/cho26a/cho26a.pdf)</sup> 用于局部-季节-全局趋势（LGT/SGT）贝叶斯指数平滑模型的快速 Gibbs 采样，使用马蹄形收缩先验，达到了可接受的时间复杂度和其作者描述为在许多预测任务中最先进的精度。<sup>[21](https://link.springer.com/article/10.1007/s11222-025-10603-z)</sup>

## 应用

在水文和水质领域，美国地质调查局的 ESTREND 系统对未删失数据或单一报告限删失数据应用季节性 Kendall 检验，对多个报告限删失数据使用最大似然参数检验；季节性 Kendall 检验还允许去除流量变异性，从而提高检验性能。<sup>[22](https://pubs.usgs.gov/wri/wri91-4040/)</sup> 在海表温度气候学中，基于 STL 的分解将长期趋势、季节变化和剩余部分分离，被认为在趋势提取方面优于线性回归但计算缓慢，且由于 STL 捕捉非线性趋势而许多应用需要线性趋势，海表温度趋势的回归方法已被系统地重新评估。<sup>[23](https://nhess.copernicus.org/articles/24/2481/2024/nhess-24-2481-2024.html)</sup> 更广泛地，分解方法支持季节调整、预测和异常检测。<sup>[17](https://doi.org/10.48550/arxiv.2107.13462)</sup> 2024 年联邦储备委员会的一份工作论文提出了一种在线贝叶斯多变量不可观测成分趋势-周期分解与预测方法，其构造方式避免了修正数据带来的前视问题。<sup>[24](https://www.federalreserve.gov/econres/feds/files/2024100pap.pdf)</sup>

## 局限与替代方案

自相关是核心的失效模式。正自相关显著增加 Mann–Kendall 检验的第一类错误，而预白化程序增加第二类错误，较大的滞后 1 自相关既产生更多第一类错误，也使 Sen 斜率偏差更大。<sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup> 存在两种校正策略：对数据预白化以去除自相关，以及膨胀检验统计量的方差以反映独立测量的数量而非数据点的数量。<sup>[3](https://amt.copernicus.org/articles/13/6945/2020/)</sup> 软件实现并不总是应用这些校正；例如，wql 包中的季节性 Kendall p 值未对季节间的序列相关进行校正。<sup>[25](https://jsta.github.io/wql/reference/seaKen.html)</sup>

功效取决于信号和样本。Mann–Kendall 功效随趋势斜率和样本量增加而增加，随样本方差增加而下降 <sup>[4](https://www.frontiersin.org/journals/earth-science/articles/10.3389/feart.2020.00014/full)</sup>，这一模式在 Mann–Kendall 和 Spearman's rho 检验中均得到确认。<sup>[26](https://www.sciencedirect.com/science/article/abs/pii/S0022169401005947)</sup> 另一个风险是 S 型错误，即估计出显著趋势但符号与真实趋势相反，在趋势检测中常用的样本量下其概率超过 19%。<sup>[27](https://www.ovid.com/journals/jfrm/fulltext/10.1111/jfr3.12957~assessing-the-performance-of-parametric-and-nonparametric)</sup> 在 GPD 分布记录的蒙特卡洛比较中，Sen 斜率在估计趋势幅度方面优于 OLS，非参数检验被推荐用于大正形状参数而 OLS 在小或负形状参数下表现更好，非平稳 GPD 拟合的拒绝率几乎是 Spearman's rho、Mann–Kendall、Sen 和 OLS 的三倍。<sup>[27](https://www.ovid.com/journals/jfrm/fulltext/10.1111/jfr3.12957~assessing-the-performance-of-parametric-and-nonparametric)</sup>

2024 年的一项分析表明，经典 Mann–Kendall 检验在依赖条件下即使在大样本中也不提供第一类错误控制，因为正自相关增加趋势的虚假检测而负自相关使趋势更难检测，并提出了学生化置换检验和局部 Mann–Kendall 统计量用于局部而非全局趋势。<sup>[28](https://arxiv.org/html/2404.06239)</sup><sup> • </sup><sup>[29](https://www.utsc.utoronto.ca/~butler/climate-lab/mann-kendall-correlated.pdf)</sup>

## References

1. [Decompose Time Series Into Additive Trend Components, MATLAB & Simulink](https://www.mathworks.com/help/econ/parametric-trend-estimation.html)
2. [Non-Stationarity in Time-Series Analysis: Modeling Stochastic and Deterministic Trends](https://pure.uva.nl/ws/files/306761281/Non-Stationarity_in_Time-Series_Analysis.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](https://amt.copernicus.org/articles/13/6945/2020/)
4. [Re-evaluation of the Power of the Mann-Kendall Test for Detecting Monotonic Trends in Hydrometeorological Time Series](https://www.frontiersin.org/journals/earth-science/articles/10.3389/feart.2020.00014/full)
5. [3.6 STL decomposition, Forecasting: Principles and Practice (3rd ed.)](https://otexts.com/fpp3/stl.html)
6. [Detrending Time Series: A Cautionary Note (Sociological Methods & Research)](https://journals.sagepub.com/doi/10.1177/0049124194022004003)
7. [Unit roots, structural breaks and non-linearities (Haldrup, Kruse, Teräsvirta, Varneskov)](https://www.statistik.uni-hannover.de/fileadmin/statistik/Publikationen/Unit_roots__structural_breaks__and_non-linearities.pdf)
8. [The Effect of the Elimination of Trend on Oscillations in Time-Series (JRSS Series A)](https://academic.oup.com/jrsssa/article-pdf/104/1/43/49709961/jrsssa_104_1_43.pdf)
9. [Chapter 3: Regression Methods for Trends (STAT 520 course notes, Univ. of South Carolina)](https://people.stat.sc.edu/hitchcock/stat520ch3slides.pdf)
10. [Non-Parametric Trend Tests and Change-Point Detection for N Observations (trend R package vignette)](https://stat.ethz.ch/CRAN/web/packages/trend/vignettes/trend.pdf)
11. [Theil-Sen trends – The openair book](https://openair-project.github.io/book/sections/trend-analysis/theil-sen.html)
12. [A Review of Some Modern Approaches to the Problem of Trend Extraction](https://math.umd.edu/~slud/s730/Alexandrov12.pdf)
13. [STL: A Seasonal-Trend Decomposition Procedure Based on Loess (Cleveland, Cleveland, McRae & Terpenning)](https://wessa.net/download/stl.pdf)
14. [R: Seasonal Decomposition of Time Series by Loess (stl)](https://stat.ethz.ch/R-manual/R-devel/library/stats/html/stl.html)
15. [Robert M. Hirsch, James R. Slack, Richard A. Smith (1982). Techniques of trend analysis for monthly water quality data. Water Resources Research.](https://doi.org/10.1029/wr018i001p00107)
16. [Wen, Qingsong and colleagues (2018). RobustSTL: A Robust Seasonal-Trend Decomposition Algorithm for Long Time Series. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1812.01767)
17. [Bandara, Kasun, Hyndman, Rob J, Bergmeir, Christoph (2021). MSTL: A Seasonal-Trend Decomposition Algorithm for Time Series with Multiple Seasonal Patterns. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.2107.13462)
18. [Abhinav Mishra, Ram Sriharsha, Sichen Zhong (2022). OnlineSTL. Proceedings of the VLDB Endowment.](https://doi.org/10.14778/3523210.3523219)
19. [Dokumentov, Alexander, Hyndman, Rob J. (2022). STR: A Seasonal-Trend Decomposition Procedure Based on Regression. RePEc: Research Papers in Economics.](https://doi.org/10.26180/21521289)
20. [BASTION: A Bayesian Framework for Trend and Seasonality Decomposition (PMLR v300, 2026)](https://raw.githubusercontent.com/mlresearch/v300/main/assets/cho26a/cho26a.pdf)
21. [Fast Gibbs sampling for the local-seasonal-global trend Bayesian exponential smoothing model (Statistics and Computing, 2025)](https://link.springer.com/article/10.1007/s11222-025-10603-z)
22. [THE COMPUTER PROGRAM ESTIMATE TREND (ESTREND), A SYSTEM FOR THE DETECTION OF TRENDS IN WATER-QUALITY DATA](https://pubs.usgs.gov/wri/wri91-4040/)
23. [Revisiting regression methods for estimating long-term trends in sea surface temperature](https://nhess.copernicus.org/articles/24/2481/2024/nhess-24-2481-2024.html)
24. [Trend-Cycle Decomposition and Forecasting Using Bayesian Multivariate Unobserved Components (FEDS paper 2024-100)](https://www.federalreserve.gov/econres/feds/files/2024100pap.pdf)
25. [Seasonal and Regional Kendall trend test, seaKen • wql](https://jsta.github.io/wql/reference/seaKen.html)
26. [Power of the Mann–Kendall and Spearman's rho tests for detecting monotonic trends in hydrological series](https://www.sciencedirect.com/science/article/abs/pii/S0022169401005947)
27. [Assessing the performance of parametric and nonparametric approaches to trend detection in POT records (Journal of Flood Risk Management)](https://www.ovid.com/journals/jfrm/fulltext/10.1111/jfr3.12957~assessing-the-performance-of-parametric-and-nonparametric)
28. [Permutation Testing for Monotone Trend](https://arxiv.org/html/2404.06239)
29. [Mann Kendall Correlated.pdf, utsc.utoronto.ca](https://www.utsc.utoronto.ca/~butler/climate-lab/mann-kendall-correlated.pdf)

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

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/trend-estimation

English original: https://www.edgepedia.org/trend-estimation
