I am trying to project a new point A(x, y, z)
into a predefined MDS space in R
. This is what I have so far:
set.seed(1)
x <- matrix(rnorm(3*10), ncol = 3)
DM <- dist(x)
MDS <- cmdscale(DM)
# New data point to be projected
A <- c(1, 2, 3)
I am not including A
directly into x
then fitting the MDS because it would affect the space coordinates. Is there a practical solution?
EDIT
I believe I found a solution by estimating the betas to predict the MDS axis:
x1 <- cbind(1, x) # add intercept
B <- solve(t(x1) %*% x1) %*% t(x1) %*% MDS # Betas
> MDS
[,1] [,2]
[1,] -1.80789362 0.06801597
[2,] -0.64418055 -0.21163109
[3,] 0.04694820 -1.27040928
[4,] 3.39617277 -0.21657115
[5,] -0.96981358 0.46269025
[6,] -0.24716695 -0.79861234
[7,] 0.33620625 0.02618564
[8,] 0.62473570 1.35544267
[9,] 0.01895042 0.80023822
[10,] -0.75395865 -0.21534889
> x1 %*% B # same as MDS
[,1] [,2]
[1,] -1.80789362 0.06801597
[2,] -0.64418055 -0.21163109
[3,] 0.04694820 -1.27040928
[4,] 3.39617277 -0.21657115
[5,] -0.96981358 0.46269025
[6,] -0.24716695 -0.79861234
[7,] 0.33620625 0.02618564
[8,] 0.62473570 1.35544267
[9,] 0.01895042 0.80023822
[10,] -0.75395865 -0.21534889
A <- c(1, 2, 3)
A <- c(1, A) # add intercept
> A %*% B # coordinates of A in the MDS plane
[,1] [,2]
[1,] -2.759456 0.5927178
Is my procedure correct?
x
represent some scores from participants, andA
represent a "perfect score". $\endgroup$cmdscale
which is just PCA and not really MDS. "Classical multidimensional scaling (MDS) of a data matrix. Also known as principal coordinates analysis (Gower, 1966)." rdocumentation.org/packages/stats/versions/3.5.1/topics/…. If that's what you want, then projecting a new point is trivial (as per your Edit). $\endgroup$