## create two Gaussian clouds
cl1 <- cbind(rnorm(100,0.2,0.05),rnorm(100,0.8,0.06))
cl2 <- cbind(rnorm(50,0.7,0.08),rnorm(50,0.3,0.05))
x <- rbind(cl1,cl2)
## create negative distance matrix (default Euclidean)
sim1 <- negDistMat(x)
## compute similarities as squared negative distances
## (in accordance with Frey's and Dueck's demos)
sim2 <- negDistMat(x, r=2)
## compute RBF kernel
sim3 <- expSimMat(x, r=2)
Run the code above in your browser using DataLab