if (FALSE) {
## Replicate the numerical example from the paper
# Data Preparation
set.seed(100)
dim.true = 3 # true dimension
dim.embed = 100 # embedding space (high-d)
npoints = 1000 # number of samples to be generated
v = matrix(runif(dim.embed*dim.true),ncol=dim.embed)
coeff = matrix(runif(dim.true*npoints), ncol=dim.true)
X = coeff%*%v
# see the effect of neighborhood size
out1 = do.spmds(X, neigs=100, type=c("proportion",0.10))
out2 = do.spmds(X, neigs=100, type=c("proportion",0.25))
out3 = do.spmds(X, neigs=100, type=c("proportion",0.50))
# visualize the results
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3))
plot(out1$Y, main="10% neighborhood")
plot(out2$Y, main="25% neighborhood")
plot(out3$Y, main="50% neighborhood")
par(opar)
}
Run the code above in your browser using DataLab