0

I have a set of nodes in a system with imprecise distances between them. Each node sits at a unique point in a grid setting.

When I apply the smacof-MDS algorithm on my dataset I can "visually" identify the original grid, however I want to script it to identify if the mds output matches the original grid.

The MDS output: download "mds_coordinates.Rdata"

# mds_node_coordinates <- smacofSym(distance_matrix,ndim=2, type="ratio")
load("mds_coordinates.Rdata") # load the output of above smacofSym call
plot(mds_node_coordinates)

Output Image: MDS plot

What I want to match it to is:

orgGrid <- data.frame(D1=c(2,4,6,8,10,2,4,6,8,10,2,4,6,8,10,2,4,6,8,10), D2=rev(c(rep(12,5),rep(9,5), rep(6,5),rep(3,5) )))
row.names(orgGrid) <- 0:19
library(ggplot2); 
ggplot(orgGrid, aes(x=D1, y=D2)) + geom_text(label=row.names(orgGrid),vjust=-1) + geom_point() + 
                                   scale_x_discrete(breaks=seq(0,11,2), limits=c(0:12)) + scale_y_discrete(breaks=seq(0,13,3), limits=c(0:13)) +
                                   theme_update(panel.grid.major=element_blank(),panel.grid.minor=element_blank(), panel.background=element_rect(color="white")) + theme_bw()

Output Image: [Original grid, to which MDS output should be snapped (link in the comment)]

As a quick and dirty solution, I could scale the MDS output to my grid size and snap the MDS points to the closest points in the grid.

I am wondering if there is a more elegant solution to tell that these two grids are identical.

Thanks

Onur
  • 317
  • 1
  • 2
  • 13
  • Original Grid: [http://i.stack.imgur.com/ivwtV.png](http://i.stack.imgur.com/ivwtV.png) – Onur Feb 03 '15 at 15:46
  • Can you explain what "identical" means here, as you've indicated you're willing to snap, aka *move* points to nearest grid points? – Carl Witthoft Feb 03 '15 at 16:53
  • When you look at the plots you can see that the relative positions of data points are same. Such as point 0 has point 1 adjacent on one side and point 5 adjacent on the other axis. One can "visually" identify that the MDS output is a 4x5 grid with some regularity. So I want to code that these two "settings" are identical as they are visually. thanks. – Onur Feb 03 '15 at 17:05

0 Answers0