Skip to contents

Torgerson scaling via eigendecomposition of the double-centred matrix.

Usage

morie_spatial_voting_classical_mds(D, n_dims = 2L)

Arguments

D

Symmetric numeric distance matrix.

n_dims

Number of dimensions to extract.

Value

A list with coordinates, eigenvalues, stress, fit, B_matrix.

References

Torgerson, W. S. (1952); Armstrong et al. (2021).

Examples

D <- as.matrix(dist(matrix(rnorm(40), 10)))
morie_spatial_voting_classical_mds(D, n_dims = 2)
#> $coordinates
#>             [,1]        [,2]
#>  [1,] -0.9045227  1.23253240
#>  [2,]  1.7367469  0.01038171
#>  [3,]  0.6379009 -0.67999362
#>  [4,] -1.6597743 -0.01264046
#>  [5,] -0.3107453 -1.49452728
#>  [6,]  0.2688576 -0.75337274
#>  [7,]  0.2681814  1.33214099
#>  [8,] -2.1940883 -0.21622109
#>  [9,]  0.9576449  1.16389811
#> [10,]  1.1997989 -0.58219802
#> 
#> $eigenvalues
#> [1] 14.407612  8.297942
#> 
#> $stress
#> [1] 0.210684
#> 
#> $fit
#> [1] 0.7562131
#> 
#> $B_matrix
#>             [,1]       [,2]       [,3]       [,4]       [,5]        [,6]
#>  [1,]  2.8934831 -1.8930816 -1.7523402  2.1499344 -1.4343077 -0.59505879
#>  [2,] -1.8930816  3.7236957  1.2765714 -2.7047302 -0.5421181 -0.66062549
#>  [3,] -1.7523402  1.2765714  1.0752580 -1.4841512  0.7364102  0.37589062
#>  [4,]  2.1499344 -2.7047302 -1.4841512  4.2090525  0.7881009 -0.63114011
#>  [5,] -1.4343077 -0.5421181  0.7364102  0.7881009  2.3748196  1.03718948
#>  [6,] -0.5950588 -0.6606255  0.3758906 -0.6311401  1.0371895  2.41796630
#>  [7,]  0.9769299  0.7413524 -0.4790602 -0.9579661 -2.1691534 -1.38073793
#>  [8,]  0.7109137 -3.4133292 -0.6307025  2.2048828  0.7389656 -1.15495204
#>  [9,]  0.6653337  1.2614786 -0.2201654 -1.8946300 -2.0777852  0.02415205
#> [10,] -1.7218065  2.2107866  1.1022893 -1.6793530  0.5478786  0.56731591
#>             [,7]       [,8]        [,9]      [,10]
#>  [1,]  0.9769299  0.7109137  0.66533369 -1.7218065
#>  [2,]  0.7413524 -3.4133292  1.26147858  2.2107866
#>  [3,] -0.4790602 -0.6307025 -0.22016542  1.1022893
#>  [4,] -0.9579661  2.2048828 -1.89462998 -1.6793530
#>  [5,] -2.1691534  0.7389656 -2.07778524  0.5478786
#>  [6,] -1.3807379 -1.1549520  0.02415205  0.5673159
#>  [7,]  2.1674253 -0.1145517  1.72844291 -0.5126811
#>  [8,] -0.1145517  6.7694873 -2.38293219 -2.7277818
#>  [9,]  1.7284429 -2.3829322  2.53845296  0.3576526
#> [10,] -0.5126811 -2.7277818  0.35765262  1.8556994
#>