4 Markov chains

4.8 Expected hitting times

Definition 4.8.1.

If a Markov chain X is started in state i (X0=i) and reaches state j for the first time at time Tij then Tij is called the hitting time for state j from state i. In mathematical notation

Tij=min{T:XT=j,T1|X0=i}.

When i=j we obtain Tii, the return time for state i.

Here we will be concerned with expected hitting times and expected return times:

τij=𝐄[Tij].
Theorem 4.8.2.

For an n state Markov chain with transition matrix P,

τij=1+k=1,kjnPikτkj.
Proof.

For a given realisation of the Markov chain, let Tij be the actual hitting time for state j from state i. Then

Tij={1 with probability Pij1+Tkj with probability Pik(kj),

where Tkj is the further time to reach state j if the first transition is from i to k. By the Markov property, Tkj has the same distribution as Tkj. Taking expectations and using the Tower Law

τij = 𝐄[Tij]
= Pij×1+k=1,kjnPik𝐄[(1+Tkj)]
= k=1nPik+k=1,kjnPik𝐄[Tkj](by linearity of expectation)
= 1+k=1,kjnPikτkj.(since rows sum to 1)

Example 4.8.3.

A Markov chain has transition probability matrix

P=(0.10.30.60.30.50.20.50.50.0).

What is the expected return time for state 1 and the expected hitting time for state 1 from each of states 2 and 3? What is the expected time to hit state 1 if the Markov chain has initial distribution (1/2,1/10,2/5)?

From Theorem 4.8.2

τ11 = 1+0.3τ21+0.6τ31 (4.1)
τ21 = 1+0.5τ21+0.2τ31 (4.2)
τ31 = 1+0.5τ21 (4.3)

Substituting (4.3) into (4.2) gives

τ21=1+0.5τ21+0.2+0.1τ210.4τ21=1.2τ21=3.0.

Substitution back in to (4.3) gives τ31=2.5; then substitution into the first equation provides τ11=3.4.

NB: More generally (4.2) and (4.3) would be two simultaneous equations. The invariant distribution for P is π=(10/34,15/34,9/34), so in this particular example: τ11=1/π1.

The expected hitting time for state 1 from starting distribution (1/2,1/10,2/5) is

(1/2)*τ11+(1/10)*τ21+(2/5)*τ31=17/10+3/10+1=3.
Example 4.8.4.

A Markov chain has transition kernel

P=(0.60.400.80.200.50.30.2)

What can be said about the return time for state 3 and the hitting time for state 3 from each of states 1 and 2?

It is impossible to get to state 3 from either state 1 or state 2. From state 3, either the return time is 1 or the chain will never return to state 3. One way to view of this is that the hitting/return times are infinite. Also the classes are {1,2} and {3}.

The invariant distribution for P is π=(2/3,1/3,0), so in this particular example: τ33=1/π3.

Remark.

Recall that for a finite irreducible Markov chain all states are persistent and it can be shown that the expected hitting times are finite.

Theorem 4.8.5.

If a Markov chain has invariant distribution π then the expected return time to a persistent state i is τii=1/πi.

Remark.
  • (a)

    Compare with a geometric random variable for which the expected value of the first occurrence is the reciprocal of the success probability.

  • (b)

    In an irreducible MC, a stationary distribution exists if and only if all states are persistent with finite τii and in this case the invariant distribution is given by πi=1/τii. In particular in an irreducible MC with finite state space, the invariant distribution always exists whereas the asysmptotic distribution will exist if it is additionally aperiodic.

Heuristic of proof: (not a full rigorous proof) Let the Markov chain start in its stationary distribution π and imagine letting the chain run for a very long time T.

Let ti(A) be the time until the chain first hits state i and ti(B) be the time from the last time the chain hits state i until T.

Suppose that the chain hits state i Ni times and let Tii(1),,Tii(Ni-1) be the return times to state i.

Figure 4.1: Link, Caption: none provided

Now (see the picture) T=ti(A)+k=1Ni-1Tii(k)+ti(B); so taking expectations:

T=𝐄[ti(A)+ti(B)]+𝐄[k=1Ni-1Tii(k)]. (4.4)

Because the chain is in its stationary distribution

𝐄[Ni]=𝐄[j=1T11{Xj=i}]=j=1T𝐄[11{Xj=i}]=πiT;

here 11{A} is the indicator function, i.e. 11{A}=1 if A is true, and 11{A}=0 otherwise.
If we replace Ni by πiT=𝐄[Ni] (this needs justification which is why this is not a formal proof) then by (4.4)

T=𝐄[ti(A)+ti(B)]+(πiT-1)τii.

Dividing through by T gives

1=(πi-1/T)τii+1T𝐄[ti(A)+ti(B)].

By the Remark before this Theorem, 𝐄[ti(A)+ti(B)] is bounded (since ti(B)<TiiNi), so letting T gives the required result. ∎