LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MinimalRepFromME.m
1% [beta, B] = MinimalRepFromME(alpha, A, how, precision)
2%
3% Returns the minimal representation of the given ME
4% distribution.
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% how : {"obs", "cont", "obscont", "moment"}, optional
15% Determines how the representation is minimized.
16% Possibilities:
17% 'obs': observability,
18% 'cont': controllability,
19% 'obscont': the minimum of observability and
20% controllability order,
21% 'moment': moment order (which is the default).
22% precision : double, optional
23% Precision used by the Staircase algorithm. The default
24% value is 1e-12.
25%
26% Returns
27% -------
28% beta : vector, shape (1,N)
29% The initial vector of the minimal representation
30% B : matrix, shape (N,N)
31% The matrix parameter of the minimal representation
32%
33% References
34% ----------
35% .. [1] P. Buchholz, M. Telek, "On minimal representation
36% of rational arrival processes." Madrid Conference on
37% Qeueuing theory (MCQT), June 2010.
38
39function [beta, B] = MinimalRepFromME (alpha, A, how, precision)
40
41 if ~exist('precision','var')
42 precision=1e-12;
43 end
44 if ~exist('how','var')
45 how='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 if strcmp(how,'cont')
58 H0 = A;
59 H1 = sum(-A,2) * alpha;
60 [B, n] = MStaircase ({H0, H1}, ones(size(A,1),1), precision);
61 beta = alpha*B;
62 beta = beta(1:n);
63 B = inv(B)*A*B;
64 B = B(1:n,1:n);
65 elseif strcmp(how,'obs')
66 H0 = A;
67 H1 = sum(-A,2) * alpha;
68 [B, n] = MStaircase ({H0',H1'}, alpha', precision);
69 beta = alpha*B;
70 beta = beta(1:n);
71 B = inv(B)*A*B;
72 B = B(1:n,1:n);
73 elseif strcmp(how,'obscont')
74 [alphav, Av] = MinimalRepFromME (alpha, A, 'cont', precision);
75 [beta, B] = MinimalRepFromME (alphav, Av, 'obs', precision);
76 elseif strcmp(how,'moment')
77 mo = MEOrder (alpha, A, 'moment', precision);
78 [beta, B] = MEFromMoments(MomentsFromME(alpha, A, 2*mo-1));
79 else
80 error('MinimalRepFromME: Invalid ''how'' parameter!')
81 end
82end
83