1function [M] = mtrace_forward_moment(T,A,ORDERS,NORM)
2% Computes
the forward moments of a marked trace.
4% - T:
the inter-arrival times
6% - ORDERS: vector with
the orders of
the moments to compute
7% - NORM: 0 to
return F_{i,c}: M_i = sum F_{i,c}
8% 1 (
default) to
return F_{i,c}: M_i = sum F_{i,c} * p_c
10% M_i
is the class independent moment of order i
11% F_{i,c}
is the class-c forward moment of order i
12% p_c
is the probability of arrivals of
class c
14% - MOMENTS:
the forward moments as a matrix F(c,i) = F_{i,c}
16% by
default, moments are normalized
25M = zeros(C,length(ORDERS));
27for j = 1:length(ORDERS)
30 M(c,j) = mean(T(2:end).^k .* (A(1:(end-1)) == MARKS(c)));
32 M(c,j) = M(c,j) * length(T-1)/sum(A(1:(end-1))==MARKS(c));