Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Uniform random rotation matrix
Replies: 19   Last Post: Oct 25, 2012 6:51 PM

 Messages: [ Previous | Next ]
 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

Date Subject Author
12/9/10 Martin
12/9/10 John D'Errico
12/9/10 Bruno Luong
12/9/10 John D'Errico
12/9/10 Bruno Luong
12/9/10 John D'Errico
12/9/10 Roger Stafford
12/9/10 John D'Errico
12/9/10 John D'Errico
12/9/10 Bruno Luong
12/9/10 John D'Errico
12/9/10 Bruno Luong
12/9/10 Bruno Luong
12/9/10 Bruno Luong
4/1/12 G
4/1/12 Bruno Luong
10/25/12 Kaba
10/25/12 Bruno Luong
12/9/10 Roger Stafford
12/9/10 Bruno Luong