How to modify mdscale such as to deal with non-Euclidean metric?

I would like to do non-metric multi-dimensional scaling with non-Euclidean metric. That is: the distances in the configuration should be calculated with a p-norm, where p is not necessarily equal to 2. I looked into the source code of mdscale but it seems I am not clever enough to identify the lines that I would have to change. Though it might be quite easy, given that "norm" is able to calculate any type of p-norm, not only the Euclidean one. Hopefully it is one of these calls to norm and I would only have to add a parameter there. If this is not the place where such a question should be asked then please tell me where I should ask this question.
Thanks, Chris

 채택된 답변

Peter Perkins
Peter Perkins 2012년 8월 23일
편집: Peter Perkins 2012년 8월 23일
Chris, you may mean one of two things:
1) You may want to do MDS on a dissimilarity matrix that contains non-Euclidean distances. There is nothing special you need to do in this case. MDSCALE accepts a dissimilarity matrix, and it doesn't know or care where it came from.
2) You may want to do MDS where the stress criterion is based on comparing your dissimilarities to non-Euclidean distances between the configuration of points that MDSCALE creates. I can't say whether that is a good thing to do or not. It seems funny to me, since the goal of MDS is in many cases to provide a visualization, and Euclidean distance is what you'll "see" if you plot the points. But if you really want to do this, for whatever reason, I think what you'd need to do is to modify the local functions in mdscale.m that compute the stress criteria. Those functions each take a set of points, a set of disparities, and compute the stress by, more or less, comparing the pairwise distances between the points to the disparities. In most of them, the easy part is to replace
distances = pdist(Y);
with
distances = pdist(Y,'minkowski',p);
but you still have to work out the gradient of your modified "stress" with respect to the point coordinates, and change that part of each local function. The various criteria are defined in the literature, including the references that you'll find near the top of mdscale.m You'll probably also need to modify the call to pdist earlier in the section of the main loop that computes the disparities for non-metric scaling.
I don't think any of this will work for the strain criterion, it may work for the others as long as you're using a Minkowski metric. But you are on your own. Hope this helps.

댓글 수: 1

Thanks, Peter. Sorry I could come back to your answer only today. It is definitively 2), and I know of the inherent implausibility of a configuration where what you see is not what MDS thinks about the distances. In my case MDS is not so much about "visualization" but about "the truth", i.e. the nature of semantic space. Replacing the pdist lines seems easy enough. I will to have a look on the gradient calculations to see in how far they depend on the pdist type. I hope I will see light... (any hints welcome).
Best, Chris

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Adam
Adam 2012년 11월 11일

0 개 추천

Hi. I am running mdscale on a dissimilarity matrix that includes some NaNs as I only know the distance between certain vertices. However, I also want to impose a minimum distance limit such that no two points are closer than this value. Is this possible? Thanks!

카테고리

도움말 센터File Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by