Inherent Numerical Instability in Computing Invariant Measures of Markov Chains

Invariant measures of Markov chains in discrete or continuous time with a countable set of states are characterized by its steady state recurrence relations. Exemplarily, we consider transition matrices and Q-matrices with upper bandwidth n and lower bandwidth 1 where the invariant measures satisfy an (n + 1)-order linear difference equation. Markov chains of this type arise from applications to queueing problems and population dynamics. It is the purpose of this paper to point out that the forward use of this difference equation is subject to some hitherto unobserved aspects. By means of the concept of generalized continued fractions (GCFs), we prove that each invariant measure is a dominated solution of the difference equation such that forward computation becomes numerically unstable. Furthermore, the GCF-based approach provides a decoupled recursion in which the phenomenon of numerical instability does not appear. The procedure results in an iteration scheme for successively computing approximants of the desired invariant measure depending on some truncation level N. Increasing N leads to the desired solution. A comparison study of forward computation and the GCF-based approach is given for Q-matrices with upper bandwidth 1 and 2.


Introduction
. In addition we assume that X is irreducible and recurrent.Notice that the irreducibility of X implies , 1 0 for 1, 2, For a recurrent irreducible Markov chain, the system ( ) ( ) has a unique solution which is strictly positive, see Karlin and Taylor ( [1], chapter 11).Every constant positive multiple of ( )  is called an invariant measure of X.
Substituting (1) into (3) and rearranging yields the (n + 1)th-order homogeneous linear recurrence relation From the theory of linear difference equations (see Miller [2]) it is known that there exist , , , , , , n x x x  and ( 5).An application of the recurrence relation (4) then should directly lead to the desired solution x.But unfortunately forward computation of x by means of the homogeneous equation ( 4) is not a meaningful procedure.In the sequel it is shown that the solution space S of the recurrence relation ( 4) is the direct sum As pointed out by Cash [3], Gautschi [4] [5], Lozier [6] and Mattheij [7], forward computation of a dominated solution becomes numerically unstable.To avoid numerical instability, it is therefore necessary to construct a decoupled recursion in which the dominant solution 2 y S ∈ does not appear.In the sequel, it is shown that with each transition matrix P of the form (1) one can associate a set of so-called generalized continued fractions (GCFs) being convergent if the underlying Markov chain is irreducible and recurrent.It turns out that the limits of these fractions coincide with the coefficients of the desired decoupled recursion.
The phenomenon of inherent instability has been first recognized in connection with the computation of higher transcendental functions such as Bessel and associated Legendre functions (see Gautschi [4] and Wimp [8]).Our experience seems to indicate that also most of the recurrence relations arising from stochastic modelling are subject to numerical instability and require special attention.Transition matrices and Q-matrices with lower bandwidth n and upper bandwidth 1 have been discussed in [9].
Remark.Most of our considerations concerning the computation of invariant measures of Markov chains may be extended to more general infinite systems of equations.In Section 3, we will point out the properties of invariant measures which we explicitly used.

Generalized Continued Fractions and Linear Difference Equations
This chapter deals with the computation of dominated solutions of homogeneous linear difference equations by means of generalized continued fractions (GCFs).The theory of GCFs was initiated by Jacobi [10] and Perron [11] [12] and played a leading role in different areas of mathematics, especially in number theory, ergodic theory, linear difference equations and Padé approximations.
The GCF is said to converge iff all the limits Convergence of a GCF is indicated by the notation Terminating a GCF after the N-th column we get the so-called N-th approximants The term "GCF" becomes obvious if forward computation of the N-th approximant of a GCF is replaced by the equivalent backward algorithm.It is known that the recurrence relation ( 6) can be converted into a first order vector recursion of the form by putting Comparing (6) and (9) it is seen, that the numerators ( ) ( )  and the denominators 1 N n B + + of the GCF appear in the last row of the matrix with initial vector ( ) ( ) 1 0, , 0,1 Writing (10) in expanded form and inserting the structure of k W , we get ( ) ( ) with initial values ( ) ( ) Alternative procedures for computing GCFs are described in [13].
x y  of the recurrence relation ( 6) satisfying ) As pointed out by Gautschi [4] [5] and Van der Cruyssen [13], forward computation of a solution der Cruyssen [13] establishes that if the limits exist for all Combining ( 11), ( 12) and ( 16), one obtains an efficient algorithm (which we will refer to as Van der Cruyssen's algorithm) for approximating the first Step and define ( ) Step 2: Set ( ) Step 3: Increase N until the accuracy of the iterates is within prescribed limits.For any l , the vector ( ) Hence, convergence of the algorithm is related to convergence of GCFs.For the latter, we cite two helpful results.


In other words, if one of these two GCFs converges so does the other.
Notice that the GCF (17) may be interpreted as an equivalence transformation of the GCF (12).

Main Results
To make (4) congruent with (6) , a b be defined as in (18) and (19).The limits exist for all 0 l ≥ if the corresponding Markov chain is irreducible and recurrent.In case of convergence the invariant measure is a dominated solution of ( 6) and satisfies the decoupled recursion Proof.Denote by ( ) the ( ) ( ) truncation of P .Since P is assumed to be irreducible and recurrent we conclude from Seneta [20] [21] [22] that the finite system where ( ) N I is the unit matrix and ( ) 0 N e is the vector with unity in the first position and zeros elsewhere has a unique solution ( ) , , , The vector ( ) N h satisfies the homogeneous linear difference Equation ( 6) for 0,1, , k N n = −  and is subject to the boundary conditions .
Notice that the numerators ( ) and the denumerators l B of the GCF (20) satisfy and build up a fundamental system of solutions to Equation ( 6) for k l ≥ .
Dividing both sides of (28) by .
Passing to the limit N → ∞ we get the decoupled recursion (21) provided that the limits To prove our assertion we utilize that the invariant measure ( ) x ≥ of the irreducible and recurrent Markov chain (1) is strictly positive and satisfies the recurrence relation ( 4) which can be rewritten as Define implying that the GCFs converge for all 0 l ≥ by means of Theorem 2. From Theorem 3, we then conclude that the same is true for the GCFs (8). Theorem 2 says that the numerical calculation of the invariant measures of X can be reduced to Van der Cruyssen's algorithm with (23) as initial conditions.
Remark.It is important that the statement of Theorem 4 consists of two parts: • The invariant measure is dominated by other solutions of the difference Equation (4).
• By means of GCFs, we are able to construct a decoupled recursion which is not affected to numerical instability.
Our main goal was the derivation of the first statement.Although the existence of dominating solutions has been pointed out in specific examples (e.g. ( [8], p. 167) where the exact solutions of the difference equations are known), to our knowledge, no statement in this generality has been published.Since the desired solution being dominated directly implies numerical instability, the system x xP = should not be solved by forward computation.Note, that up to some slight modifications concerning the boundary conditions, the truncated system (22) yields the same difference Equation (4) for Thus, forward computation could be applied to (22), too, but at least for large N, the result of numerical instability and hence, the recommendation not to use forward computation, holds for (22) as well.The observation of inherent numerical instability of ( 4) is essential since the transition structure under consideration arises in many practical applications, e.g.state-dependent queueing systems with bulk arrivals, and it is also valid in a more general context, e.g. as an approximation to state-dependent variants of the traditional G/M/1 queueing model.
Basically, we have exploited that the solutions of the truncated system (22) converge to invariant measures as N → ∞ .For Markov chains with a general transition structure, there is no way of solving x xP = directly (in particular, forward computation cannot be applied if 0 kl P > for some 1 k l < − ).In this situation, Seneta [20] [21] [22] as well as Golub and Seneta [23] already recommended to use the convergence of the solutions of the truncated system (22) to the invariant measure for numerical issues.Furthermore, Seneta [22] discussed numerical aspects (in terms of the condition number) of the finite system (22) and stated numerical stability of Gaussian elimination or LU decomposition.The above comment concerning forward computation as a solution method for (22) emphasizes on the fact that it is important to solve this finite system in an appropriate way.The GCF-based algorithm can be interpreted as a combination of building up the truncated system (22), and then applying a modification of Gaussian elimination procedure.Therefore, it follows both steps recommended in the literature cited above and represents the complete procedure in a combined mathematical form, which is interesting from a structural point of view.

Continuous-Time Markov Chains
The results of the preceding chapter can easily be extended to continuous-time where exist independently of the initial state and build up a probability distribution which is strictly positive.For the construction of a continuous-time Markov process from its infinitesimal properties the reader is referred to Reuter [24] and Kendall and Reuter [25].Now let ( ) N Q be the ( ) ( ) corner truncation of Q.If Y is regular and positive recurrent, then the finite system has a unique solution , , , see Tweedie [26].Now let 1, , , 0,1, 2, , By substituting (31) into (32) it is seen that ( ) N z satisfies the ( ) and the boundary conditions By replacing (33) with ( 18) and ( 34) with (19), it is readily seen that the scheme ( 35)-(37) formally coincides with that of the discrete time case.Hence ( 26)-( 29) also hold for ( ) l N z .To prove convergence of the associated GCFs we use the same arguments as in the proof of Theorem 4. Notice that ( )  then converges for all 0 l ≥ .Hence the same is true for the GCFs (38).
Summarizing we arrive at the following theorem.Theorem 5. Let ( ) , i k k c d be defined as in (33) and (34), respectively.The limits (38) exist for all 0 l ≥ if the corresponding Markov process is irreducible, regular and positive recurrent.In case of convergence the limiting distribution is a dominated solution of (35) and satisfies the decoupled recursion.
For executing (40), we make use of Van der Cruyssen's algorithm with (36) as initial conditions.The resulting sequence ( ) ( ) Remark.As for discrete-time Markov chains, the key statement of Theorem 5 is that the invariant measure is a dominated solution of the difference equation (35).Again, the GCFs additionally combine the two-step method consisting of considering the truncated system (32) and applying Gaussian elimination or LU decomposition.

Numerical Examples
As an example we consider the continuous-time Markov chain with parameters 0 1 a γ > > and 1 0 1 a a ≥ + .Such a Markov chain may be interpreted as a model for a single-server queueing system with state-dependent arrival and service rates, and with customers arriving in groups of size 1 or 2.
It is easy to check that Q is irreducible.To prove that Y is regular and positive recurrent we make use of Tweedie's [27] criterion.The condition is to find some 0 ε > and a non-negative sequence ( ) for almost all i.By substituting (41) into (42) we get for almost all i.The substitution for almost all i which is true because of 0 1 a γ > > .
Under these conditions there exists a unique invariant measure of Y (up to multiplication by a constant), which satisfies the following set of equations: ( ) ( ) and which is used for forward computation.
Since (45) is a homogenous linear difference equation with constant coefficients a fundamental set of solutions can easily be derived from the roots of its characteristic equation.A simple manipulation yields the following set of linearly independent solutions: linear combination of the first two solutions, that is: Therefore, choosing 1 γ > yields that there is a geometrically increasing solution of (46), which explains why forward computation cannot cope with this problem, whereas the GCF-based algorithm becomes a stable procedure.This effect is reflected in Table 1 and Table 2, where data type double in C++ was used.( ) Substituting of (48) into (47) leads to By truncating this infinite continued fraction scheme at a certain level k N = , we get approximants for the desired coefficients ( ) given in Table 3.In this example the effect of numerical instability is comparatively small.

Conclusion and Further Research
For Markov chains with a specific transition structure, we have proven that the Table 3. Numerical values for the M/M/1 queueing system for In the context of computing invariant measures of Markov chains, we have x S e ⋅ =, then the GCF-based algorithm converges to x as N tends to infinity, see [29].
Usually, these assumptions are met in the context of computing Perron-Frobenius eigenvectors for infinite non-negative matrices with some communication structure (e.g.irreducibility, see [30] for more details).In the context of discrete-time Markov chains, invariant measures are right eigenvectors for the Perron-Frobenius eigenvalue 1, whereas left eigenvectors are related to hitting probabilities (or absorption probabilities).Therefore, an extension of our considerations could refer to the task of computing these probabilities under appropriate assumptions on the transition structure.Further generalizations could deal with the following generalizations: • In the tridiagonal case (that is, 1 n = ), a generalization to block-matrices (that is, the corresponding Markov chain is a quasi-birth-death process) by means of matrix-valued continued fractions has been studied in [31].The resulting algorithm is similar to the matrix-analytic methods studied in [32] [33].An intuitive combination is the study of transition probability matrices of the form (1) where all kl P are matrices.For practical issues, it would be desirable to find a memory-efficient algorithm for computing stationary expectations.For quasi-birth-death processes (that is, block-tridiagonal transition matrices), such a method has been suggested in [34].
• Instead of banded matrices, we could consider upper Hessenberg matrices P (or lower Hessenberg matrices S).Then the difference equation ( 4) of order n is replaced by a difference equation of infinite order (sometimes referred to as sum equation).Furthermore, arbitrary lower bandwidthes for P could be considered (as in [9], where the upper bandwidth was restricted to 1).
number of customers in line, forms a homogeneous continuous time Markov chain with state space[28].The model is convenient to get clear about the mechanism of our approach.The invariant measure ( ) solution of (47), as claimed.Therefore ( ) the decoupled recursion (40), i.e.

<
In the general case, the main steps of the proofs of Theorem 4 or Theorem 5 can be restated in an abstract context as follows, and if there is a strictly positive solution x of 0 Sx = , all GCFs involved in the algorithmic procedure converge.If additionally, we have This paper is dedicated to discrete-time Markov chains

Table 1 .
Numerical values for

Table 2 .
Numerical values for invariant measure is a dominated solution of the corresponding steady-state recurrence relations, and therefore, it cannot be calculated by forward computation.As a by-product of our considerations, a GCF-based method for computing the invariant measure in a numerically stable way has been established.The effects of numerical instability of the original recurrence relations as well as the stability of the decoupled version have been illustrated by numerical examples.In some way, the GCF-based approach is similar to previously recommended methods (truncate the infinite system and solve the truncated one by Gaussian elimination or LU decomposition), but represents the steps in a combined mathematical form.Note that in previous literature, the generality of the transition structure did not allow forward computation, and hence, the question of instability of this method did not arise.At no point of our consideration, we used stochasticity of P (or the corresponding property of conservativity of Q) explicitly.Therefore, it seems reasonable to extend our results to more general infinite systems