1function
MMAP = mmap_mixture(PHs, P2)
2% Fits a
MMAP with m classes
using a mixture of m^2 PH-distributions.
3% PH{i,j} represents
the IAT distribution conditioned
4% on
the fact that
the last arrival was of
class i and
the next arrival
is
5% of
class j. Currently,
the PH distributions are of
the second order,
6% hence
the cross moments of order 1, 2 and 3 are required.
9% - PHs: PH distributions
10% - P2: two-step
class transition probabilities
13% - PHs:
the fitted PH-distributions
for each transition
19MMAP{1} = zeros(2*m^2, 2*m^2);
20MMAP{2} = zeros(2*m^2, 2*m^2);
22 MMAP{2+i} = zeros(2*m^2, 2*m^2);
30 MMAP{1}(first:last,first:last) = PHs{i,j}{1};
46 Q = (-PHs{i1,j1}{1}) * ones(2,1) * map_pie(PHs{i2,j2});
52 MMAP{2}(firstr:lastr,firstc:lastc) = p * Q;
53 MMAP{2+j1}(firstr:lastr,firstc:lastc) = p * Q;