bmds: Bayesian Multidimensional Scaling by Oh and Raftery (2001)

Description Usage Author(s) References Examples

View source: R/ml_bmds.R

Description

Bayesian Multidimensional Scaling by Oh and Raftery (2001)

Usage

1
2
3
4
5
6
7
8
9
bmds(
  x,
  ndim = 2,
  par.a = 5,
  par.alpha = 0.5,
  par.step = 1,
  mc.iter = 8128,
  verbose = FALSE
)

Author(s)

Kisung You

References

\insertRef

oh_bayesian_2001DAS

Examples

 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)

kisungyou/DAS documentation built on Jan. 6, 2020, 7:09 a.m.