I would like to generate a large PSD matrix, i.e., $A \in \mathbb{R}^{n \times n}$, where $\mathcal{O}(n) \sim 10^3$. The entries of the matrix should be randomly generated using a standard function in Python, or Mathematica or any other language.
The current method I am using is as follows:
First, generate a matrix $P$ with random real and positive values. (I set them to integers by rounding).
Set $A = PP^T$
The matrix I have gotten is symmetric, but usually positive definite (the eigenvalues tends to be non-zero, say, 0.004).
Is there a way to update the positive definite matrix into a positive semidefinite matrix?
If not, is there a better method for generating large, positive semidefinite matrix?