Classical (metric) multidimensional scaling
Source:R/spatial_voting.R
morie_spatial_voting_classical_mds.RdTorgerson scaling via eigendecomposition of the double-centred matrix.
Examples
D <- as.matrix(dist(matrix(rnorm(40), 10)))
morie_spatial_voting_classical_mds(D, n_dims = 2)
#> $coordinates
#> [,1] [,2]
#> [1,] 0.4324050 -0.7145873
#> [2,] -1.5082069 0.5011667
#> [3,] -1.0021574 -0.2538114
#> [4,] 1.4226743 -1.6612207
#> [5,] 2.2656658 2.2531028
#> [6,] -2.1548952 0.6026057
#> [7,] -0.5504315 0.4059818
#> [8,] 0.4347682 -1.0406272
#> [9,] 0.4255145 0.3420170
#> [10,] 0.2346633 -0.4346273
#>
#> $eigenvalues
#> [1] 15.99493 10.57909
#>
#> $stress
#> [1] 0.2912767
#>
#> $fit
#> [1] 0.6893002
#>
#> $B_matrix
#> [,1] [,2] [,3] [,4] [,5] [,6]
#> [1,] 1.1500336 -1.4466125 -0.459914484 1.6574752 -0.5390116 -0.48054698
#> [2,] -1.4466125 3.1786662 1.205244368 -2.5310559 -2.6244684 2.45163926
#> [3,] -0.4599145 1.2052444 1.785292419 -1.4407142 -2.4779087 2.01013360
#> [4,] 1.6574752 -2.5310559 -1.440714192 5.2376776 -0.8781933 -4.68027076
#> [5,] -0.5390116 -2.6244684 -2.477908746 -0.8781933 10.4942456 -3.07885597
#> [6,] -0.4805470 2.4516393 2.010133600 -4.6802708 -3.0788560 6.99480093
#> [7,] -1.7407389 2.8170191 0.001559705 -0.2556445 -1.2346597 -1.59413971
#> [8,] 0.8517918 -1.6682687 0.794372778 1.6198372 -0.7674159 -1.10770797
#> [9,] 0.2045281 -0.3453699 -1.257510789 0.4568086 1.3806722 -0.60430051
#> [10,] 0.8029958 -1.0367935 -0.160554659 0.8140801 -0.2744041 0.08924812
#> [,7] [,8] [,9] [,10]
#> [1,] -1.740738855 0.8517918 0.20452809 0.80299576
#> [2,] 2.817019099 -1.6682687 -0.34536991 -1.03679347
#> [3,] 0.001559705 0.7943728 -1.25751079 -0.16055466
#> [4,] -0.255644467 1.6198372 0.45680856 0.81408007
#> [5,] -1.234659724 -0.7674159 1.38067223 -0.27440413
#> [6,] -1.594139712 -1.1077080 -0.60430051 0.08924812
#> [7,] 5.342426293 -1.9508445 0.20137673 -1.58635456
#> [8,] -1.950844509 2.6766281 -1.14920420 0.70081142
#> [9,] 0.201376728 -1.1492042 1.07720838 0.03579142
#> [10,] -1.586354559 0.7008114 0.03579142 0.61518002
#>