This section describes the generation of random symmetric positive-definite (SPD) matrices.
The problem is to generate a random symmetric positive definite matrix with . Let be a uniform random orthogonal matrix, be a positive diagonal matrix, and
Then is symmetric:
is positive definite:
and
Conversely, all symmetric positive definite matrices can be brought to the form of by eigen-decomposition. The generation of a random orthogonal matrix is described in Uniform random orthogonal matrix. Now we just need to generate a diagonal matrix such that .
Let
and let
be a set of n uniform random numbers in . Sort this list to ascending order with a permutation . Define
Then
We claim can be formed by setting
To check this claim, compute:
The diagonal elements of are also positive.
The problem is to generate a random symmetric positive-definite matrix with and . Let be a uniform random orthogonal matrix, be a positive diagonal matrix, and
This matrix has the properties as above. Now we just need to generate such that , and . Let
and assume . Then
and
Thus we get the pair of equations:
Now
and
Therefore
and
Thus the solution is:
We assumed
This is the only restriction.