Conditional hitting time (source code)

= Conditional hitting time
{wiki}

A <Conditional hitting time> describes a target-passage time after conditioning on a specified successful outcome. Let a <Finite Markov chain> hit disjoint sets $A\cup B$ <almost surely>, put $T=T_A\wedge T_B$, and let $h_i=\mathbb P_i(T_A<T_B)$. For states with $h_i>0$, the <conditional mean> is
$$
m_i=\mathbb E_i[T\mid T_A<T_B].
$$
The weighting matters: conditioning changes the <probabilities> of the next state. The successful <Markov kernel>[conditional transition kernel], a <Doob h-transform>, is $P^{(h)}_{ij}=P_{ij}h_j/h_i$ outside $A$. Transitions into $B$ receive weight zero and $A$ is the terminal target. Therefore $m=0$ on $A$ and
$$
m_i=1+\sum_{j\notin A\cup B}\frac{P_{ij}h_j}{h_i}m_j.
$$
Equivalently, the weighted <moments> $v_i=\mathbb E_i[T\mathbf1_{\{T_A<T_B\}}]=h_im_i$ satisfy $v_i=h_i+\sum_{j\notin A\cup B}P_{ij}v_j$, with zero boundary values.

For symmetric <random walk> on $\{0,1,2,3\}$ absorbed at zero or three, condition on reaching three first. Since $h_i=i/3$, the conditioned chain moves from one to two with <Probability> one, and from two to one or three with <probabilities> $1/4$ and $3/4$. Its <means> satisfy $m_1=1+m_2$ and $m_2=1+m_1/4$, giving $m_1=8/3$. The unconditioned absorption <mean> from one is two. A successful path need not have the same waiting-time distribution as an unconditioned path.