LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
GIM1_R_ETAQA.m
1function R = GIM1_R_ETAQA(An)
2%GIM1_R determines R matrix of a GI/M/1-Type Markov Chain
3%
4% DISCRETE TIME case:
5% R = GIM1_R(An) computes the minimal nonnegative solution to the
6% matrix equation R = A0 + R A1 + R^2 A2 + R^3 A3 + ... + R^max A_max,
7% where A = [A0 A1 A2 A3 ... A_max] has m rows and m*max columns and is
8% a nonnegative matrix, with (A0 + A1 + A2 + ... + A_max) irreducible
9% and stochastic.
10%
11%
12
13r = size(An,1);
14s = size(An,2);
15b = r/s;
16
17rowsum = sum(An,2);
18isdiscrete = 0;
19
20L = An(s+1:2*s,:);
21t = min(diag(L));
22if ( t > 0 )
23isdiscrete = 1;
24end
25
26if (isdiscrete == 0)
27 L = An(s+1:2*s,:);
28 t = min(diag(L));
29 if (t > 0)
30 error('This is not stochastic matrix, neither continuous nor discrete! \n Please make sure every row sum up to 0 or 1');
31
32 end
33 An = An/(-t);
34 An(s+1:2*s,:) = An(s+1:2*s,:) + eye(s);
35end
36
37Bn = [];
38for i = 1:b
39 temp = An((i-1)*s+1:i*s,:);
40 Bn = [Bn temp];
41end
42
43
44R = GIM1_R(Bn,'A','FI');
45
46end