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,]  1.3165468 -0.6338080
#>  [2,] -0.3130704  0.4573700
#>  [3,] -1.7883887  0.7028916
#>  [4,] -0.1798687  1.0373745
#>  [5,]  1.2110271 -0.6030159
#>  [6,]  1.8886244  0.5126452
#>  [7,] -0.4312071 -1.7154059
#>  [8,] -0.2604519 -0.7824055
#>  [9,] -1.7661662 -0.8528004
#> [10,]  0.4611835 -2.4102685
#> 
#> $rotation_matrix
#>              [,1]        [,2]
#> [1,]  0.999996566 0.002620733
#> [2,] -0.002620733 0.999996566
#> 
#> $scale
#> [1] 24.79797
#> 
#> $mse
#> [1] 0.002457105
#>