1function S = mmap_count_mcov(mmap, t)
2% Computes the count covariance between each pair of
classes at time scale
5% - mmap: the marked MAP with m
classes
8% - S: the m x m covariance matrix
12% on the diagonal we have the per-
class variance
13mV = mmap_count_var(mmap, t);
19 % compute variance between
this pair of
classes
23 mmap2{3} = mmap{2+i} + mmap{2+j};
24 mmap2{4} = mmap2{2}-mmap2{3};
25 pV = mmap_count_var(mmap2, t);
26 S(i,j) = 1/2*(pV(1) - mV(i) - mV(j));