1function G = MG1_G_ETAQA(An)
2% MG1_G_ETAQA computes the G matrix
for M/G/1-Type Markov Chains [Bini, Meini]
6% G = MG1_G_ETAQA(An) computes the minimal nonnegative solution to the
7% matrix equation G = A0 + A1 G + A2 G^2 + A3 G^3 + ... + A_max G^max,
8% a nonnegative matrix, with (A0+A1+A2+...+A_max) irreducible and
12% G = MG1_G_ETAQA(An) computes the minimal nonnegative solution to the
13% matrix equation 0 = A0 + A1 G + A2 G^2 + A3 G^3 + ... + A_max G^max,
14% a nonnegative matrix, with (A0+A1+A2+...+A_max) irreducible and
21Gtemp = zeros(psize,psize);
24% check
if the matrix
is stochastic
29 if (rowsum(i) < 1e-16)
40 error(
'This is not stochastic matrix, neither continuous nor discrete! \n Please make sure every row sum up to 0 or 1');
43 An(:,r+1:2*r) = An(:,r+1:2*r) + eye(r);
51%
while max(max(abs(G-Gtemp))) > 1e-15
53% G = zeros(psize,psize);