| isomds {pcurve} | R Documentation |
One form of non-metric multidimensional scaling
isomds(d, dim=2, y = cmdscale(d, dim), maxit = 50, trace = TRUE)
d |
distance structure of the form returned by dist or pcdists, or a full, symmetric matrix. Data are assumed to be dissimilarities or relative distances, but must be positive except for self-distance. |
dim |
Number of dimensions in solution. |
y |
An initial configuration. If none is supplied, cmdscale is used to provide the classical solution. |
maxit |
The maximum number of iterations. |
trace |
Logical for tracing optimization. Default TRUE. |
This chooses a k-dimensional (default k = 2) configuration to minimize the stress, the square root of the ratio of the the sum of squared differences between the input distances and those of the configuration to the sum of configuration distances squared. However, the input distances are allowed a monotonic transformation.
An iterative algorithm is used, which will usually converge in around 10 iterations. As this is necessarily an O(n^2) calculation, it is slow for large datasets. Further, since the configuration is only determined up to rotations and reflections (by convention the centroid is at the origin), the result can vary considerably from machine to machine.
Two components:
points |
A matrix of the fitted configuration. |
stress |
The final stress achieved (in percent). |
If trace is true, the initial stress and the current stress are printed out every 5 iterations.
W. N. Venables and B. D. Ripley as part of their MASS library. Minor changes to code for inclusion in pcurve library by Glenn De'ath glenn.death@jcu.edu.au. R port by Chris Walsh Chris.Walsh@sci.monash.edu.au
T. F. Cox and M. A. A. Cox (1994) Multidimensional Scaling. Chapman & Hall.
cmdscale, sammon, pcurve, dist, pcdists
#calculate Bray-Curtis dissimilarity matrix of 45 sites
#based on grassland plant community species and
#calculate and plot MDS from it.
data(soilspec)
species <- sqrt(soilspec[,2:9])
specdist <- pcdists(species, metric = "man", scale = FALSE)
specmds <- isomds(specdist$dnew)
plot(specmds$points, type = "n", xlab = "MDS axis 1",
ylab = "MDS axis 2")
text(specmds$points[,1], specmds$points[,2],
soilspec$site)
mtext(paste("Grassland communities in 45 sites, Stress = ",
0.01*round(specmds$stress, 1)))