LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mmap_count_mcov.m
1function S = mmap_count_mcov(mmap, t)
2% Computes the count covariance between each pair of classes at time scale
3% t.
4% INPUT
5% - mmap: the marked MAP with m classes
6% - t: the time scale
7% OUTPUT
8% - S: the m x m covariance matrix
9
10m = size(mmap,2)-2;
11
12% on the diagonal we have the per-class variance
13mV = mmap_count_var(mmap, t);
14S = diag(mV);
15
16for i = 1:m
17 for j = 1:m
18 if i ~= j
19 % compute variance between this pair of classes
20 mmap2 = cell(1,4);
21 mmap2{1} = mmap{1};
22 mmap2{2} = mmap{2};
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));
27 end
28 end
29end
30
31end