1

I want to construct an arbitrary $n\times n$ positive semi-definite matrix.
Maybe I can randomly create an $n\times m$ matrix and use its covariance matrix.
But I want to know if there's any other (efficient) way of doing this?

Thanks.

dontloo
  • 486

1 Answers1

3

You can try if this way works out for you:

Create a diagonal Matrix $M$ with diagonal entries $(\geq) > 0$. Then take an invertible matrix $P$ and calculate $E = PMP^{-1}$, hence E and M are similar, hence E is also positive (semi-) definit. Using this way you have to worry about finding arbitrary invertible matrices. One way for that would be to do random elementary row/column operations to the identity matrix(for that you can create elementary matrices by random, which is an easy task).

CandyOwl
  • 261