1function [fit,m3pps] = m3pp_superpos_fitc_trace(T, A, t, tinf)
2% Superposes k M3PP to fit a multi-
class trace with m
classes.
4% - T: inter-arrival time
6% - t: finite time scale
7% - tinf: near-infinite time scale
9% by
default choose time scales as follows
12 tinf = max(10*t, (sum(T)-T(1)) / 100);
23 pv(j) = sum(A==L(j))/length(A);
27% compute counting process at resolution t1 and tinf
28Nt = mtrace_iat2counts(T, A, t);
29Ninf = mtrace_iat2counts(T, A, tinf);
31% compute IDC(t) e IDC(inf)
36 btv(i) = var(Nt(:,i))/(av(i)*t);
37 binfv(i) = var(Ninf(:,i))/(av(i)*tinf);
38 mt = [mean(Nt(:,i)), mean(Nt(:,i).^2), mean(Nt(:,i).^3)];
39 m3tv(i) = mt(3) - 3*mt(2)*mt(1) + 2*mt(1)^3;
43[fit, m3pps] = m3pp_superpos_fitc(av, btv, binfv, m3tv, t, tinf);