LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
GIM1_Caudal.m
1function [eta,v]=GIM1_CAUDAL(A,varargin)
2%GIM1_CAUDAL Computes the Spectral Radius of R
3%
4% eta=GIM1_CAUDAL(A) computes the dominant eigenvalue of the
5% matrix R, the smallest nonnegative solution to
6% R= A0 + R A1 + R^2 A2 + ... + R^max Amax, if the GI/M/1
7% type Markov chain characterized by A is recurrent
8%
9% [eta,v]=GIM1_CAUDAL(A) computes the dominant eigenvalue of the
10% matrix R, the smallest nonnegative solution to
11% R= A0 + R A1 + R^2 A2 + ... + R^max Amax, if the GI/M/1
12% type Markov chain characterized by A is recurrent.
13% eta is the unique solution of PF(A0 + A1 z + A2 z^2 + ...
14% + Amax z^max) = z on (0,1), where PF denotes the Peron-Frobenius
15% eigenvalue. The right eigenvector v corresponding to the
16% Peron-Frobenius eigenvalue of A(eta) is also returned.
17%
18%
19% Optional Parameters:
20%
21% Dual: When set to 1, the dominant eigenvalue of the Ramaswami
22% dual is returned. The input chain must be a transient
23% M/G/1 type Markov chain.
24
25OptionNames=['Dual '];
26OptionTypes=['numeric'];
27OptionValues=[];
28
29options=[];
30for i=1:size(OptionNames,1)
31 options.(deblank(OptionNames(i,:)))=[];
32end
33
34% Default settings
35options.Dual=0;
36
37% Parse Optional Parameters
38options=ParseOptPara(options,OptionNames,OptionTypes,OptionValues,varargin);
39
40m=size(A,1);
41dega=size(A,2)/m-1;
42
43if (options.Dual == 1)
44 % the dominant eigenvalue of the Ramaswami dual is
45 % identical to the dominant eigenvalue of the GI/M/1 process
46 % characterized by A0,A1, ...
47end
48
49eta_min=0;
50eta_max=1;
51eta=1/2;
52while (eta_max - eta_min > 10^(-15))
53 temp=A(:,dega*m+1:end);
54 for i=dega-1:-1:0
55 temp=temp*eta+A(:,i*m+1:(i+1)*m);
56 end
57 new_eta=max(eig(temp));
58 if (new_eta > eta)
59 eta_min=eta;
60 else
61 eta_max=eta;
62 end
63 eta=(eta_min+eta_max)/2;
64end
65
66if (nargout > 1)
67 [V,D]=eig(temp);
68 v=V(:,find(sum(D,1)==max(sum(D,1))));
69end