Rev | Line | |
---|
[10] | 1 | %CHECKSUBEUCL Find probabilities for non-Euclidean subsets
|
---|
| 2 | %
|
---|
| 3 | % NEP = CHECKSUBEUCL(D,N)
|
---|
| 4 | %
|
---|
| 5 | % For every size of subsets of the dissimilarity matrix D at random
|
---|
| 6 | % N of such subsets are taken and checked on their Euclideaness.
|
---|
| 7 | % In NEP(n) the fraction of non-Euclidean subsets is returned for
|
---|
| 8 | % subsets of size n. Default N = 500.
|
---|
| 9 |
|
---|
| 10 | % SEE ALSO
|
---|
| 11 | % PSEM, CHECKEUCL, CHECKTR
|
---|
| 12 |
|
---|
| 13 | % Copyright: R.P.W. Duin, r.p.w.duin@prtools.org
|
---|
| 14 | % Faculty EWI, Delft University of Technology
|
---|
| 15 | % P.O. Box 5031, 2600 GA Delft, The Netherlands
|
---|
| 16 |
|
---|
| 17 | function nep = checksubeucl(d,reps)
|
---|
| 18 |
|
---|
| 19 | if nargin < 2 | isempty(reps), reps = 500; end
|
---|
| 20 | discheck(d)
|
---|
| 21 | m = size(d,1);
|
---|
[79] | 22 | d = prdataset(+d,1);
|
---|
[10] | 23 | d = setfeatlab(d,ones(m,1));
|
---|
| 24 |
|
---|
| 25 | [nef ner] = checkeucl(d);
|
---|
| 26 | nep = zeros(1,m);
|
---|
| 27 | if ner > 1e-6
|
---|
| 28 | s = sprintf('Check sub-euclidean probs %i trials: ',reps);
|
---|
| 29 | prwaitbar(reps,s);
|
---|
| 30 | for n=1:reps
|
---|
| 31 | prwaitbar(reps,n,[s int2str(n)]);
|
---|
| 32 | J = randperm(m);
|
---|
| 33 | for j=3:m
|
---|
| 34 | [nef ner] = checkeucl(d(J(1:j),J(1:j)));
|
---|
| 35 | if ner>1e-6
|
---|
| 36 | nep(j:end) = nep(j:end) + 1;
|
---|
| 37 | break
|
---|
| 38 | end
|
---|
| 39 | end
|
---|
| 40 | end
|
---|
| 41 | nep = nep/reps;
|
---|
| 42 | prwaitbar(0)
|
---|
| 43 | end
|
---|
| 44 | |
---|
Note: See
TracBrowser
for help on using the repository browser.