1% mrep = FindMarkovianRepresentation(rep, @transfun, @evalfunc, precision)
3% Obtains a Markovian representation from a non-Markovian
4% one
while keeping the size the same, by applying a series
5% of elementary transformations.
9% rep : tuple of matrices
10% The initial non-Markovian representation
11% (initial vector and generator of a PH, matrices of a
12% MAP, or a
MMAP, etc.)
14% A function that transforms the representation
using
15% the given similarity transformation matrix
17% A function that returns how far the representation
is
18% from the Markovian one
20% A representation
is considered to be a Markovian one
21%
if it
is closer than the precision. The
default value
26% mrep : tuple of matrices
27% The Markovian representation,
if found. If not found,
28% the closest one
is returned.
32% This function should not be called directly.
33% It
is used by
'PHFromME',
'MAPFromRAP', etc. functions.
37% .. [1] G Horváth, M Telek,
"A minimal representation of
38% Markov arrival processes and a moments matching
39% method," Performance Evaluation 64:(9-12)
40% pp. 1153-1168. (2007)
42function nrep = FindMarkovianRepresentation (rep, transfun, evalfun, precision)
44 if ~exist(
'precision',
'var')
48 function [bestrep, bestdist] = elementary (erep, b, k, evalfun, transfun)
49 bestdist = evalfun (erep, k);
51 repSize = size(erep{1},2);
55 % create elementary transformation matrix with +b
59 % apply similarity transform
60 newrep = transfun (erep, B);
61 newdist = evalfun (newrep, k);
62 % store result
if better
67 % create elementary transformation matrix with -b
71 % apply similarity transform
72 newrep = transfun (erep, B);
73 newdist = evalfun (newrep, k);
74 % store result
if better
84 function [bestrep, lastdist] = minimize (orep, iters, b, k, evalfun, transfun)
85 lastdist = evalfun (orep, k);
88 [orep, dist] = elementary (orep, b, k, evalfun, transfun);
98 if evalfun(rep) < precision
110 [nrep, ddist] = minimize (nrep, M*M, b, k, evalfun, transfun);