Skip to contents

Bayesian MDS (stub) – log-normal distances via Metropolis

Usage

morie_spatial_voting_bayesian_mds(
  D,
  n_dims = 2L,
  n_samples = 1000L,
  burn_in = 200L,
  sigma_init = 1
)

Arguments

D

Distance matrix. @param n_dims Dimensions. @param n_samples MCMC samples.

n_dims

Integer; latent dimensionality.

n_samples

Integer; posterior-sample count.

burn_in

Burn-in length. @param sigma_init Initial sigma.

sigma_init

Numeric; initial value for the latent-coordinate scale (default 1).

Value

List: positions/coords (posterior-mean or modal configuration), fit diagnostics, and an engine tag.

References

Oh & Raftery (2001) JASA 96(455).

Examples

# \donttest{
# A real dissimilarity matrix (the all-zero matrix is degenerate
# and makes the stress majorizer divide by zero).
set.seed(1)
X <- matrix(rnorm(30), 10, 3)
morie_spatial_voting_bayesian_mds(as.matrix(dist(X)))
#> Registered S3 method overwritten by 'gdata':
#>   method         from     
#>   reorder.factor DescTools
#> $coords
#>              [,1]         [,2]
#>  [1,] -0.79965385 -0.002020485
#>  [2,] -0.32993045  0.003300886
#>  [3,]  0.04215058 -0.576291597
#>  [4,]  1.47729848 -0.102368263
#>  [5,] -0.44989621  0.239932662
#>  [6,] -0.08721095 -0.421531000
#>  [7,]  0.14435419  0.016852280
#>  [8,]  0.31238085  0.632129256
#>  [9,]  0.01889416  0.345407300
#> [10,] -0.32838679 -0.135411040
#> 
#> $stress
#> [1] 0.05870263
#> 
#> $n_dims
#> [1] 2
#> 
#> $engine
#> [1] "smacof (deterministic MDS; full Bayesian not ported)"
#> 
# }