From: Jari Oksanen <jarioksa_at_sun3.oulu.fi>

Date: Thu 21 Apr 2005 - 00:21:43 EST

Date: Thu 21 Apr 2005 - 00:21:43 EST

On Wed, 2005-04-20 at 12:35 +0200, Domenico Cozzetto wrote:

> Thanks for the attention paid to my rpoblem. Please find enclosed

*> the matrix with my dissimilarities. This is the only case in
**> which sammon(), from the MASS package, gives me this kind of problems.
**> I'm using the implementation of sammon provided by the package MASS and the
**> starting configuration is the default one.
**> Here are the values for the other actual parameters
**> niter = 100, trace = FALSE, magic = 0.2, tol = 1e-4
**>
*

Domenico,

I had a look at your dissimilarity matrix, and indeed, they gave all NaN in sammon() of MASS. This is speculation: sammon() uses cmdscale to get starting configuration, and cmdscale puts two points (20 and 21) at zero distance from each other. Sammon scaling checks against zero dissimilarities in input, put it seems that it doesn't check against zero dissimilarities in starting configuration. Moving one point slightly seems to solve your problem. In the following, diss is the dissimilarity matrix you sent. The trick is to calculate the same starting configuration that sammon() would use (y), but then move one of the conflicting points slightly and give that as the starting configuration:

> y <- cmdscale(diss)

> range(dist(y))

[1] 0.000000 1.443101

> y[21,] <- y[21,] + 0.01

> sam <- sammon(diss, y)

Initial stress : 0.23260 stress after 10 iters: 0.09420, magic = 0.461 stress after 20 iters: 0.08072, magic = 0.500 stress after 30 iters: 0.07838, magic = 0.500 stress after 40 iters: 0.07754, magic = 0.500 stress after 50 iters: 0.07710, magic = 0.500 stress after 60 iters: 0.07681, magic = 0.500 stress after 70 iters: 0.07663, magic = 0.500 stress after 80 iters: 0.07653, magic = 0.500

cheers, jari oksanen

-- Jari Oksanen <jarioksa@sun3.oulu.fi> ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlReceived on Thu Apr 21 00:32:51 2005

*
This archive was generated by hypermail 2.1.8
: Fri 03 Mar 2006 - 03:31:17 EST
*