LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MEOrder.m
1% order = MEOrder(alpha, A, kind, prec)
2%
3% Returns the order of the ME distribution (which is not
4% necessarily equal to the size of the representation).
5%
6% Parameters
7% ----------
8% alpha : vector, shape (1,M)
9% The initial vector of the matrix-exponential
10% distribution.
11% A : matrix, shape (M,M)
12% The matrix parameter of the matrix-exponential
13% distribution.
14% kind : {'obs', 'cont', 'obscont', 'moment'}, optional
15% Determines which order is computed. Possibilities:
16% 'obs': observability,
17% 'cont': controllability,
18% 'obscont': the minimum of observability and
19% controllability order,
20% 'moment': moment order (which is the default).
21% prec : double, optional
22% Precision used to detect if the determinant of the
23% Hankel matrix is zero (in case of kind="moment" only),
24% or the tolerance for the rank calculation. The
25% default value is 1e-10.
26%
27% Returns
28% -------
29% order : int
30% The order of ME distribution
31%
32% References
33% ----------
34% .. [1] P. Buchholz, M. Telek, "On minimal representation
35% of rational arrival processes." Madrid Conference on
36% Qeueuing theory (MCQT), June 2010.
37
38function order = MEOrder (alpha, A, kind, prec)
39
40 if ~exist('prec','var')
41 prec = 1e-10;
42 end
43
44 if ~exist('kind','var')
45 kind = 'moment';
46 end
47
48 global BuToolsCheckInput;
49 if isempty(BuToolsCheckInput)
50 BuToolsCheckInput = true;
51 end
52
53 if BuToolsCheckInput && ~CheckMERepresentation(alpha, A)
54 error('MinimalRepFromME: Input isn''t a valid ME distribution!');
55 end
56
57 N = length(alpha);
58 if strcmp(kind,'cont')
59 re = zeros (N);
60 for n=1:N
61 re(n,:) = sum(A'^(n-1), 1);
62 end
63 order = rank (re, prec);
64 elseif strcmp(kind,'obs')
65 re = zeros (N);
66 for n=1:N
67 re(n,:) = alpha*A^(n-1);
68 end
69 order = rank (re, prec);
70 elseif strcmp(kind,'obscont')
71 re = zeros (N);
72 for n=1:N
73 re(n,:) = alpha*A^(n-1);
74 end
75 obsOrder = rank (re, prec);
76 for n=1:N
77 re(n,:) = sum(A'^(n-1), 1);
78 end
79 contOrder = rank (re, prec);
80 order = min(obsOrder,contOrder);
81 elseif strcmp(kind,'moment')
82 order = MEOrderFromMoments (MomentsFromME (alpha, A), prec);
83 else
84 error('MEOrder: Invalid ''kind'' parameter!')
85 end
86end
87