I am having a hard time using mdscale.
Basically, I have a series of distance matrices that I want to reconstruct into Cartesian coordinates. Due to missing values, I can't use cmdscale. This is all well and good, because that's what mdscale is for.
However, mdscale only has two possible options that will work with regards to the starting configuration. One is ('Start','random'), which I don't want. I want it to start at the same point every time.
The problem is, I do not understand how to pass a specific starting configuration into mdscale! The documentation only says this:
"An n-by-p matrix of initial locations, where n is the size of the matrix D and p is the number of columns of the output matrix Y. In this case, you can pass in  for p and mdscale infers p from the second dimension of the matrix. You can also supply a three-dimensional array, implying a value for 'Replicates' from the array's third dimension."
But, to be blunt, this doesn't make any $%*&$*%(& sense!
Okay, so an n-by-p matrix, where n is the size of D and p is the number of columns in Y. I am doing two-dimensional analysis, so p is 2. Let's say my matrix D is 6x6. So I need a 6 by 2 matrix ... but what values do I use?! What does it mean "matrix of initial locations"? Is it all zeros with a 1 where I want to start? This is incredibly confusing, and it bothers me that nowhere in the Matlab documentation for mdscale do they even give an example of how to use a starting configuration beside 'random' (or cmdscale).
Can anybody help me here? If I just want it to start at the 1st cell of my input matrix, for example, how do I define this n-by-p starting configuration matrix?
No products are associated with this question.
You could set R=rand(6,2) outside the function, and try using that as the 'Start' argument each time you run the function. This would be random at first, but then you could use it repeatedly.
The idea is that the function apparently needs a set of 6 2-D points, which it will try to modify iteratively to match up to the distance matrix you supply.
I would imagine that, if you had some idea of a reasonable set of coordinates to come close to matching your distance matrix, that would help. But it appears that the function is willing to try generating points at random, so perhaps it will perform reasonably well even if you generate your own points at random.
You want to reconstruct the cartesian coordinates of six points from their 6x6 distance matrix. What would such a reconstruction look like? In MATLAB, at least in this case, it would be a 6 (points) -by- two (dimensions) matrix. Each row is the two coordinates of a point -- (x,y) if you will. The 6z2 matrix you pass into mdscale is simply your initial guess at that. It's the same kind of thing that mdscale returns when it's done. As Tom says, your guess might be rand(6,2), or you might have some better idea of what the coordinates ought to be.
I'm not sure what you mean by
the 1st cell of my input matrix
but the matrix of initial locations that you pass in has to be a set of six (x,y) coordinates.
Play games and win prizes!Learn more