Rotation of a non-square matrix [closed]

Q

The data $$ \begin{align*} A = \begin{bmatrix}4.84726 & -2.46786 & 0.549036 & -4.31815 \\ 0.813505 & -3.46221 & -0.251525 & 2.97353 \end{bmatrix} \end{align*} $$ are believed to be a rotation of the data $$ \begin{align*} B = \begin{bmatrix}4.51076 & -2.18889 & 0.58951 & -4.715 \\ 1.95213 & -3.64499 & -0.131083 & 2.29282\end{bmatrix} \end{align*} $$

Determine the amount of rotation between the data sets.

A

This chapter has been about the SVD so I'm assuming that's the lens to think the problem through but I'm not sure if I should look at the left eigenvectors or right eigenvectors and then how to come up with a measure for how different the matrices are...

Guidance would be appreciated


Solution 1:

I found an excellent paper that addresses this problem in the $3D$ case, but the methods developed there are applicable in a straight forward manner to the $2D$ case presented in this question.

We have $4$ observations of $2D$ vectors (matrix $B$) and their rotated versions (matrix $A$). Following the development of the paper cited above, the error performance index with equal weights for all the observations is given by

$J = \displaystyle \sum_{i=1}^4 (A_i - R B_i)^T (A_i - R B_i) $

where $A_i$ is the $i$-th column of matrix $A$ and $B_i$ is the $i$-th column of matrix $B$. Expanding, we find that minimizing $J$ is equivalent to maximizing

$J_1 = \displaystyle \sum_{i=1}^4 A_i^T R B_i = \text{trace}( A^T R B) = \text{trace}( R B A^T) $

Continuing with the development in the above paper, the $2 \times 2$ matrix $(BA^T)$ is decomposed into the SVD form i.e. $B A^T = U \Sigma V^T $, then we have

$\text{trace}(R B A^T) = \text{trace}(R U \Sigma V^T) = \text{trace}(\Sigma V^T R U ) $

The maximum of the last expression is obtained when $V^T R U$ is the identity matrix. That is,

$ V^T R U = I $

From which,

$R = V U^T $

I wrote a small code to perform the above calculations, and found that

$R = \begin{bmatrix} 0.986615 && 0.163066 \\ -0.163066 && 0.986615 \end{bmatrix}$

Which is the rotation matrix corresponding to a rotation by an angle $\theta = \text{ATAN2}( 0.986615, -0.163066) = -9.385^\circ $

The error index at this optimum rotation matrix is $J = 0.285534$