1% [beta, B] = AcyclicDPHFromMG(alpha, A, precision)
3% Transforms a matrix-geometric representation to an acyclic
4% DPH representation of the same size,
if possible.
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% precision : double, optional
13% Vector and matrix entries smaller than the precision
14% are considered to be zeros. The
default value
is 1e-14.
18% beta : matrix, shape (1,M)
19% The initial probability vector of the acyclic discrete
20% phase-type representation
21% B : matrix, shape (M,M)
22% Transition probability matrix of the acyclic discrete
23% phase-type representation
27% Contrary to
'AcyclicPHFromME' of the
'ph' package,
this
28% procedure
is not able to extend the size in order to obtain
29% a Markovian initial vector.
31% Raises an error
if A has complex eigenvalues. In
this case
32% the transformation to an acyclic representation
is not
35function [beta,B] = AcyclicDPHFromMG (alpha, A, prec)
37 if ~exist(
'prec',
'var')
41 global BuToolsCheckInput;
43 if isempty(BuToolsCheckInput)
44 BuToolsCheckInput = true;
47 if BuToolsCheckInput && ~CheckMGRepresentation(alpha, A)
48 error('AcyclicDPHFromMG: Input isn''t a valid MG distribution!');
53 if max(abs(imag(lambda)))>prec
54 error('AcyclicDPHFromMG: The input matrix has complex eigenvalue!');
57 lambda2 = EigSort(lambda);
58 lambda3 = lambda2(lambda2~=lambda2(end));
59 mx = diag(lambda2)+diag(1-lambda3, 1);
60 T = SimilarityMatrix (A, mx);
64 if ~CheckDPHRepresentation (beta, B, prec)
65 error('AcyclicDPHFromMG: No acyclic representation found!');