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 & Dijksterhuis (2004).

Examples

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.38518938  0.35781256
#>  [2,] -0.05795609  0.76806132
#>  [3,]  1.11792627 -0.09060922
#>  [4,]  0.76224325  0.89625854
#>  [5,] -0.15610217  0.39570030
#>  [6,] -0.22571266 -0.61593886
#>  [7,]  0.70631279  0.35510889
#>  [8,]  0.59400485 -1.11777627
#>  [9,] -0.69992237  1.42046066
#> [10,] -0.72906890  1.96738144
#> 
#> $rotation_matrix
#>             [,1]       [,2]
#> [1,]  0.99981913 0.01901883
#> [2,] -0.01901883 0.99981913
#> 
#> $scale
#> [1] 11.49195
#> 
#> $mse
#> [1] 0.002532364
#>