Occupation time of a continuous-time Markov chain (source code)

= Occupation time of a continuous-time Markov chain
{title2=$\int_0^t\mathbf1\{Z(u)=s\}\,du$}

= Occupation times of a continuous-time Markov chain
{synonym}

The occupation time records the duration spent in a state of a <continuous-time Markov chain>. Conditional on $Z(0)=r$, its <expected value> is $\int_0^t p_{rs}(u)\,du$, where $p_{rs}$ is the <transition probability>.