Random draws of multivariate normal with positive semi-definite covariance matrix

See here: Cholesky decomposition of low-rank positive-semidefinite matrix - #3 by stevengj

The problem is that you may get slightly negative pivots due to roundoff errors, in which case LAPACK may terminate the factorization prematurely.

Ideally there would be a way to specify some tolerance so that slightly negative pivots could be treated as zeros, but I don’t know of any API for this?