The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 3
Registered: 10/25/12
Re: Uniform random rotation matrix
Posted: Oct 25, 2012 3:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jlab6e$s2m$>...
> "G" wrote in message <jl9ktr$f4c$>...
> >
> > 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


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?


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.