LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mtrace_sigma.m
1function sigma = mtrace_sigma(T,L)
2% Computes the empirical probability of observing a specific 2-element
3% sequence of events, i.e. the one-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);
15
16for i = 1:C
17 for j = 1:C
18 sigma(i,j) = sum(L(1:end-1)==marks(i) & L(2:end)==marks(j));
19 sigma(i,j) = sigma(i,j) / (length(L)-1);
20 end
21end