I'm looking for an efficient algorithm to generate large positive semidefinite matrices.
One possible way I know of is:
- generate a random square matrix
- multiply it with its transpose.
- calculate all eigenvalues of the result matrix and check if all of them are non-negative.
However, this approach is infeasible given a large matrix, say $1000 \times 1000$ or more.
Could anyone please suggest an efficient way to generate a positive semidefinite matrix? Is there any MATLAB function for this job?