Residual lifetime Markov chain (source code)

= Residual lifetime Markov chain
{wiki}

For a positive integer-valued lifetime $T\in\{1,\ldots,M\}$, one discrete-time <residual lifetime Markov chain> uses states $0,\ldots,M-1$. From state $i>0$ it moves to $i-1$. From zero it draws an <independent> new lifetime and moves to $T-1$:
$$
P_{i,i-1}=1\quad(i>0),\qquad P_{0,j}=\mathbb P(T=j+1).
$$
The subtraction of one specifies the sampling convention: the next step has already consumed one unit of the new lifetime. With this convention, successive visits to zero are separated by exactly $T$ steps, not $T+1$.

Its <Stationary distribution> is $\pi_i=\mathbb P(T>i)/\mathbb ET$. The tail-sum identity normalizes these masses, and the balance equations $\pi_i=\pi_{i+1}+\pi_0\mathbb P(T=i+1)$ verify them, with the obvious top-state equation. If $T=3$ deterministically, the chain cycles $0,2,1,0$ and its stationary law is uniform. It is periodic, so a <Stationary distribution> does not imply convergence from every initial state.