1function
MMAP = mamap2m_fit_mmap(mmap, fbsWeights)
2% Fits a MAPH(2,m) or A MAMAP(2,m) that matches the characteristics of the
3% mmap. Three characteristics of the marked process are matched either
4% exactly or approximately. Among these, the
class probabilities are always
5% matched exactly. The remaining two characteristics, by
default, are the
6% forward and backward moments, unless the underlying AMAP(2)
is
7% degenerate. Different pairs of characteristics can be chosen by
8% specifying higher weights in the optional parameter fbsWeights.
11% - mmap: the
MMAP to fit
12% - fbsWeights: the weight assigned to forward moments, backward moments
13% and class transition probabilities (default: [1, 1, 1])
15% -
MMAP: fitted MAMAP[m]
18 % by default equal weights
19 % when weights are equal, F+B
is preferred over F+S and B+S
23M1 = map_moment(mmap,1);
24M2 = map_moment(mmap,2);
25M3 = map_moment(mmap,3);
26GAMMA = map_gamma(mmap);
29F = mmap_forward_moment(mmap,1);
30B = mmap_backward_moment(mmap,1);
33MMAP = mamap2m_fit(M1, M2, M3, GAMMA,
P, F, B, S, fbsWeights);