1function R=GIM1_R(A,Dual,Algor,varargin)
2%GIM1_R determines R matrix of a GI/M/1-Type Markov Chain
4% R=GIM1_R(A,Dual,Algor) computes the minimal nonnegative solution to the
5% matrix equation R = A0 + R A1 + R^2 A2 + R^3 A3 + ... + R^max A_max,
6% where A = [A0 A1 A2 A3 ... A_max] has m rows and m*max columns and
is
7% a nonnegative matrix, with (A0+A1+A2+...+A_max) irreducible and
10% The parameter Dual specifies whether the Ramaswami or Bright
11% duals
is used. This parameter can take on 3 values:
13%
'B': Uses the Bright dual
14%
'R': Uses the Ramaswami dual
15%
'A': Automatic, uses the Bright dual
for a positive
16% recurrent chain and the Ramaswami dual otherwise
18% The
'A' typically results in the lowest computation time (when CR
is
21% The parameter Algor determines the
class of algorithms used to
22% compute G. This
is realized by computing the G matrix of the
23% Bright/Ramaswami Dual of the Markov chain.
27%
'FI' : Functional Iterations [Neuts]
28%
'CR' : Cyclic Reduction [Bini, Meini]
29%
'NI' : Newton Iteration [Perez, Telek, Van Houdt]
30%
'RR' : Ramaswami Reduction [Bini, Meini, Ramaswami]
31%
'IS' : Invariant Subspace [Akar, Sohraby]
35% See MG1_FI, MG1_CR, MG1_NI, MG1_RR and MG1_IS
for the supported
41% compute invariant vector of A and the drift
42% drift > 1: positive recurrent GIM1, drift < 1: transient GIM1
43sumA=A(:,dega*m+1:end);
45% beta = (A_maxd)e + (A_maxd + A_maxd-1)e + ... + (Amaxd+...+A1)e
47 sumA=sumA+A(:,i*m+1:(i+1)*m);
48 beta=beta+sum(sumA,2);
54if (strcmp(Dual,
'R')|(strcmp(Dual,
'A') & drift <=1 )) % RAM dual
55 % compute the RAM Dual process
57 A(:,i*m+1:(i+1)*m)=diag(theta.^(-1))*A(:,i*m+1:(i+1)*m)
'*diag(theta);
60 if (drift > 1) % A -> positive recurrent GIM1
61 % compute the Caudal characteristic of A
63 else % A -> transient GIM1 (=recurrent MG1)
66 % compute invariant vector of A0+A1*eta+A2*eta^2+...+Amax*eta^max
67 sumAeta=eta^dega*A(:,dega*m+1:end);
69 sumAeta=sumAeta+eta^i*A(:,i*m+1:(i+1)*m);
71 theta=stat(sumAeta+(1-eta)*eye(m));
72 % compute the Bright Dual process
74 A(:,i*m+1:(i+1)*m)=eta^(i-1)*diag(theta.^(-1))*A(:,i*m+1:(i+1)*m)'*diag(theta);
80 G=MG1_FI(A,varargin{:});
82 G=MG1_CR(A,varargin{:});
84 G=MG1_NI(A,varargin{:});
86 G=MG1_RR(A,varargin{:});
88 G=MG1_IS(A,varargin{:});
90 error(
'MATLAB:GIM1_R:InvalidAlgor',...
91 'Algorithm ''%s'' is not supported',Algor)
94if (strcmp(Dual,
'R')|(strcmp(Dual,
'A') & drift <=1 )) % RAM dual
95 R=diag(theta.^(-1))*G
'*diag(theta);
97 R=diag(theta.^(-1))*G'*diag(theta)*eta;