Help required in using ManOpt to solve problems with rotation matrices

47 views
Skip to first unread message

balamurugan p

unread,
Oct 6, 2015, 11:01:39 AM10/6/15
to Manopt
Hi Nicolas,

I am trying to use ManOpt for solving a problem of the type

min_R ||A - YR||^2  

where R is a rotation matrix and the norm is a Frobenius norm. I checked all the examples under Manopt but did not see problems of this type. 

Can you please help me with the functions i can use in ManOpt to solve this problem. 

I am sorry for this question. But your advice will definitely help me.  

Thanks,
Bala. 

Nicolas Boumal

unread,
Oct 6, 2015, 11:11:11 AM10/6/15
to Manopt
Hello Bala,

Thank you for your interest.


This very special problem happens to have a closed-form solution. Indeed, consider expanding the Frobenius norm:

||A - YR||^2 = ||A||^2  + ||YR||^2  - 2 Trace( A^T Y R)

Since ||YR||^2 = ||Y||^2 for all orthogonal matrices R, the two first terms are merely constants, and we are left with the problem of

max Trace( A^T Y R)
subject to R is a rotation.

let A^T Y = USV^T be the SVD decomposition of A^T Y (U and V are orthogonal, S is diagonal, with nonnegative entries).
If we let R = VU^T, then the attained cost is Trace(S). It can be shown that this is indeed maximal.
If VU^T happens to have determinant -1 rather than +1, you can use VJU^T instead, where J = diag(1, 1, ..., 1, -1). This will set the determinant to +1, while minimizing the impact on the cost (since the last diagonal entry of S is also the smallest).

This is known as the Kabsch Algorithm, see: https://en.wikipedia.org/wiki/Kabsch_algorithm

This being said, if you wish to use Manopt to solve this problem (one good reason being that it would give you more freedom in experimenting with other norms, adding extra terms in the cost, having more than one variable, etc.), then please see this example (toward the end of the page):


I believe this is exactly the problem you mentioned. You could have found it from the tutorial page, in the Manifolds section, clicking on the "Rotation group" link ; but admittedly, it is not very visible, and we need to improve on that.


Best,
Nicolas


balamurugan p

unread,
Oct 6, 2015, 11:28:34 AM10/6/15
to Manopt
Thanks Nicolas for the insights into the problem and on the Kabsch algorithm. 

Yes, the example in the tutorial page solves exactly the same problem. 
I should have looked more carefully into the tutorial page. Sorry about that. 

Thanks,
Bala. 


Reply all
Reply to author
Forward
0 new messages