Line | |
---|
1 | %NEF Compute Negative Eigen Fraction from dataset or mapping
|
---|
2 | %
|
---|
3 | % F = NEF(D)
|
---|
4 | % F = NEF(W)
|
---|
5 | %
|
---|
6 | % INPUT
|
---|
7 | % D - Dissimilarity matrix
|
---|
8 | % W - Pseudo-Euclidean mapping
|
---|
9 | %
|
---|
10 | % OUTPUT
|
---|
11 | % F - Negative eigenfraction
|
---|
12 | %
|
---|
13 | % DESCRIPTION
|
---|
14 | % The Negative eigenfraction is a ratio expressing the sum of
|
---|
15 | % magnitudes of all negative eigenvalues divided by the sum of
|
---|
16 | % magnitudes of all eigenvalues. The necessary numbers are
|
---|
17 | % stored in W = PE_EM(D). W is computed from D is needed.
|
---|
18 | %
|
---|
19 | % SEE ALSO
|
---|
20 | % DATASETS, MAPPINGS, PE_EM, CHECKEUCL
|
---|
21 |
|
---|
22 | function f = nef(input)
|
---|
23 |
|
---|
24 | if isdataset(input)
|
---|
25 | w = pe_em(input);
|
---|
26 | elseif ~ismapping(input)
|
---|
27 | error('Input should be dataset or mapping')
|
---|
28 | else
|
---|
29 | w = input;
|
---|
30 | end
|
---|
31 |
|
---|
32 | eval = abs(getdata(w,'eval'));
|
---|
33 | sig = getdata(w,'sig');
|
---|
34 | f = 1-sum(eval(1:sig(1)))/sum(eval);
|
---|
35 |
|
---|
36 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.