# 变点检测

变点检测包括用于识别数据序列的分布或参数发生变化的时间点的统计方法。方法分为在线程序和离线程序：在线程序在每次观测到达时即进行处理，以便快速发出警报；离线程序则回顾性地将完整序列分割为平稳的片段。<sup>[1](https://ar5iv.labs.arxiv.org/html/1801.00718)</sup>所针对的变化包括均值漂移、方差变化以及任意分布变化。输出取决于所用方法：经典序贯检测器返回单个报警时间，离线惩罚优化返回一个分割方案，贝叶斯在线方法返回关于游程长度（即距上次变化以来的时间）的完整后验分布。<sup>[2](https://doi.org/10.48550/arxiv.0710.3742)</sup>离线分割通常通过动态规划或贪心算法求解；在线检测则依赖CUSUM类统计量或贝叶斯滤波。<sup>[3](http://temporalbook.apartsin.com/part-2-classical-forecasting/module-08-anomaly-changepoint/section-8.3.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 两个分支 | 在线检测在数据到达时发出警报；离线检测回顾性地分割整个序列<sup>[1](https://ar5iv.labs.arxiv.org/html/1801.00718)</sup> |
| CUSUM | 由E. S. Page于1954年提出，基于已知变化前后分布之间的对数似然比<sup>[4](https://doi.org/10.1093/biomet/41.1-2.100)</sup> |
| 贝叶斯在线输出 | 递归消息传递算法给出当前游程长度的完整后验<sup>[2](https://doi.org/10.48550/arxiv.0710.3742)</sup> |
| 算法成本 | 二分分割是近似方法，复杂度为\( O(T \log T) \)；动态规划是精确方法，但复杂度为\( O(T^{2}) \)；PELT是精确方法，期望成本为\( O(n) \)<sup>[5](https://arxiv.org/pdf/1101.1438v3)</sup><sup> • </sup><sup>[6](https://doi.org/10.1214/14-aos1245)</sup> |
| 延迟界 | 期望检测延迟的尺度为\( \log \gamma \)除以变化前后密度之间的KL散度<sup>[7](https://par.nsf.gov/servlets/purl/10492374)</sup> |
| 惩罚项 | AIC每次变化使用\( \beta = 2p \)；BIC/SIC使用\( \beta = p \log n \)，其中p为新增参数个数<sup>[5](https://arxiv.org/pdf/1101.1438v3)</sup><sup> • </sup><sup>[3](http://temporalbook.apartsin.com/part-2-classical-forecasting/module-08-anomaly-changepoint/section-8.3.html)</sup> |

## 工作原理

累积和（CUSUM）检测器对每个新样本累加变化后分布相对于变化前分布的对数似然比，每当累积值将变为负数时即重置；当统计量越过阈值h时发出警报，参考值k通常设为值得检测的最小漂移量的一半。<sup>[3](http://temporalbook.apartsin.com/part-2-classical-forecasting/module-08-anomaly-changepoint/section-8.3.html)</sup>对于已知方差\( \sigma^{2} \)的高斯数据中位置\( \tau \)处的单次变化，似然比偏差（即两倍对数似然比）等于经方差重新缩放的CUSUM统计量的平方，\( 2\log\Lambda_{\tau} = C_{\tau}^{2}/\sigma^{2} \)，在无变化假设下服从自由度为1的卡方分布；当变化位置未知时，检验使用\( 2\log\Lambda_{\tau} \)在\( \tau \)上的最大值，等价于CUSUM统计量平方的最大值。<sup>[8](https://ar5iv.labs.arxiv.org/html/2210.07066)</sup>CUSUM统计量系统地比较每个候选变点左侧和右侧数据的均值。<sup>[9](https://www.lancaster.ac.uk/~romano/teaching/2425MATH337/MATH337--Changepoint-Detection.pdf)</sup>

Lorden（1971）证明了在平均游程长度至少为γ的程序中，最优期望检测延迟的量级为\( \log \gamma \)除以变化前后分布之间的Kullback–Leibler散度，Moustakides（1986）和Ritov（1990）证明了CUSUM在Lorden的最坏情况框架下是最优的。<sup>[10](https://wrap.warwick.ac.uk/id/eprint/189987/1/A%20note%20on%20online%20change%20point%20detection.pdf)</sup>经典界的表达式为\( \mathrm{EDD} = \log \gamma (1+o(1))/D(f_{1}\|f_{0}) \)，当\( \gamma \to \infty \)时成立。<sup>[7](https://par.nsf.gov/servlets/purl/10492374)</sup>在离线情形下，标准目标函数最小化各段成本之和加上每个变点的惩罚项；惩罚项过小会检测到噪声引起的变化，而惩罚项过大则只能检测到最显著的变化，甚至检测不到任何变化。<sup>[1](https://ar5iv.labs.arxiv.org/html/1801.00718)</sup>

## 实现方法

**离线搜索。** 二分分割在成本最小化点处检验是否存在分割并递归进行；它是近似方法，通常成本为\( O(T\log T) \)。<sup>[6](https://doi.org/10.1214/14-aos1245)</sup>最优分割是Jackson及其同事（2005）提出的动态规划算法，是精确方法，但计算量随数据长度呈二次增长。<sup>[11](https://doi.org/10.1109/lsp.2001.838216)</sup>PELT（剪枝精确线性时间）由Killick、Fearnhead和Eckley（2012）提出，<sup>[12](https://doi.org/10.1080/01621459.2012.737745)</sup>在最优分割的基础上增加了一个剪枝步骤，移除永远不可能成为最优解的候选点，而不影响精确性；其最坏情况成本为\( O(n^{2}) \)，当变点数量随n线性增长时，期望成本为\( O(n) \)。<sup>[5](https://arxiv.org/pdf/1101.1438v3)</sup><sup> • </sup><sup>[13](https://wrap.warwick.ac.uk/id/eprint/135155/7/WRAP-Univariate-mean-change-point-Yu-2020.pdf)</sup>FPOP和SNIP进一步扩展了剪枝；FPOP的剪枝总是多于PELT，并且比现有的动态规划方法快得多。<sup>[14](https://doi.org/10.1007/s11222-016-9636-3)</sup>changepoint R包实现了PELT及多种搜索方法。<sup>[15](https://doi.org/10.18637/jss.v058.i03)</sup>

惩罚项的选择控制检测到的变化数量。众所周知，AIC会高估真实变点数量，而BIC在位置无关的惩罚项中表现良好。<sup>[16](https://digitalcommons.unl.edu/cgi/viewcontent.cgi?params=/context/statisticsfacpub/article/1167/&path_info=Lund_JC_2023_Good_Practices_and_Common_Pitfalls.pdf)</sup>存在修正变体（mAIC、mBIC、MDL）；AIC和MDL倾向于高估，而mBIC2的惩罚项\( 3\log N \)倾向于低估。<sup>[17](https://www.mdpi.com/1099-4300/26/1/50)</sup>

**在线检测。** 序贯检测器的评判标准是平均游程长度（ARL），即变化前分布下的期望停止时间，以及期望检测延迟（EDD）；减小延迟必然提高误报概率。<sup>[7](https://par.nsf.gov/servlets/purl/10492374)</sup><sup> • </sup><sup>[3](http://temporalbook.apartsin.com/part-2-classical-forecasting/module-08-anomaly-changepoint/section-8.3.html)</sup>窗口限制广义似然比（GLR）检测器使用\( O(w) \)的存储和每时间单位至少\( O(w^{2}) \)的计算量，对于指数族可降至\( O(w) \)，并且当\( w \geq \log \gamma / D_{\min} \)时保持渐近最优。<sup>[7](https://par.nsf.gov/servlets/purl/10492374)</sup>FOCuS通过函数剪枝同时对所有窗口大小运行移动窗口检验，每次迭代的期望成本关于观测数量呈对数增长。<sup>[18](https://www.jmlr.org/papers/volume24/21-1230/21-1230.pdf)</sup>近期工作通过计算几何将精确在线似然比计算扩展到多元数据流，但当维度p超过5时精确算法不切实际。<sup>[19](https://academic.oup.com/jrsssb/article/88/1/171/8223216)</sup>贝叶斯在线变点检测通过消息传递计算游程长度后验；条件先验只将概率质量放在游程继续（\( r_{t} = r_{t-1}+1 \)）或重置为零上，通过对尾部游程长度质量进行剪枝，每步的平均成本与期望游程长度同阶。<sup>[2](https://doi.org/10.48550/arxiv.0710.3742)</sup>检验功效与数据点数量呈线性关系，但与变化幅度呈二次关系，因此检测幅度减半的变化大约需要四倍的数据量。<sup>[8](https://ar5iv.labs.arxiv.org/html/2210.07066)</sup>

## 起源

序贯监控始于W. A. Shewhart（1925）的控制图，它从每个样本计算统计量以维持制造质量。<sup>[20](https://doi.org/10.1080/01621459.1925.10502930)</sup>Abraham Wald关于序贯分析的工作（1946）开启了对在线检测的统计研究，<sup>[21](https://doi.org/10.1214/aoms/1177730889)</sup>E. S. Page于1954年提出了CUSUM程序，<sup>[4](https://doi.org/10.1093/biomet/41.1-2.100)</sup>并于1955年提出了参数在未知位置发生变化的检验。<sup>[22](https://doi.org/10.1093/biomet/42.3-4.523)</sup>A. F. M. Smith（1975）报告了一种关于随机变量序列中变点推断的贝叶斯方法。<sup>[23](https://doi.org/10.1093/biomet/62.2.407)</sup>贝叶斯在线变点检测由Ryan Prescott Adams和David J. C. MacKay于2007年报告。<sup>[2](https://doi.org/10.48550/arxiv.0710.3742)</sup>

## 变体

**分割方法。** 野二分分割（WBS）抽取随机子样本，对每个子样本计算CUSUM统计量，取各子样本中最大统计量所对应的位置作为第一个变点候选，与阈值比较后递归应用；对于非常短的间距和小跳跃，它保持一致性，而标准二分分割仅在相邻变点之间的最小间距超过\( T^{3/4} \)时才具有一致性。<sup>[6](https://doi.org/10.1214/14-aos1245)</sup>WBS2自适应地抽取少量子样本（其数值部分约100个）并产生完整的解路径。<sup>[24](https://stats.lse.ac.uk/fryzlewicz/wbs2/wbs2sdll.pdf)</sup>循环二分分割由A. B. Olshen及其同事于2004年报告，针对基于微阵列的DNA拷贝数数据，<sup>[25](https://doi.org/10.1093/biostatistics/kxh008)</sup>最窄过阈值方法是二分分割的进一步改进。<sup>[26](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-041124-044143)</sup>

**核方法、贝叶斯方法和无分布方法。** 核变点分析（KCpA）使用基于最大核Fisher判别比的检验统计量，并推导了零假设下的极限分布以确定有原则的阈值。<sup>[27](https://proceedings.neurips.cc/paper_files/paper/2008/file/08b255a5d42b89b0585260b6f2360bdd-Paper.pdf)</sup>F. Desobry、M. Davy和C. Doncarli（2005）的在线核变化检测算法（KCD）在窗口的左右两部分上各运行一个单类支持向量机。<sup>[28](https://doi.org/10.1109/tsp.2005.851098)</sup><sup> • </sup><sup>[27](https://proceedings.neurips.cc/paper_files/paper/2008/file/08b255a5d42b89b0585260b6f2360bdd-Paper.pdf)</sup>稳健贝叶斯衍生方法包括β-BOCD（基于广义贝叶斯推断与β散度）和Dm-BOCD（由Matias Altamirano、François-Xavier Briol和Jeremias Knoblauch于2023年报告），后者使用扩散得分匹配，成本为\( O(T(d^{2}+p^{2})) \)（配合Adams和MacKay的剪枝），在实验中比β-BOCD快10倍以上。<sup>[29](https://proceedings.mlr.press/v202/altamirano23a/altamirano23a.pdf)</sup>Birte Eichinger和Claudia Kirch（2017）的MOSUM程序通过移动和估计多个变点，<sup>[30](https://doi.org/10.3150/16-bej887)</sup>有R包实现，<sup>[31](https://doi.org/10.18637/jss.v097.i08)</sup>Andreas Anastasiou和Piotr Fryzlewicz（2021）的ID方法分离单个广义变点。<sup>[32](https://doi.org/10.1007/s00184-021-00821-6)</sup>ART通过对称函数将观测转换为得分，使得在零假设下得分是可交换的，从而提供无分布的有限样本第一类错误控制。<sup>[33](https://academic.oup.com/jrsssb/article/88/4/1278/8456337)</sup>在变化时间取几何先验的贝叶斯框架下，最优程序在变化已生效的后验概率越过阈值时发出警报。<sup>[34](https://www.ssp.ece.upatras.gr/moustakides/downloads/journals/seq2010_1.pdf)</sup>

## 应用

变点检测起源于工业质量控制，其目标是定位独立同分布高斯变量均值的漂移。<sup>[1](https://ar5iv.labs.arxiv.org/html/1801.00718)</sup>贝叶斯在线变点检测在测井数据（高斯均值变化）、道琼斯收益率（方差变化）和煤矿灾难间隔（泊松过程）上进行了演示。<sup>[2](https://doi.org/10.48550/arxiv.0710.3742)</sup>在基因组学中，FPOP用于拷贝数变异检测的成本与二分分割相当，同时给出更准确的分割。<sup>[14](https://doi.org/10.1007/s11222-016-9636-3)</sup>其他被引用的应用包括系统健康监测、金融数据、气候变化和网络安全，<sup>[29](https://proceedings.mlr.press/v202/altamirano23a/altamirano23a.pdf)</sup>以及在深度学习实现中的制造业、医疗保健、活动监测、金融和环境监测。<sup>[35](https://link.springer.com/article/10.1007/s42524-025-4109-z)</sup>Li、Fearnhead、Fryzlewicz和Wang（2024）在《Journal of the Royal Statistical Society Series B》上报告了通过深度学习进行自动变点检测，<sup>[36](https://doi.org/10.1093/jrsssb/qkae004)</sup>2026年的《Annual Review》（第13卷）重点介绍了变化平面子组识别、函数数据中的不连续性以及动态网络中的变点估计。<sup>[26](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-041124-044143)</sup>

## 局限与替代方法

所有变点方法都需要一个阈值，而阈值的选择对准确性的影响往往比方法的选择更重要。<sup>[37](https://onlinelibrary.wiley.com/doi/10.1002/sta4.291)</sup>默认阈值假设独立同分布高斯或次高斯噪声；重尾噪声或正自相关会导致变点数量被高估，而当独立同分布高斯假设不成立时，对一系列变点数量估计分割的方法更为可靠。<sup>[37](https://onlinelibrary.wiley.com/doi/10.1002/sta4.291)</sup>二分分割对检测短段的功效较低。<sup>[37](https://onlinelibrary.wiley.com/doi/10.1002/sta4.291)</sup>野二分分割对独立同分布误差会高估变点数量，并且在相关误差下失效；野对比最大化方法能处理序列相关性。<sup>[16](https://digitalcommons.unl.edu/cgi/viewcontent.cgi?params=/context/statisticsfacpub/article/1167/&path_info=Lund_JC_2023_Good_Practices_and_Common_Pitfalls.pdf)</sup>CUSUM要求变化前后分布均为参数化的且精确指定，这具有限制性，使其对模型误设不稳健。<sup>[7](https://par.nsf.gov/servlets/purl/10492374)</sup>Page的方法对于小于假设幅度一半的变化几乎无能为力，而且CUSUM统计量将变化后数据与所有先前数据平均，当变化发生在长游程的后期时会降低功效。<sup>[18](https://www.jmlr.org/papers/volume24/21-1230/21-1230.pdf)</sup>在相关的多变点情形下，没有单一方法占优；性能取决于具体场景。<sup>[38](https://ideas.repec.org/a/eee/csdana/v170y2022ics0167947322000135.html)</sup>动态规划方法通常假设序列不相关，这在气候应用中不现实。<sup>[16](https://digitalcommons.unl.edu/cgi/viewcontent.cgi?params=/context/statisticsfacpub/article/1167/&path_info=Lund_JC_2023_Good_Practices_and_Common_Pitfalls.pdf)</sup>对于回归情形，Jushan Bai和Pierre Perron（1998）开发了具有多个结构变化的线性模型的估计与检验方法。<sup>[39](https://doi.org/10.2307/2998540)</sup>

## References

1. [Selective review of offline change point detection methods](https://ar5iv.labs.arxiv.org/html/1801.00718)
2. [Adams, Ryan Prescott, MacKay, David J. C. (2007). Bayesian Online Changepoint Detection. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.0710.3742)
3. [Section 8.3: Change-Point Detection (offline and online) | Building Temporal AI](http://temporalbook.apartsin.com/part-2-classical-forecasting/module-08-anomaly-changepoint/section-8.3.html)
4. [E. S. PAGE (1954). CONTINUOUS INSPECTION SCHEMES. Biometrika.](https://doi.org/10.1093/biomet/41.1-2.100)
5. [Optimal detection of changepoints with a linear computational cost (PELT)](https://arxiv.org/pdf/1101.1438v3)
6. [Piotr Fryzlewicz (2014). Wild binary segmentation for multiple change-point detection. The Annals of Statistics.](https://doi.org/10.1214/14-aos1245)
7. [Sequential change-point detection: Computation versus statistical performance](https://par.nsf.gov/servlets/purl/10492374)
8. [Change-Point Detection and Data Segmentation (book chapter: Detecting a single change-point)](https://ar5iv.labs.arxiv.org/html/2210.07066)
9. [MATH337: Changepoint Detection (lecture notes)](https://www.lancaster.ac.uk/~romano/teaching/2425MATH337/MATH337--Changepoint-Detection.pdf)
10. [A note on online change point detection](https://wrap.warwick.ac.uk/id/eprint/189987/1/A%20note%20on%20online%20change%20point%20detection.pdf)
11. [B. Jackson and colleagues (2005). An algorithm for optimal partitioning of data on an interval. IEEE Signal Processing Letters.](https://doi.org/10.1109/lsp.2001.838216)
12. [R. Killick, P. Fearnhead, I. A. Eckley (2012). Optimal Detection of Changepoints With a Linear Computational Cost. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.2012.737745)
13. [Univariate mean change point detection: Penalization, CUSUM and optimality](https://wrap.warwick.ac.uk/id/eprint/135155/7/WRAP-Univariate-mean-change-point-Yu-2020.pdf)
14. [Robert Maidstone and colleagues (2016). On optimal multiple changepoint algorithms for large data. Statistics and Computing.](https://doi.org/10.1007/s11222-016-9636-3)
15. [Rebecca Killick, Idris A. Eckley (2014). changepoint : An R Package for Changepoint Analysis. Journal of Statistical Software.](https://doi.org/10.18637/jss.v058.i03)
16. [Good Practices and Common Pitfalls in Climate Time Series Changepoint Techniques: A Review (Lund et al., 2023)](https://digitalcommons.unl.edu/cgi/viewcontent.cgi?params=/context/statisticsfacpub/article/1167/&path_info=Lund_JC_2023_Good_Practices_and_Common_Pitfalls.pdf)
17. [A Selective Review on Information Criteria in Multiple Change Point Detection (Entropy, 2024)](https://www.mdpi.com/1099-4300/26/1/50)
18. [Fast Online Changepoint Detection via Functional Pruning CUSUM Statistics (FOCuS)](https://www.jmlr.org/papers/volume24/21-1230/21-1230.pdf)
19. [Online multivariate changepoint detection: leveraging links with computational geometry | JRSS-B](https://academic.oup.com/jrsssb/article/88/1/171/8223216)
20. [W. A. Shewhart (1925). The Application of Statistics as an Aid in Maintaining Quality of a Manufactured Product. Journal of the American Statistical Association.](https://doi.org/10.1080/01621459.1925.10502930)
21. [Abraham Wald (1946). Differentiation Under the Expectation Sign in the Fundamental Identity of Sequential Analysis. The Annals of Mathematical Statistics.](https://doi.org/10.1214/aoms/1177730889)
22. [E. S. PAGE (1955). A test for a change in a parameter occurring at an unknown point. Biometrika.](https://doi.org/10.1093/biomet/42.3-4.523)
23. [A. F. M. SMITH (1975). A Bayesian approach to inference about a change-point in a sequence of random variables. Biometrika.](https://doi.org/10.1093/biomet/62.2.407)
24. [Detecting possibly frequent change-points: Wild Binary Segmentation 2 and Steepest Drop to Low Levels](https://stats.lse.ac.uk/fryzlewicz/wbs2/wbs2sdll.pdf)
25. [A. B. Olshen and colleagues (2004). Circular binary segmentation for the analysis of array-based DNA copy number data. Biostatistics.](https://doi.org/10.1093/biostatistics/kxh008)
26. [Change-Point Detection and Its Modern Applications (Annual Review of Statistics)](https://www.annualreviews.org/content/journals/10.1146/annurev-statistics-041124-044143)
27. [Kernel Change-point Analysis (KCpA), NIPS 2008](https://proceedings.neurips.cc/paper_files/paper/2008/file/08b255a5d42b89b0585260b6f2360bdd-Paper.pdf)
28. [F. Desobry, M. Davy, C. Doncarli (2005). An online kernel change detection algorithm. IEEE Transactions on Signal Processing.](https://doi.org/10.1109/tsp.2005.851098)
29. [Robust and Scalable Bayesian Online Changepoint Detection (Dm-BOCD), ICML 2023](https://proceedings.mlr.press/v202/altamirano23a/altamirano23a.pdf)
30. [Birte Eichinger, Claudia Kirch (2017). A MOSUM procedure for the estimation of multiple random change points. Bernoulli.](https://doi.org/10.3150/16-bej887)
31. [Alexander Meier, Claudia Kirch, Haeran Cho (2021). mosum: A Package for Moving Sums in Change-Point Analysis. Journal of Statistical Software.](https://doi.org/10.18637/jss.v097.i08)
32. [Andreas Anastasiou, Piotr Fryzlewicz (2021). Detecting multiple generalized change-points by isolating single ones. Metrika.](https://doi.org/10.1007/s00184-021-00821-6)
33. [ART: distribution-free and model-agnostic changepoint detection with finite-sample guarantees | JRSS-B](https://academic.oup.com/jrsssb/article/88/4/1278/8456337)
34. [State-of-the-Art in Bayesian Changepoint Detection](https://www.ssp.ece.upatras.gr/moustakides/downloads/journals/seq2010_1.pdf)
35. [Change-point detection with deep learning: A review | Frontiers of Engineering Management](https://link.springer.com/article/10.1007/s42524-025-4109-z)
36. [Jie Li and colleagues (2024). Automatic change-point detection in time series via deep learning. Journal of the Royal Statistical Society Series B (Statistical Methodology).](https://doi.org/10.1093/jrsssb/qkae004)
37. [Relating and comparing methods for detecting changes in mean](https://onlinelibrary.wiley.com/doi/10.1002/sta4.291)
38. [A comparison of single and multiple changepoint techniques for time series data (Shi, Gallagher, Lund, Killick, 2022, Computational Statistics & Data Analysis)](https://ideas.repec.org/a/eee/csdana/v170y2022ics0167947322000135.html)
39. [Jushan Bai, Pierre Perron (1998). Estimating and Testing Linear Models with Multiple Structural Changes. Econometrica.](https://doi.org/10.2307/2998540)

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

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

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/change-point-detection

English original: https://www.edgepedia.org/change-point-detection
