LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mmap_backward_moment.m
1function MOMENTS = mmap_backward_moment(MMAP,ORDERS,NORM)
2% Computes the theoretical backward moments of an MMAP.
3% Input:
4% - MMAP: the MMAP
5% - ORDERS: vector with the orders of the moments to compute
6% - NORM: 0 (default) to return B_{i,c}: M_i = sum B_{i,c}
7% 1 to return B_{i,c}: M_i = sum B_{i,c} * p_c
8% where
9% M_i is the class independent moment of order i
10% B_{i,c} is the class-c backward moment of order i
11% p_c is the probability of arrivals of class c
12% Output:
13% - MOMENTS: the backard moments as a matrix B(c,i) = B_{i,c}
14
15% by default moments are normalized
16if nargin == 2
17 NORM = 1;
18end
19
20C = length(MMAP)-2;
21K = length(ORDERS);
22
23if (map_issym(MMAP))
24 MOMENTS = sym(zeros(C,K));
25else
26 MOMENTS = zeros(C,K);
27end
28
29pie = map_pie(MMAP);
30M = inv(-MMAP{1});
31
32for a = 1:C
33 if NORM
34 pa = sum(pie * (-MMAP{1}\MMAP{2+a}));
35 else
36 pa = 1;
37 end
38 for h = 1:length(ORDERS)
39 k = ORDERS(h);
40 fk = factorial(k);
41 MOMENTS(a,h) = fk/pa * sum(pie * M^(k+1) * MMAP{2+a});
42 end
43end
44
45end