LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
QBD_pi_ETAQA.m
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]
4%
5%
6% Return value: pi=[pi0,pi1,pi2+pi3+...];
7%
8% Usage:
9% For Continuous Case:
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
12% matrix of the form,
13%
14% B1 B2 0 0 0 ...
15% B0 A1 A2 0 0 ...
16% Q = 0 A0 A1 A2 0 ...
17% 0 0 A0 A1 A2 ...
18% ...
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
23%
24% For Discrete 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,
27%
28% B1 B2 0 0 0 ...
29% B0 A1 A2 0 0 ...
30% P = 0 A0 A1 A2 0 ...
31% 0 0 A0 A1 A2 ...
32% ...
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
37%
38
39mb = size(B,1);
40m = size(A,1);
41testm = size(B0,1);
42testmb = size(B0,2);
43if (testm ~= m)
44 error('Matrix B0 has an incorrect number of rows');
45end
46if (testmb ~= mb)
47 error('Matrix B0 has an incorrect number of columns');
48end
49if (mod(size(B,2)-mb,m) ~= 0 || (size(B,2)-mb)/m ~=1 )
50 error('Matrix B has an incorrect number of columns');
51end
52if (mod(size(A, 2),m) ~= 0 || size(A,2)/m ~= 3)
53 error('Matrix A has an incorret number of columns');
54end
55B1 = B(:,1:mb);
56B2 = B(:,mb+1:mb+m);
57A0 = A(:,1:m);
58A1 = A(:,m+1:2*m);
59A2 = A(:,2*m+1:3*m);
60
61
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
64 % generator
65
66 A1 = A1 - eye(m);
67 B1 = B1 - eye(mb);
68end
69
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);
76i = 0;
77rankt = 0;
78while ( rankt ~= rankXtemp && i <= (mb+2*m-1))
79 rankt = rank([Xtemp(:,1:i),Xtemp(:,i+2:mb+2*m)]);
80 i = i+1;
81end
82
83X = [ones(mb+2*m,1),Xtemp(:,1:i-1),Xtemp(:,i+1:mb+2*m)];
84
85rside = [1,zeros(1,mb+2*m-1)];
86
87pi = rside / X;
88
89
90end
91
92