I am planning to write a program that performs MDS. Any pointers to where I can access the pseudo-code for MDS? Thanks!

  • $\begingroup$ what is a pseudo code? $\endgroup$
    – EDi
    Commented Apr 7, 2011 at 16:10
  • $\begingroup$ @EDi en.wikipedia.org/wiki/Pseudocode $\endgroup$
    – whuber
    Commented Apr 7, 2011 at 16:50
  • 1
    $\begingroup$ Try Wikipedia page about MDS, especially the "External links" section. $\endgroup$
    – user88
    Commented Apr 7, 2011 at 18:51

2 Answers 2


There are different kind of MDS (e.g., see this brief review). Here are two pointers:

  • the smacof R package, developed by Jan de Leeuw and Patrick Mair has a nice vignette, Multidimensional Scaling Using Majorization: SMACOF in R (or see, the Journal of Statistical Software (2009) 31(3)) -- R code is available, of course.
  • there are some handouts on Multidimensional Scaling, by Forrest Young, where several algorithms are discussed (including INDSCAL (Individual Difference Scaling, or weighted MDS) and ALSCAL, with Fortran source code by the same author) -- this two keywords should help you to find other source code (mostly Fortran, C, or Lisp).

You can also look for "Manifold learning" which should give you a lot of techniques for dimension reduction (Isomap, PCA, MDS, etc.); the term was coined by the Machine Learning community, among others, and they probably have a different view on MDS compared to psychometricians.


If you have the Statistics Toolbox in MATLAB you can read the source code of mdscale.m. While it's not pseudocode, it will definitely help you understand MDS better and gives you one approach to coding it.

In MATLAB you can type

edit mdscale

and that will open up an editor window that shows you the mdscale.m script that does the work. If you don't have MATLAB, check out Scikits.learn. It has some code for MDS. A lot of times reading Python code is very similar to reading pseudocode!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.