Multidimensional Scaling
From Knowledge Discovery
from the Matlab statitics toolbox; see also mdscaledemo.m
function [Y,stress,disparities] = mdscale(D,p,varargin)
MDSCALE Non-Metric and Metric Multidimensional Scaling.
Y = MDSCALE(D,P) performs non-metric multidimensional scaling on the N-by-N dissimilarity matrix D, and returns Y, a configuration of N points (rows) in P dimensions (cols). The Euclidean distances between points in Y approximate a monotonic transformation of the corresponding dissimilarities in D. By default, MDSCALE uses Kruskal's normalized STRESS1 criterion.
You can specify D as either a full N-by-N matrix, or in upper triangle form such as is output by PDIST. A full dissimilarity matrix must be real and symmetric, and have zeros along the diagonal and non-negative elements everywhere else. A dissimilarity matrix in upper triangle form must have real, non-negative entries. MDSCALE treats NaNs in D as missing values, and ignores those elements. Inf is not accepted.
You can also specify D as a full similarity matrix, with ones along the diagonal and all other elements less than one. MDSCALE tranforms a similarity matrix to a dissimilarity matrix in such a way that distances between the points returned in Y approximate sqrt(1-D). To use a different transformation, transform the similarities prior to calling MDSCALE.
[Y,STRESS] = MDSCALE(D,P) returns the minimized stress, i.e., the stress evaluated at Y.
copyright matlab
