Hi Philipp,
Landmark MDS can work with non-Euclidean distances, such as correlation distances. However, it's important to note that the classical MDS assumes Euclidean distances, so when using non-Euclidean distances, one typically uses a variant of MDS known as non-metric MDS.
Here's a conceptual outline of how you might implement landmark MDS in MATLAB using non-Euclidean distances:
- Select Landmarks: Choose a subset of your points to be landmarks. The choice of landmarks can be random, uniform, or based on some heuristic.
- Compute Distance Matrices: Calculate the distance matrix between landmarks and between each point and the landmarks. Since you mentioned correlation distance, you can use MATLAB's pdist function with the 'correlation' option.
- Classical MDS on Landmarks: Apply classical MDS to the landmarks to find their positions in the lower-dimensional space.
- Map Remaining Points: Use the positions of the landmarks and the distances of the remaining points to the landmarks to estimate the positions of the remaining points in the lower-dimensional space.
Here is a MATLAB example that demonstrates these steps with a correlation distance matrix:
landmarkIndices = randperm(size(data, 1), numLandmarks);
landmarkData = data(landmarkIndices, :);
landmarkDists = pdist(landmarkData, 'correlation');
D_XL = pdist2(data, landmarkData, 'correlation');
landmarkDistsSquare = squareform(landmarkDists);
[Y_landmarks, ~] = cmdscale(landmarkDistsSquare);
[Y, stress, disparities] = mdscale(D_XL, 2, 'Criterion', 'stress', 'Start', Y_landmarks);
Please note that the mdscale function with the 'stress' criterion is used for non-metric MDS, which is appropriate for non-Euclidean distances. The 'Start' parameter is set to the positions of the landmarks obtained from the classical MDS step to provide a good starting point for the optimization.
This is a simplified example, and the actual implementation may require additional considerations based on the specifics of your data and the desired outcome.
Please find below some documentation which will be helpful in your implementation:
Hope it helps!