# Random matrices in coordinate independent way

How to generate a random matrix in a basis independent way (so that the random distribution does not change if the coordinates are rotated)?

I am especially interested in generating random rotation maps (in matrix or any other form) in basis independent way, or at least independent of swapping every two unit vectors.

I am also especially interested in generating "small" random changes (so called mutations) of matrices.

Now (see the answers below) it is clear how to generate basis-independent random matrices (both small and big) and also basis independent rotation matrices.

Now the question: how to generate small (rotating to a small angle) rotation matrices, is also answered.

Are there faster algorithms?

• It may be made independent of swapping any two unit vectors, simply by random shuffling of all unit vectors, before applying a transformation – porton Apr 26 '14 at 15:46

If you generate all matrix entries to be i.i.d. Gaussian, then the probability of each column is only dependent on the column vector's Euclidean length, and the column vector lengths are preserved under orthogonal transformations, so this is one way to get a distribution invariant under coordinate rotations.

• Do every matrix entry need to have the same mean for this to work? – porton Apr 25 '14 at 21:04

user2566092 has explained how to generate a general basis-independent random matrix.

A basis-independent rotation matrix can be generated from it by polar decomposition.

• Hm, I need to generate "small" rotations. I am not sure this method does it :-( – porton Apr 25 '14 at 21:55

Now I've invented a way to generate "small" rotations:

1. Generate a Gaussian random matrix.

2. Add identity matrix multiplied with a big real number to it.

3. Decompose it as in my other answer. The resulting rotation will be small.

• It should work, but this algorithm is SLOW. Can you help to make it faster? – porton Apr 25 '14 at 23:15