Rev | Line | |
---|
[10] | 1 | %INTRDIM Estimate Intrinsic dimension from dissimilarity data
|
---|
| 2 | %
|
---|
| 3 | % K = INTRDIM(D)
|
---|
| 4 | % |
---|
| 5 | % INPUT
|
---|
| 6 | % D NxN Dissimilarity dataset
|
---|
| 7 | %
|
---|
| 8 | % OUTPUT
|
---|
| 9 | % K Estimated intrinsic dimension |
---|
| 10 | %
|
---|
| 11 | % DESCRIPTION
|
---|
| 12 | % It is assumed that the data is generated from a normal distribution
|
---|
| 13 | % in K dimensions and that the Eulcidean distance measure has been used |
---|
| 14 | % to compute D. |
---|
| 15 | % Do NOT supply squared distances! They will definitely generate the wrong
|
---|
| 16 | % result. |
---|
| 17 | % |
---|
| 18 | % EXAMPLE |
---|
| 19 | % A = GENDATB(100); |
---|
| 20 | % D = SQRT(DISTM(A)); |
---|
| 21 | % K = INTRDIM(D); |
---|
| 22 | % |
---|
| 23 | % A = GENDATD(100,10); |
---|
| 24 | % D = SQRT(DISTM(A*SCALEM(A,'VARIANCE'))); |
---|
| 25 | % K = INTRDIM(D); |
---|
| 26 | % |
---|
| 27 |
|
---|
| 28 | % Copyright: R.P.W. Duin, r.p.w.duin@prtools.org
|
---|
| 29 | % Faculty EWI, Delft University of Technology
|
---|
| 30 | % P.O. Box 5031, 2600 GA Delft, The Netherlands
|
---|
| 31 |
|
---|
| 32 | function k = intrdim(d)
|
---|
| 33 |
|
---|
| 34 | d = +d.^2;
|
---|
| 35 | [m,n] = size(d);
|
---|
| 36 |
|
---|
| 37 | % Assume selfreflecting dissim matrix
|
---|
| 38 | if m==n & all(diag(+d) == 0) |
---|
| 39 | d(1:n+1:n*n) = [];
|
---|
| 40 | end
|
---|
| 41 |
|
---|
| 42 | k = round(2*(mean(d(:)).^2)/var(d(:))); % based on Chi square distribution |
---|
Note: See
TracBrowser
for help on using the repository browser.