1function pi=QBD_pi_ETAQA(B,A,B0,G)
2%QBD_pi_ETAQA Aggregate Stationary vector of a Quasi-Birth-Death(QBD) process
3%
using the newETAQA method [Stathopoulos, Riska, Hua, Smirni]
6% Return value: pi=[pi0,pi1,pi2+pi3+...];
10% pi=QBD_pi_ETAQA(B,A,B0,G) computes the aggregated probability vector of a
11% QBD-type Continuous Time Markov Chain(CTMC) with an infinitesimal generator
19% where B = [B1,B2] and A = [A0,A1,A2], B0 describes the backward transition from
20% second level of states to the boundary level of states. The input matrix R
is
21% the minimal nonnegative solution to the matrix equation 0 = A2 + R A1 + R^2 A0
22%
for the continuous
case
25% pi=QBD_pi_ETAQA(B,A,B0,G) computes the aggregated probability vector of a
26% QBD-type Discrete Time Markov with a transition matrix of the form,
33% where B = [B1,B2] and A = [A0,A1,A2], B0 describes the backward transition from
34% second level of states to the boundary level of states. The input matrix R
is
35% the minimal nonnegative solution to the matrix equation R = A2 + R A1 + R^2 A0
36%
for the continuous
case
44 error(
'Matrix B0 has an incorrect number of rows');
47 error(
'Matrix B0 has an incorrect number of columns');
49if (mod(size(B,2)-mb,m) ~= 0 || (size(B,2)-mb)/m ~=1 )
50 error(
'Matrix B has an incorrect number of columns');
52if (mod(size(A, 2),m) ~= 0 || size(A,2)/m ~= 3)
53 error(
'Matrix A has an incorret number of columns');
62if abs((sum(B,2) - ones(mb,1))
'*ones(mb,1)) < 1e-12
63 % if this is a transition matrix transform it to the infinitesimal
70% Construct X so that pi*X = [1,0s]
71Firstc = [B1;B0;zeros(m,mb)];
72Secondc = [B2;A1+A2*G;zeros(m,m)];
73Thirdc = [zeros(mb,m);A2;A1+A2+A2*G];
74Xtemp = [Firstc,Secondc,Thirdc];
75rankXtemp = rank(Xtemp);
78while ( rankt ~= rankXtemp && i <= (mb+2*m-1))
79 rankt = rank([Xtemp(:,1:i),Xtemp(:,i+2:mb+2*m)]);
83X = [ones(mb+2*m,1),Xtemp(:,1:i-1),Xtemp(:,i+1:mb+2*m)];
85rside = [1,zeros(1,mb+2*m-1)];