1% [beta, B] = PHFromME(alpha, A, precision)
3% Obtains a Markovian representation of a matrix
4% exponential distribution of the same size,
if possible.
8% alpha : vector, shape (1,M)
9% The initial vector of the matrix-exponential
11% A : matrix, shape (M,M)
12% The matrix parameter of the matrix-exponential
14% precision : double, optional
15% A representation
is considered to be a Markovian one
16%
if it
is closer than the precision. The
default value
21% beta : vector, 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
30% .. [1] G Horváth, M Telek,
"A minimal representation of
31% Markov arrival processes and a moments matching
32% method," Performance Evaluation 64:(9-12) pp.
35function [beta, B] = PHFromME (alpha, A, precision)
37 function nrep = transfun (orep, B)
38 nrep = {orep{1}*B, inv(B)*orep{2}*B};
41 function d = evalfun (orep, k)
48 Ad = Ao - diag(diag(Ao));
50 d = -min([min(ao), min(av), min(min(Ad))]);
52 d = -sum(ao(ao<0)) - sum(av(av<0)) - sum(sum(Ad(Ad<0)));
56 if ~exist(
'precision',
'var')
60 global BuToolsCheckInput;
61 if isempty(BuToolsCheckInput)
62 BuToolsCheckInput = true;
65 if BuToolsCheckInput && ~CheckMERepresentation(alpha, A)
66 error('PHFromME: Input isn''t a valid ME distribution!');
69 nrep = FindMarkovianRepresentation ({alpha, A}, @transfun, @evalfun, precision);