Kaba
Posts:
3
Registered:
10/25/12


Re: Uniform random rotation matrix
Posted:
Oct 25, 2012 3:29 PM


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jlab6e$s2m$1@newscl01ah.mathworks.com>... > "G" wrote in message <jl9ktr$f4c$1@newscl01ah.mathworks.com>... > > > > How did you come up with this formula for uniform random rotation matrices? Is there a proof or some literature available? > > A proof, probably. The fact is straight from the property of rotational invariant of canonical multivariate Gaussian pdf. > > Bruno
Hi,
The code provided in this thread:
[Q, R] = qr(randn(n)) Q = Q*diag(sign(diag(R)))
Is a correct way to generate random matrices from O(n), the orthogonal group. For reference, see "How to generate random matrices from the classical compact groups", Francesco Mezzadri, Notices of ACM, Volume 54, Number 5, 2007.
The problem is that det(Q) may be 1, and therefore sometimes Q is not a rotation matrix as desired. I'm thinking of two possibilities for det(Q) < 0:
1) exchange any two columns of Q, or 2) compute the svd of Q = USV^T, and then compute Q2 := U diag([ones(1, n  1), 1]) V^T. The Q2 is then the rotation matrix closest to Q in the Frobenius norm.
I am unable to say what effect these have on the probability measure. Anyone?
Kalle

