[R] Uses of isoMDS()
Prof Brian Ripley
ripley at stats.ox.ac.uk
Mon Jun 6 11:35:46 CEST 2005
The answer to Q1 is in the reference on the help page: isoMDS is support
software for a book. It is quoted as a percentage (as the help page says).
Q2 is about linking R to C, not C to R. You can embed R in your C
program: see `Writing R Extensions', but it is definitely messier.
On Mon, 6 Jun 2005, Ross Clement wrote:
> Hi. I'm using the isoMDS() function of the MASS library for
> multidimensional scaling. I have two questions that I have not been able
> to solve by searching through the archives.
>
> (i) What is the exact stress measure used? The text in the help file
> says:
>
> This chooses a k-dimensional (default k = 2) configuration to
> minimize the stress, the square root of the ratio of 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.
>
> I presume that this is Stress-1 from Kruskal's 1964 paper
> "Multidimensional scaling by optimising goodness of fit to nonmetric
> hypothesis". (I haven't got a copy of this paper but have Borg and
> Groenen's book which references it). However, I'm not 100% sure given
> the text description in the help file, and note that isoMDS() quotes
> stress as a percentage.
>
> As a preparation for using MDS I wrote some MDS code using iterative
> majorisation. While I'm sure that isoMDS() produces much better results,
> I would still like to do a like-for-like comparison. If I use a straight
> correlation measure between the original and recreated distances, then
> isoMDS() is considerably (typically about 0.05) better than my program,
> but I'd like to have the proper stress comparison.
>
> (ii) I write most of my code in C. I haven't been able to pin down
> exactly what the status of linking C to R is. At present I do the
> following:
>
> if ( experiment == MDS )
> {
> writeDistData( "temp.csv" );
> system( "R --no-save < rEuclidean.R >> /dev/null" );
> reread( "temp.points" );
> }
> else if ( experiment == PCA )
> {
> writeRawData( "temp.csv" );
> system( "R --no-save < rEuclidean.pca.R >> /dev/null" );
> reread( "temp.scores" );
> }
>
> with appropriate R commands in the .R files.
>
> This was easy to write, seems to work fine, and doesn't seem too slow.
> But, I'd still like to ask if there is a tidier way of achieving the
> same effect.
> Thanks in anticipation,
>
> Ross-c
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list