1function [M] = mtrace_moment(T,A,ORDERS,AFTER,NORM)
2% Computes the empirical
class-dependent moments of a multi-
class trace.
3% T: vector of inter-arrival times
4% A: vector of
class labels
5% ORDERS: vector with the orders of the moments to compute
6% AFTER: 0 to compute moments of Horvath variables
7% 1 to compute moments of Bucholz variables
8% NORM: 0 to not normalize, M_i = sum M_{i,c}
9% 1 to normalize, M_i = sum M_{i,c} * g_c
10% where M_i
is the
class independent moment of order i
11% M_{i,c}
is the
class c moment of order i
12% g_c
is the fraction of arrivals of
class c
26M = zeros(C,length(ORDERS));
28for j = 1:length(ORDERS)
32 M(c,j) = mean(T(2:end).^k .* (A(1:(end-1)) == MARKS(c)));
34 M(c,j) = mean(T.^k .* (A==MARKS(c)));
38 M(c,j) = M(c,j) * length(T-1)/sum(A(1:(end-1))==MARKS(c));
40 M(c,j) = M(c,j) * length(T)/sum(A==MARKS(c));