# 半马尔可夫模型

半马尔可夫模型是一种多状态随机过程，其中下一次转移的概率取决于该过程在当前状态已经停留了多久。这种时钟重置依赖推广了马尔可夫模型：后者的无记忆停留时间在连续时间下被迫为指数分布，在离散时间下被迫为几何分布；半马尔可夫版本允许停留时间服从任意分布，同时所访问状态的序列仍为离散时间马尔可夫链。<sup>[1](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)</sup><sup> • </sup><sup>[2](https://web.stanford.edu/~glynn/papers/2004/GHaas04.pdf)</sup><sup> • </sup><sup>[3](https://cran.r-project.org/web/packages/SMM/vignettes/smm.pdf)</sup> 该框架用于事件史与生存数据、可靠性分析以及多状态疾病建模。

| 关键事实 | 细节 |
|---|---|
| 放宽之处 | 未来转移概率取决于在当前状态已停留的时间；每次转移后停留时钟重置为零，只有嵌入链必须是马尔可夫的<sup>[1](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)</sup> |
| 停留时间结构 | 在马尔可夫更新性质下，给定状态序列，相继状态中的停留时间相互独立，且每个停留时间分布可同时依赖于当前状态和下一状态<sup>[2](https://web.stanford.edu/~glynn/papers/2004/GHaas04.pdf)</sup> |
| 半马尔可夫核 | \( Q_{ij}(t) = P(i,j) F_{ij}(t) \)，即嵌入链转移概率乘以条件停留时间分布<sup>[4](http://www.utc.fr/~nlimnios/EORMS2009B.pdf)</sup> |
| 特例 | 连续时间马尔可夫链是其一种细化，其中停留时间服从指数分布<sup>[2](https://web.stanford.edu/~glynn/papers/2004/GHaas04.pdf)</sup> |
| 两种参数化 | 停留时间分布加嵌入链，或将似然拆分为两状态生存问题的强度转移函数<sup>[1](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)</sup> |
| 标准软件 | SemiMarkov R包通过最大似然拟合参数模型，停留时间可选指数、Weibull或指数化Weibull<sup>[5](https://www.jstatsoft.org/article/view/v066i06)</sup> |
| 主要失效模式 | 当删失时间支撑集的右端早于核支撑集的右端时，转移概率不可识别，已发表的估计量通常不一致<sup>[6](https://onlinelibrary.wiley.com/doi/10.1002/cjs.11176)</sup> |

## 工作原理

设 \( J_n \) 为第 \( n \) 次跳跃时所访问的状态，\( S_n \) 为跳跃时间。过程由马尔可夫更新性质驱动：给定当前状态 \( J_n = i \)，下一状态和停留长度与更早的历史独立。这些对由半马尔可夫核 \( Q_{ij}(t) := P(J_{n+1} = j,\, S_{n+1} - S_n \le t \mid J_n = i) \) 概括，其分解为 \( Q_{ij}(t) = P(i,j) F_{ij}(t) \)，其中 \( P \) 是嵌入链转移矩阵，\( F_{ij} \) 是条件停留时间分布。<sup>[4](http://www.utc.fr/~nlimnios/EORMS2009B.pdf)</sup> 排除自转移，因此 \( Q_{ii}(x) = 0 \)。<sup>[7](https://arxiv.org/html/2502.03479v1)</sup>

由该核可导出过程的转移强度（风险）：对于处于状态 \( h \) 并已停留至时间 \( t \) 的个体，在长度为 \( \Delta \) 的短区间内跳入状态 \( j \) 的条件概率近似等于强度乘以 \( \Delta \)，其中强度是该概率除以 \( \Delta \) 在 \( \Delta \) 趋于零时的极限。<sup>[8](https://cran.r-project.org/web/packages/SemiMarkov/SemiMarkov.pdf)</sup> 强度转移函数不应与停留分布的风险函数混淆；将它们对所有目标状态求和，得到当前状态等待时间的风险率。<sup>[1](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)</sup> 由拟合模型产生的量包括状态占据概率和转移概率，以及生存曲线和可靠性曲线。<sup>[4](http://www.utc.fr/~nlimnios/EORMS2009B.pdf)</sup>

## 实现方法

数据通常是右删失多状态观测，随访结束时并非每个个体都已到达吸收态。<sup>[1](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)</sup> 两种参数化相互竞争。方法I指定每个停留时间分布以及嵌入链转移矩阵。方法II指定强度转移函数；乘以无穷小时间得到瞬时转移概率，似然分解为各个两状态模型的似然，参数更少，便于高效计算并复用标准生存工具。<sup>[1](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)</sup>

在R中，SemiMarkov包通过最大似然实现方法I，停留分布可在指数、Weibull和指数化Weibull中选择（三者嵌套，因此形状参数为1的指数化Weibull退化为Weibull，形状参数为1的Weibull退化为指数）；转移、分布和协变量通过矩阵按转移逐一设定，对角线必须为FALSE，对数似然通过solnp调用叶荫宇（Yinyu Ye）求解器最大化。<sup>[5](https://www.jstatsoft.org/article/view/v066i06)</sup><sup> • </sup><sup>[8](https://cran.r-project.org/web/packages/SemiMarkov/SemiMarkov.pdf)</sup> flexsurv支持方法II，强度可选指数、Weibull、伽马、广义伽马和Royston-Parmar样条。<sup>[1](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)</sup> 较新的msmbayes包通过将相位型停留时间分布族与Weibull或伽马分布作矩匹配，对一般状态结构进行贝叶斯或最大似然估计，因此似然用隐马尔可夫模型前向算法计算。<sup>[9](https://arxiv.org/html/2508.20949v2)</sup> 非参数方面，Turnbull非参数最大似然估计（NPMLE）或惩罚似然方法在区间删失下给出一致推断，而中点插补通常有偏。<sup>[10](http://soche.cl/chjs/volumes/16/ChJS-16-02-02.pdf)</sup>

## 起源

半马尔可夫过程由保罗·莱维（Paul Lévy）和W. L. 史密斯（W. L. Smith）于1954年分别独立提出，史密斯关于再生随机过程的基础性工作于1955年发表在《皇家学会会刊A》（Proceedings of the Royal Society A）上。<sup>[11](https://doi.org/10.1098/rspa.1955.0198)</sup> 罗纳德·派克（Ronald Pyke）随后在两篇1961年发表于《数学统计年鉴》（Annals of Mathematical Statistics）的论文中形式化了该理论，文中给出马尔可夫更新过程和半马尔可夫过程的定义，描述二者之间的密切关系，并处理有限状态情形。<sup>[12](https://doi.org/10.1214/aoms/1177704863)</sup><sup> • </sup><sup>[13](https://doi.org/10.1214/aoms/1177704864)</sup> 估计方法分阶段发展：有限核的经验估计量；拉加科斯（Lagakos）、索默（Sommer）和泽伦（Zelen）（1978）针对右删失下非遍历有限核的最大似然，其得分方程通过代入卡普兰-迈耶（Kaplan-Meier）和吉尔（Gill）（1980）估计量求解；以及针对右删失马尔可夫更新模型的基于鞅的计数过程方法。<sup>[4](http://www.utc.fr/~nlimnios/EORMS2009B.pdf)</sup><sup> • </sup><sup>[14](https://doi.org/10.1093/biomet/65.2.311)</sup><sup> • </sup><sup>[15](http://www.biomedicale.univ-paris5.fr/catherine.huber/huber/zelen_5mai04_sansi.pdf)</sup><sup> • </sup><sup>[7](https://arxiv.org/html/2502.03479v1)</sup> 萨滕（Satten）与斯滕伯格（Sternberg）（1999）将拟合扩展到起始时间未知的区间删失数据。<sup>[16](https://doi.org/10.1111/j.0006-341x.1999.00507.x)</sup> 随后出现了半马尔可夫过程的半参数Cox型回归扩展。<sup>[7](https://arxiv.org/html/2502.03479v1)</sup>

## 变体

**马尔可夫更新过程**是相伴的形式化，其中状态与跳跃时间的对 \( (J_n, S_n) \) 是主要对象；在离散时间下，核分解为 \( q_{ij}(k) = p_{ij} f_{ij}(k) \)。<sup>[12](https://doi.org/10.1214/aoms/1177704863)</sup><sup> • </sup><sup>[3](https://cran.r-project.org/web/packages/SMM/vignettes/smm.pdf)</sup> **停留分布**可以是参数化的（Weibull和广义Weibull形式在生物医学工作中常见），也可以是非参数化的。<sup>[17](https://doi.org/10.1002/bimj.200410170)</sup> **疾病-死亡模型**是一种三状态半马尔可夫过程，广泛用于生物医学，例如艾滋病等慢性病的风险取决于感染后时间。<sup>[1](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)</sup>

**隐半马尔可夫模型（HSMM）**将一个未观测的半马尔可夫链与依赖于它的观测过程配对，仅根据观测以最大似然估计。<sup>[4](http://www.utc.fr/~nlimnios/EORMS2009B.pdf)</sup> 用于语音识别的显式时长隐马尔可夫模型在20世纪80年代中期确立，莱文森（Levinson）的连续可变时长隐马尔可夫模型是其中一种表述。<sup>[18](https://doi.org/10.1016/s0885-2308%2886%2980009-2)</sup> 约翰逊（Johnson）与威尔斯基（Willsky）的显式时长分层狄利克雷过程HSMM（HDP-HSMM）将显式时长建模与贝叶斯非参数推断及模块化Gibbs抽样结合起来。<sup>[19](https://doi.org/10.48550/arxiv.1203.1365)</sup><sup> • </sup><sup>[20](https://www.jmlr.org/papers/volume14/johnson13a/johnson13a.pdf)</sup> 半马尔可夫模型也可表示为隐马尔可夫模型：将停留时间表示为有限状态连续时间马尔可夫链中的吸收时间，该链具有瞬态潜在相位和一个吸收态，即相位型方法。<sup>[9](https://arxiv.org/html/2508.20949v2)</sup><sup> • </sup><sup>[26](https://doi.org/10.1007/s10687-022-00436-8)</sup>

## 应用

在生存分析和临床试验中，半马尔可夫过程取代马尔可夫模型，后者的恒定转移率迫使连续时间下状态占据时间为指数分布、离散时间下为几何分布。<sup>[21](https://www.cambridge.org/core/journals/journal-of-applied-probability/article/abs/semimarkov-model-for-clinical-trials/712B2BE767F04E6DA626D4932FC4A5AB)</sup> 在可靠性与可信性中，系统可靠性定义为过程在 \( [0,t] \) 内始终处于正常状态集合中的概率，并给出该指标及相关指标的估计量。<sup>[4](http://www.utc.fr/~nlimnios/EORMS2009B.pdf)</sup> 在健康经济学和流行病学中，半马尔可夫模型使疾病风险直接取决于处于前驱疾病状态的时间，例如肝硬化失代偿风险；马尔可夫队列模型若不引入隐藏状态便无法表达这一点，而隐藏状态又会因不可识别性（模型参数能否由数据唯一确定）而有过拟合风险；一个2025年的框架将此类模型计算为停留时间密度的偏微分方程组，改编自精算Kolmogorov前向方程方法，并避免蒙特卡洛抽样。<sup>[22](https://bishtref.com/articles/10.1177/0272989x251333398)</sup> 精算应用包括残疾保险和人寿保险现金流计算。<sup>[23](https://ar5iv.labs.arxiv.org/html/1504.02955)</sup> 生物医学示例包括HIV疾病的广义Weibull模型<sup>[17](https://doi.org/10.1002/bimj.200410170)</sup>，以及肾移植受者多终末事件的区间删失模型。<sup>[24](https://onlinelibrary.wiley.com/doi/10.1002/sim.3100)</sup>

## 局限与替代方案

**删失下的可识别性。** 当删失时间支撑集的右端点严格小于半马尔可夫核支撑集的右端点时，转移概率不可识别，文献中的估计量通常不一致；常规置信带构造也失效，需要扰动重抽样方法。<sup>[6](https://onlinelibrary.wiley.com/doi/10.1002/cjs.11176)</sup> 在竞争风险情形下，只有子分布函数可识别，潜在停留时间的联合分布不可识别。<sup>[15](http://www.biomedicale.univ-paris5.fr/catherine.huber/huber/zelen_5mai04_sansi.pdf)</sup>

**区间删失与未知进入时间。** 在慢性病随访中，转移时间通常只知道落在某个区间内。<sup>[24](https://onlinelibrary.wiley.com/doi/10.1002/sim.3100)</sup> 由于转移率取决于进入当前状态后的时间，而在间歇观测的面板数据中该进入时间未知，可识别性是核心问题；现有方法还面临计算成本、软件不可用或额外参数导致识别力弱等问题。<sup>[9](https://arxiv.org/html/2508.20949v2)</sup> 相位型类还假设下一状态概率与停留时间独立，且进入初始状态的时间已知。<sup>[9](https://arxiv.org/html/2508.20949v2)</sup> 稀疏数据单元格可能导致不收敛，且尚无广泛接受的拟合优度检验。<sup>[25](https://pmc.ncbi.nlm.nih.gov/articles/PMC4013002/)</sup>

**与替代方案的比较。** 连续时间马尔可夫链是半马尔可夫过程的指数停留时间细化，而广义半马尔可夫过程通过为每个状态附加竞争事件对其扩展。<sup>[2](https://web.stanford.edu/~glynn/papers/2004/GHaas04.pdf)</sup> 在EBMT骨髓移植示例中，马尔可夫模型在吸收态中累积概率更快，因为它忽略在瞬态中花费的时间，而半马尔可夫模型的停留时间延迟了转移；Aalen-Johansen估计量给出更尖锐的曲线，半参数半马尔可夫估计量给出更平滑的曲线。<sup>[7](https://arxiv.org/html/2502.03479v1)</sup> 在路径依赖下，标准Aalen-Johansen估计量在标志时间之后以及信息性删失下给出有偏的条件转移概率。<sup>[10](http://soche.cl/chjs/volumes/16/ChJS-16-02-02.pdf)</sup> 与隐马尔可夫模型相比，经典HMM将持续时间限制为几何形式，非马尔可夫数据可能迫使引入不必要的额外状态和不切实际的快速切换。<sup>[20](https://www.jmlr.org/papers/volume14/johnson13a/johnson13a.pdf)</sup>

## References

1. [Estimation of semi-Markov multi-state models: a comparison of the sojourn times and transition intensities approaches (International Journal of Biostatistics)](https://www.degruyterbrill.com/document/doi/10.1515/ijb-2020-0083/html)
2. [Functional central limit theorems for CTMCs, SMPs and GSMPs (Haas & Glynn)](https://web.stanford.edu/~glynn/papers/2004/GHaas04.pdf)
3. [SMM: An R package for estimation and simulation of discrete-time semi-Markov models (vignette)](https://cran.r-project.org/web/packages/SMM/vignettes/smm.pdf)
4. [Semi-Markov Processes: Applications in Reliability and Dependability (Limnios, Wiley Encyclopedia of OR/MS)](http://www.utc.fr/~nlimnios/EORMS2009B.pdf)
5. [SemiMarkov: An R Package for Parametric Estimation in Multi-State Semi-Markov Models (Król & Saint-Pierre, JSS 2015)](https://www.jstatsoft.org/article/view/v066i06)
6. [Estimation with right-censored observations under a semi-Markov model (The Canadian Journal of Statistics, 2013)](https://onlinelibrary.wiley.com/doi/10.1002/cjs.11176)
7. [A Tutorial on Markov Renewal and Semi-Markov Proportional Hazards Model (arXiv, 2025)](https://arxiv.org/html/2502.03479v1)
8. [SemiMarkov: Multi-States Semi-Markov Models (CRAN documentation, v1.4.6)](https://cran.r-project.org/web/packages/SemiMarkov/SemiMarkov.pdf)
9. [Stable and practical semi-Markov modelling of intermittently-observed data (msmbayes; Jackson, 2025)](https://arxiv.org/html/2508.20949v2)
10. [Review of non-Markov multi-state survival estimation (Chilean Journal of Statistics)](http://soche.cl/chjs/volumes/16/ChJS-16-02-02.pdf)
11. [W. L. Smith (1955). Regenerative stochastic processes. Proceedings of the Royal Society of London A Mathematical and Physical Sciences.](https://doi.org/10.1098/rspa.1955.0198)
12. [Ronald Pyke (1961). Markov Renewal Processes: Definitions and Preliminary Properties. The Annals of Mathematical Statistics.](https://doi.org/10.1214/aoms/1177704863)
13. [Ronald Pyke (1961). Markov Renewal Processes with Finitely Many States. The Annals of Mathematical Statistics.](https://doi.org/10.1214/aoms/1177704864)
14. [S. W. LAGAKOS, C. J. SOMMER, M. ZELEN (1978). Semi-Markov models for partially censored data. Biometrika.](https://doi.org/10.1093/biomet/65.2.311)
15. [Inference for a general semi-Markov model and a sub-model (Huber-Carol et al.)](http://www.biomedicale.univ-paris5.fr/catherine.huber/huber/zelen_5mai04_sansi.pdf)
16. [Glen A. Satten, Maya R. Sternberg (1999). Fitting Semi‐Markov Models to Interval‐Censored Data with Unknown Initiation Times. Biometrics.](https://doi.org/10.1111/j.0006-341x.1999.00507.x)
17. [Yohann Foucher and colleagues (2005). A Semi-Markov Model Based on Generalized Weibull Distribution with an Illustration for HIV Disease. Biometrical Journal.](https://doi.org/10.1002/bimj.200410170)
18. [Continuously variable duration hidden Markov models for automatic speech recognition (Computer Speech & Language, 1986)](https://doi.org/10.1016/s0885-2308%2886%2980009-2)
19. [Johnson, Matthew J., Willsky, Alan S. (2012). Bayesian Nonparametric Hidden Semi-Markov Models. arXiv (Cornell University).](https://doi.org/10.48550/arxiv.1203.1365)
20. [Bayesian Nonparametric Hidden Semi-Markov Models (Johnson & Willsky, JMLR 2013)](https://www.jmlr.org/papers/volume14/johnson13a/johnson13a.pdf)
21. [A semi-Markov model for clinical trials (Journal of Applied Probability)](https://www.cambridge.org/core/journals/journal-of-applied-probability/article/abs/semimarkov-model-for-clinical-trials/712B2BE767F04E6DA626D4932FC4A5AB)
22. [Evaluating Semi-Markov Processes and Other Epidemiological Time-to-Event Models by Computing Disease Sojourn Density as Partial Differential Equations (Medical Decision Making, 2025)](https://bishtref.com/articles/10.1177/0272989x251333398)
23. [Revisiting the forward equations for inhomogeneous semi-Markov processes (arXiv)](https://ar5iv.labs.arxiv.org/html/1504.02955)
24. [A semi-Markov model for multistate and interval-censored data with multiple terminal events. Application in renal transplantation (Foucher et al., Statistics in Medicine 2007)](https://onlinelibrary.wiley.com/doi/10.1002/sim.3100)
25. [Markov chains and semi-Markov models in time-to-event analysis (editorial, PMC)](https://pmc.ncbi.nlm.nih.gov/articles/PMC4013002/)
26. [Client Challenge](https://doi.org/10.1007/s10687-022-00436-8)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Oct 15, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Stochastic processes › Markov chains and processes

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/semi-markov-model

English original: https://www.edgepedia.org/semi-markov-model
