LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
MonocyclicPHFromME.m
1% [beta, B] = MonocyclicPHFromME(alpha, A, maxSize, precision)
2%
3% Transforms an arbitrary matrix-exponential representation
4% to a Markovian monocyclic representation.
5%
6% Parameters
7% ----------
8% alpha : matrix, shape (1,N)
9% Initial vector of the distribution
10% A : matrix, shape (N,N)
11% Matrix parameter of the distribution
12% maxSize : int, optional
13% The maximum number of phases for the result. The default
14% value is 100.
15% precision : double, optional
16% Vector and matrix entries smaller than the precision
17% are considered to be zeros. The default value is 1e-14.
18%
19% Returns
20% -------
21% beta : matrix, shape (1,M)
22% The initial probability vector of the Markovian
23% monocyclic representation
24% B : matrix, shape (M,M)
25% Transient generator matrix of the Markovian
26% monocyclic representation
27%
28% Notes
29% -----
30% Raises an error if no Markovian monocyclic representation
31% has been found.
32%
33% References
34% ----------
35% .. [1] Mocanu, S., Commault, C.: "Sparse representations of
36% phase-type distributions," Stoch. Models 15, 759-778
37% (1999)
38
39function [beta, B] = MonocyclicPHFromME (alpha, A, maxSize, precision)
40
41 if ~exist('precision','var')
42 precision = 1e-14;
43 end
44
45 if ~exist('maxSize','var')
46 maxSize = 100;
47 end
48
49 G = TransformToMonocyclic (A, maxSize, precision);
50
51 % find transformation matrix
52 T = SimilarityMatrix (A, G);
53 gamma = real(alpha*T);
54
55 if min(gamma) > -precision
56 beta = gamma;
57 B = G;
58 else
59 [beta, B] = ExtendToMarkovian (gamma, G, maxSize, precision);
60 end
61
62 if ~CheckPHRepresentation(beta, B, precision)
63 error('MonocyclicPHFromME: No monocyclic representation found up to the given size and precision!');
64 end
65end