Continuous-time Markov chain explained

A continuous-time Markov chain (CTMC) is a continuous stochastic process in which, for each state, the process will change state according to an exponential random variable and then move to a different state as specified by the probabilities of a stochastic matrix. An equivalent formulation describes the process as changing state according to the least value of a set of exponential random variables, one for each possible state it can move to, with the parameters determined by the current state.

An example of a CTMC with three states

\{0,1,2\}

is as follows: the process makes a transition after the amount of time specified by the holding time—an exponential random variable

Ei

, where i is its current state. Each random variable is independent and such that

E0\simExp(6)

,

E1\simExp(12)

and

E2\simExp(18)

. When a transition is to be made, the process moves according to the jump chain, a discrete-time Markov chain with stochastic matrix:

\begin{bmatrix} 0&

1
2

&

1\\
2
1
3

&0&

2\\
3
5
6

&

1
6

&0 \end{bmatrix}.

Equivalently, by the property of competing exponentials, this CTMC changes state from state i according to the minimum of two random variables, which are independent and such that

Ei,j\simExp(qi,j)

for

ij

where the parameters are given by the Q-matrix

Q=(qi,j)

\begin{bmatrix} -6&3&3\\ 4&-12&8\\ 15&3&-18 \end{bmatrix}.

Each non-diagonal entry

qi,j

can be computed as the probability that the jump chain moves from state i to state j, divided by the expected holding time of state i. The diagonal entries are chosen so that each row sums to 0.

A CTMC satisfies the Markov property, that its behavior depends only on its current state and not on its past behavior, due to the memorylessness of the exponential distribution and of discrete-time Markov chains.

Definition

Let

(\Omega,{\calA},\Pr)

be a probability space, let

S

be a countable nonempty set, and let

T=R\ge0

(

T

for "time"). Equip

S

with the discrete metric, so that we can make sense of right continuity of functions

R\ge0\toS

. A continuous-time Markov chain is defined by:[1]

λ

on

S

(which below we will interpret as the initial distribution of the Markov chain), and

Q

on

S

, that is, a function

Q:S2\toR

such that
  1. for all distinct

i,j\inS,0\leqi,j

,
  1. for all

i\inS,

\sumj\inqi,j=-qi,i.

(Even if

I

is infinite, this sum is a priori well defined (possibly equalling

+infty

) because each term appearing in the sum is nonnegative. A posteriori, we know the sum must also be finite (not equal to

+infty

), since we're assuming it's equal to

-qi,i

and we've assumed

Q

is real valued. Some authors instead use a definition that's word-for-word the same except for a modified stipulation

Q:S2\toR\cup\{-infty\}

, and say

Q

is stable or totally stable to mean

\operatorname{range}Q\subseteqR

, i.e., every entry is real valued.)Note that the row sums of

Q

are 0:

\foralli\inS~\sumj\inqi,j=0,

or more succinctly,

Q ⋅ 1=0

. This situation contrasts with the situation for discrete-time Markov chains, where all row sums of the transition matrix equal unity.

Now, let

X:T\toS\Omega

such that

\forallt\inT~X(t)

is

({\calA},{\calP}(S))

-measurable. There are three equivalent ways to define

X

being Markov with initial distribution

λ

and rate matrix

Q

: via transition probabilities or via the jump chain and holding times.

As a prelude to a transition-probability definition, we first motivate the definition of a regular rate matrix. We will use the transition-rate matrix

Q

to specify the dynamics of the Markov chain by means of generating a collection of transition matrices

P(t)

on

S

(

t\inR\ge0

), via the following theorem.We say

Q

is regular to mean that we do have uniqueness for the above system, i.e., that there exists exactly one solution. We say

Q

is irregular to mean

Q

is not regular. If

S

is finite, then there is exactly one solution, namely

P=(etQ)t\in,

and hence

Q

is regular. Otherwise,

S

is infinite, and there exist irregular transition-rate matrices on

S

. If

Q

is regular, then for the unique solution

P

, for each

t\inT

,

P(t)

will be a stochastic matrix. We will assume

Q

is regular from the beginning of the following subsection up through the end of this section, even though it is conventional to not include this assumption. (Note for the expert: thus we are not defining continuous-time Markov chains in general but only non-explosive continuous-time Markov chains.)

Transition-probability definition

Let

P

be the (unique) solution of the system . (Uniqueness guaranteed by our assumption that

Q

is regular.) We say

X

is Markov with initial distribution

λ

and rate matrix

Q

to mean: for any nonnegative integer

n\ge0

, for all

t0,...,tn+1\inT

such that

t0<...<tn+1,

for all

i0,...,in+1\inI,

Using induction and the fact that

\forallA,B\in{\calA}~~\Pr(B)\ne0 → \Pr(A\capB)=\Pr(A\midB)\Pr(B),

we can show the equivalence of the above statement containing and the following statement: for all

i\inI,~\Pr(X0=i)i

and for any nonnegative integer

n\ge0

, for all

t0,...,tn+1\inT

such that

t0<...<tn+1,

for all

i0,...,in+1\inI

such that

0<\Pr(X0=i0,...,X

tn

=in)

(it follows that
0<\Pr(X
tn

=in)

),

It follows from continuity of the functions

(P(t)i,j)t\in

(

i,j\inS

) that the trajectory

(Xt(\omega))t\in

is almost surely right continuous (with respect to the discrete metric on

S

): there exists a

\Pr

-null set

N

such that

\{\omega\in\Omega:(Xt(\omega))t\inisrightcontinuous\}\subseteqN

.

Jump-chain/holding-time definition

Sequences associated to a right-continuous function

Let

f:T\toS

be right continuous (when we equip

S

with the discrete metric). Define

h=h(f)=(inf\{u\in(0,+infty):f(t+u)\nef(t)\})t\in)\cup\{+infty,0\},

let

H=H(f)=(h\circ

0)
n\inZ\ge0
be the holding-time sequence associated to

f

, choose

s\inS,

and let

y=y(f)=\left(\begin{cases}f(\sumk\inHk)&if\sumk\inHk<+infty,\\s&else\end{cases}\right)n\in\omega

be "the state sequence" associated to

f

.

Definition of the jump matrix Π

The jump matrix

\Pi

, alternatively written

\Pi(Q)

if we wish to emphasize the dependence on

Q

, is the matrix\Pi=([i=j])_\cup\bigcup_(\\cup\),where

Z=Z(Q)=\{k\inS:qk,k=0\}

is the zero set of the function

(qk,k)k\in.

Jump-chain/holding-time property

We say

X

is Markov with initial distribution

λ

and rate matrix

Q

to mean: the trajectories of

X

are almost surely right continuous, let

f

be a modification of

X

to have (everywhere) right-continuous trajectories,
\sum
n\inZ\ge0

H(f(\omega))n=+infty

almost surely (note to experts: this condition says

X

is non-explosive), the state sequence

y(f(\omega))

is a discrete-time Markov chain with initial distribution

λ

(jump-chain property) and transition matrix

\Pi(Q),

and

\foralln\inZ\ge0~\forallB\in{\calB}(R\ge0)~\Pr(Hn(f)\in

B)=\operatorname{Exp}(-q
Yn,Yn

)(B)

(holding-time property).

Infinitesimal definition

We say

X

is Markov with initial distribution

λ

and rate matrix

Q

to mean: for all

i\inS,

\Pr(X(0)=i)i

and for all

i,j

, for all

t

and for small strictly positive values of

h

, the following holds for all

t\inT

such that

0<\Pr(X(t)=i)

:

\Pr(X(t+h)=j\midX(t)=i)=[i=j]+qi,jh+o(h)

,where the term

[i=j]

is

1

if

i=j

and otherwise

0

, and the little-o term

o(h)

depends in a certain way on

i,j,h

.

The above equation shows that

qi,j

can be seen as measuring how quickly the transition from

i

to

j

happens for

ij

, and how quickly the transition away from

i

happens for

i=j

.

Properties

Communicating classes

Communicating classes, transience, recurrence and positive and null recurrence are defined identically as for discrete-time Markov chains.

Transient behaviour

Write P(t) for the matrix with entries pij = P(Xt = j | X0 = i). Then the matrix P(t) satisfies the forward equation, a first-order differential equation

P'(t)=P(t)Q

,where the prime denotes differentiation with respect to t. The solution to this equation is given by a matrix exponential

P(t)=etQ

.

In a simple case such as a CTMC on the state space . The general Q matrix for such a process is the following 2 × 2 matrix with α,β > 0

Q=\begin{pmatrix}-\alpha&\alpha\\beta&-\beta\end{pmatrix}.

The above relation for forward matrix can be solved explicitly in this case to give

P(t)=\begin{pmatrix}

\beta
\alpha+\beta

+

\alpha
\alpha+\beta

e-(\alpha+\beta)t&

\alpha
\alpha+\beta

-

\alpha
\alpha+\beta

e-(\alpha+\beta)t\\

\beta
\alpha+\beta

-

\beta
\alpha+\beta

e-(\alpha+\beta)t&

\alpha
\alpha+\beta

+

\beta
\alpha+\beta

e-(\alpha+\beta)t\end{pmatrix}

.

Computing direct solutions is complicated in larger matrices. The fact that Q is the generator for a semigroup of matrices

P(t+s)=e(t+s)Q=etQesQ=P(t)P(s)

is used.

Stationary distribution

The stationary distribution for an irreducible recurrent CTMC is the probability distribution to which the process converges for large values of t. Observe that for the two-state process considered earlier with P(t) given by

P(t)=\begin{pmatrix}

\beta
\alpha+\beta

+

\alpha
\alpha+\beta

e-(\alpha+\beta)t&

\alpha
\alpha+\beta

-

\alpha
\alpha+\beta

e-(\alpha+\beta)t\\

\beta
\alpha+\beta

-

\beta
\alpha+\beta

e-(\alpha+\beta)t&

\alpha
\alpha+\beta

+

\beta
\alpha+\beta

e-(\alpha+\beta)t\end{pmatrix}

,as t → ∞ the distribution tends to

P\pi=\begin{pmatrix}

\beta&
\alpha+\beta
\alpha\\
\alpha+\beta
\beta&
\alpha+\beta
\alpha
\alpha+\beta

\end{pmatrix}

.Observe that each row has the same distribution as this does not depend on starting state. The row vector may be found by solving

\piQ=0

with the constraint

\sumi\pii=1

.

Example 1

The image to the right describes a continuous-time Markov chain with state-space and transition-rate matrix

Q=\begin{pmatrix} -0.025&0.02&0.005\\ 0.3&-0.5&0.2\\ 0.02&0.4&-0.42 \end{pmatrix}.

The stationary distribution of this chain can be found by solving

\piQ=0

, subject to the constraint that elements must sum to 1 to obtain

\pi=\begin{pmatrix}0.885&0.071&0.044\end{pmatrix}.

Example 2

The image to the right describes a discrete-time Markov chain modeling Pac-Man with state-space . The player controls Pac-Man through a maze, eating pac-dots. Meanwhile, he is being hunted by ghosts. For convenience, the maze shall be a small 3x3-grid and the ghosts move randomly in horizontal and vertical directions. A secret passageway between states 2 and 8 can be used in both directions. Entries with probability zero are removed in the following transition-rate matrix:

Q=\begin{pmatrix}-1&

1
2

&&

1\\
2
1
4

&-1&

1
4

&&

1&&&
4
1
4

\\ &

1
2

&-1&&&

1\\
2
1
3

&&&-1&

1
3

&&

1
3

\\ &

1
4

&&

1
4

&-1&

1
4

&&

1
4

\\ &&

1
3

&&

1
3

&-1&&&

1
3

\\ &&&

1
2

&&&-1&

1
2

\\ &

1
4

&&&

1
4

&&

1
4

&-1&

1
4

\\ &&&&&

1
2

&&

1
2

&-1\end{pmatrix}

This Markov chain is irreducible, because the ghosts can fly from every state to every state in a finite amount of time. Due to the secret passageway, the Markov chain is also aperiodic, because the ghosts can move from any state to any state both in an even and in an uneven number of state transitions. Therefore, a unique stationary distribution exists and can be found by solving

\piQ=0

, subject to the constraint that elements must sum to 1. The solution of this linear equation subject to the constraint is

\pi=(7.7,15.4,7.7,11.5,15.4,11.5,7.7,15.4,7.7)\%.

The central state and the border states 2 and 8 of the adjacent secret passageway are visited most and the corner states are visited least.

Time reversal

For a CTMC Xt, the time-reversed process is defined to be

\hatXt=XT-t

. By Kelly's lemma this process has the same stationary distribution as the forward process.

A chain is said to be reversible if the reversed process is the same as the forward process. Kolmogorov's criterion states that the necessary and sufficient condition for a process to be reversible is that the product of transition rates around a closed loop must be the same in both directions.

Embedded Markov chain

One method of finding the stationary probability distribution,, of an ergodic continuous-time Markov chain, Q, is by first finding its embedded Markov chain (EMC). Strictly speaking, the EMC is a regular discrete-time Markov chain. Each element of the one-step transition probability matrix of the EMC, S, is denoted by sij, and represents the conditional probability of transitioning from state i into state j. These conditional probabilities may be found by

sij=\begin{cases}

qij
\sumkqik

&ifij,\\ 0&otherwise. \end{cases}

From this, S may be written as

S=I-\left(\operatorname{diag}(Q)\right)-1Q

where I is the identity matrix and diag(Q) is the diagonal matrix formed by selecting the main diagonal from the matrix Q and setting all other elements to zero.

To find the stationary probability distribution vector, we must next find

\varphi

such that

\varphiS=\varphi,

with

\varphi

being a row vector, such that all elements in

\varphi

are greater than 0 and

\|\varphi\|1

= 1. From this, may be found as

\pi={-\varphi(\operatorname{diag}(Q))-1\over\left\|\varphi(\operatorname{diag}(Q))-1\right\|1}.

(S may be periodic, even if Q is not. Once is found, it must be normalized to a unit vector.)

Another discrete-time process that may be derived from a continuous-time Markov chain is a δ-skeleton - the (discrete-time) Markov chain formed by observing X(t) at intervals of δ units of time. The random variables X(0), X(δ), X(2δ), ... give the sequence of states visited by the δ-skeleton.

See also

References

Notes and References

  1. Book: Ross, S.M.. 2010. Introduction to Probability Models. Elsevier. 10. 978-0-12-375686-2.