Description Usage Author(s) References Examples
Bayesian Multidimensional Scaling by Oh and Raftery (2001)
1 2 3 4 5 6 7 8 9 |
Kisung You
oh_bayesian_2001DAS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## use simple example of iris dataset with perturbation
data(iris)
dmat = as.matrix(stats::dist(iris[,1:4]))
## run Bayesian MDS
# let's run 49 iterations (CRAN) quietly
iris.cmds = cmds(dmat, ndim=2)
iris.bmds = bmds(dmat, ndim=2, mc.iter=49, par.step=(2.38^2))
## extract coordinates and class information
cx = iris.cmds$embed # embedded coordinates of CMDS
bx = iris.bmds$embed # BMDS
icol = iris[,5] # class information
## visualize
par(mfrow=c(1,2),pty="s")
mc = paste("CMDS with STRESS=",round(iris.cmds$stress,4),sep="")
mb = paste("BMDS with STRESS=",round(iris.bmds$stress,4),sep="")
plot(cx, col=icol,pch=19,main=mc)
plot(bx, col=icol,pch=19,main=mb)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.