LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mtrace_sigma2.m
1function sigma = mtrace_sigma2(T,L)
2% Computes the empirical probability of observing a specific 3-element
3% sequence of events, i.e. the two-step class transition probabilities.
4% Input:
5% T: the inter-arrival times
6% L: the event labels
7% Output:
8% sigma: the matrix whose (i,j) element is the probability of observing
9% an event of class i followed by an event of class j.
10
11marks = unique(L);
12C = length(marks);
13
14sigma = zeros(C,C,C);
15
16for i = 1:C
17 for j = 1:C
18 for h = 1:C
19 sigma(i,j,h) = sum(L(1:end-2)==marks(i) & ...
20 L(2:end-1)==marks(j) & ...
21 L(3:end)==marks(h));
22 sigma(i,j,h) = sigma(i,j,h) / (length(L)-2);
23 end
24 end
25end