1 function A = random_positive_definite_matrix(integerN, max_entry = realmax)
3 % Generate a random, symmetric positive-definite (SPD) matrix.
5 % Since all (SPD) matrices are diagonalizable and have positive
6 % eigenvalues, it seems likely that we can generate an SPD matrix by
7 % combining random orthogonal matrices with a diagonal matrix of
10 % I have no proof/evidence that this approach is sound.
14 % - ``integerN`` -- The dimension of the resulting matrix.
16 % - ``max_entry`` -- (optional) Upper bound on the entries.
20 % - ``A`` -- A symmetric, positive definite matrix.
22 U = random_orthogonal_matrix(integerN);
23 d = unifrnd(eps, max_entry, 1, integerN);