source: distools/nef.m @ 148

Last change on this file since 148 was 10, checked in by bduin, 14 years ago
File size: 816 bytes
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
22function f = nef(input)
23
24if isdataset(input)
25        w = pe_em(input);
26elseif ~ismapping(input)
27        error('Input should be dataset or mapping')
28else
29        w = input;
30end
31
32eval = abs(getdata(w,'eval'));
33sig  = getdata(w,'sig');
34f = 1-sum(eval(1:sig(1)))/sum(eval);
35
36
Note: See TracBrowser for help on using the repository browser.