12
$\begingroup$

Does Mathematica support MDS? Or, are there any libraries that support it?

Basically, I have points and a distance function defined between them, and I want to plot them in 2D space, trying to minimize the error (stress) in the distance. This is what MDS does. R has support for MDS, but I can't find similar methods in Mathematica, which I think is strange because this seems like a really common thing to want to do...

$\endgroup$
8
  • 2
    $\begingroup$ To my knowledge, there's no built-in functionality for this. Google revealed a package to do this, but I have not used it myself. $\endgroup$
    – Szabolcs
    Jun 17, 2012 at 15:17
  • $\begingroup$ Thanks, I think this is the answer to the question. $\endgroup$ Jun 17, 2012 at 20:47
  • $\begingroup$ Did you try the package? Does it work correctly with version 8? $\endgroup$
    – Szabolcs
    Jun 18, 2012 at 9:52
  • 1
    $\begingroup$ @Sz Graph embedding in two dimensions is actually MDS in disguise. $\endgroup$
    – whuber
    Jun 18, 2012 at 20:11
  • $\begingroup$ Thanks! I didn't know about that. But, there does not seem to be a way to change the edge length (is there?). In my graph some edges would be much longer than others. $\endgroup$ Jun 18, 2012 at 23:06

2 Answers 2

5
$\begingroup$

Here's a link to an article in The Mathematica Journal Vol. 17, with worked out examples and code:

Better late than never!

$\endgroup$
3
$\begingroup$

You might be able to adapt the code in the Multidimensional Scaling demonstration in the Wolfram Demonstrations project.

$\endgroup$
1
  • $\begingroup$ I saw that but, I'm not sure that it works. I tried distances2points[{{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}] and the resulting points do not form an equilateral triangle, as I was expecting. $\endgroup$ Jun 17, 2012 at 17:54

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.