LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mmap_cross_moment.m
1function MC = mmap_cross_moment(mmap, k)
2% Computes the k-th order moment of the inter-arrival time between an event
3% of class i and an event of class j, for all possible pairs of classes.
4% Input
5% mmap: the MMAP
6% k: order of the moment
7% Output
8% MC: the element in (i,j) is the k-th order moment of the inter-arrival
9% time between an event of class i and an event of class j
10
11
12C = length(mmap)-2;
13
14if map_issym(mmap)
15 TG = sym(zeros(C,1));
16 MC = sym(zeros(C,C));
17else
18 TG = zeros(C,1);
19 MC = zeros(C,C);
20end
21
22for i = 1:C
23 if map_issym(mmap)
24 TG(i) = simplify(sum(map_pie(mmap) * (-mmap{1}\mmap{2+i})));
25 else
26 TG(i) = sum(map_pie(mmap) * (-mmap{1}\mmap{2+i}));
27 end
28end
29
30for i = 1:C
31 start = map_pie(mmap) * (-mmap{1}\mmap{2+i}) / TG(i);
32 for j = 1:C
33 MC(i,j) = factorial(k) * sum(start * (inv(-mmap{1}))^(k+1) * mmap{2+j});
34 MC(i,j) = MC(i,j) / sum(start * (-mmap{1}\mmap{2+j}));
35 end
36end