1function JM = mtrace_joint(T, A, i)
2% Given a multi-
class trace, computes
the empirical class-dependent joint
3% moments that estimate E[ ( X^(a)_j )^i(1) (X^(a)_(j+l) )^i(2) ]
7% T:
the inter-
event times
8% A:
the class of each event
9% i: a vector specifying
the power of each variable in
the joint moment
12% JM:
the joint moment of each
class
24 % events of
class a, excluding
the first and last event
25 Ta = T(A(2:(N-1))==a);
26 % number of events of
class a, excluding
the first and last event
31 tmp = tmp + T(j)^i(1) * T(j+1)^i(2);