LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
TransformToAcyclic.m
1% B = TransformToAcyclic(A, maxSize, precision)
2%
3% Transforms an arbitrary matrix to a Markovian bi-diagonal
4% matrix.
5%
6% Parameters
7% ----------
8% A : matrix, shape (N,N)
9% Matrix parameter of the initial representation
10% maxSize : int, optional
11% The maximal order of the resulting Markovian
12% representation. The default value is 100
13% precision : double, optional
14% Matrix entries smaller than the precision are
15% considered to be zeros. The default value is 1e-14
16%
17% Returns
18% -------
19% B : matrix, shape (N,N)
20% Transient (bi-diagonal) generator matrix of the
21% Markovian acyclic representation.
22%
23% Notes
24% -----
25% Calls the 'TransformToMonocyclic' procedure if all the
26% eigenvalues are real, otherwise it raises an error if no
27% Markovian acyclic generator has been found up to the
28% given size.
29%
30% Raises an error if no Markovian acyclic generator
31% has been found up to the given size.
32% % References
33% ----------
34% .. [1] Mocanu, S., Commault, C.: "Sparse representations
35% of phase-type distributions," Stoch. Models 15,
36% 759-778 (1999)
37
38function B = TransformToAcyclic (A, maxSize, precision)
39
40 if ~exist('precision','var')
41 precision = 1e-14;
42 end
43
44 if ~exist('maxSize','var')
45 maxSize = 100;
46 end
47
48 if any(imag(eig(A))>=precision)
49 error 'TransformToAcyclic: Complex eigenvalue found, no acyclic representation exists.';
50 end
51
52 B = TransformToMonocyclic (A, maxSize, precision);
53end