马尔可夫链与平稳分布Markov Chains & Stationary Distributions
状态按转移规则变化时,平稳分布与实际分布收敛有什么区别?How do stationary distributions differ from convergence of evolving state distributions?
前置知识:Prerequisites: B05:矩阵;B13:条件概率;B16:期望。B05: matrices; B13: conditional probability; B16: expectation.
复习前置:Review prerequisites: B05 · 矩阵与批量计算Matrices & Batch Computation · B13 · 条件概率Conditional Probability · B16 · 期望、方差与样本统计Expectation, Variance & Sample Statistics
学完后你能:After this lesson you can: 区分平稳、唯一与从初始分布收敛,并识别周期反例。Distinguish stationarity, uniqueness and convergence, including a periodic counterexample.
动手观察Explore
单步推进天气、两状态交替与吸收预设,比较当前分布和平稳分布。Step through weather, alternating and absorbing presets, comparing the current distribution with stationary distributions.
从观察到解释From observation to explanation
状态与转移States and transitions
马尔可夫链的下一状态分布由当前状态决定。两状态转移矩阵每一行列出从当前状态到各个下一状态的概率,行和为 1。A Markov chain’s next-state distribution is determined by its current state. Each row of a two-state transition matrix lists probabilities of the next state and sums to 1.
平稳不等于收敛Stationary does not mean convergent
在两状态必定交替的链中,(1/2,1/2) 是平稳分布;但从 (1,0) 出发会在 (1,0) 与 (0,1) 间永远交替,不会收敛到平稳分布。In a chain that always alternates between two states, (1/2,1/2) is stationary. But starting at (1,0) alternates forever between (1,0) and (0,1), so it does not converge to the stationary distribution.
成立条件Conditions
有限时间齐次链至少存在一个平稳分布;有限不可约链的平稳分布唯一;进一步非周期时,从任意初始分布才保证收敛到它。可约链可能有多个平稳分布。A finite time-homogeneous chain has at least one stationary distribution; a finite irreducible chain has a unique one; if it is also aperiodic, every initial distribution converges to it. A reducible chain may have multiple stationary distributions.
公式与符号Formula and symbols
P 是行和为 1 的转移概率矩阵,pₜ 是第 t 步的行分布,π 是平稳分布;平稳指从 π 出发经过一次转移仍为 π。P is a transition matrix whose rows sum to 1, pₜ the row distribution at step t, and π a stationary distribution: starting from π leaves it unchanged after a transition.
留意这个区别Watch for this
有唯一平稳分布不代表所有初始分布都会收敛;周期性和可约性要分别检查。A unique stationary distribution does not by itself guarantee convergence from every initial distribution. Check periodicity and reducibility separately.
继续探索Explore further
课后练习
检验你的理解