Skip to contents

Orthogonal rotation aligning X to X_target (with reflection protection against improper rotations).

Usage

morie_spatial_voting_procrustes(X, X_target)

Arguments

X

Configuration to rotate.

X_target

Target configuration.

Value

List with rotated, rotation_matrix, scale, mse.

References

Gower JC & Dijksterhuis GB (2004). Procrustes Problems. Oxford University Press.

Examples

set.seed(1)
A <- matrix(rnorm(20), 10, 2); B <- A + 0.05 * matrix(rnorm(20), 10, 2)
morie_spatial_voting_procrustes(A, B)
#> $rotated
#>             [,1]        [,2]
#>  [1,] -0.6048588  1.53437971
#>  [2,]  0.1800831  0.39470069
#>  [3,] -0.8614258 -0.59346175
#>  [4,]  1.5334396 -2.24059654
#>  [5,]  0.3422617  1.12636212
#>  [6,] -0.8334508 -0.01763455
#>  [7,]  0.4747624 -0.01798933
#>  [8,]  0.7469495  0.93621907
#>  [9,]  0.5817191  0.81724977
#> [10,] -0.3042888  0.60958562
#> 
#> $rotation_matrix
#>            [,1]        [,2]
#> [1,] 0.99975260 -0.02224258
#> [2,] 0.02224258  0.99975260
#> 
#> $scale
#> [1] 15.61058
#> 
#> $mse
#> [1] 0.001376632
#>