MATLAB: Error using multivariate Gaussian number generator (mvnrnd)

multi variate gaussianmvnrndsemi definite positive

Hello,
I'm trying to generate N points in a n dimension with a multivariate distribution.
I'm using the "mvnrnd" matlab funtion, however i keep getting the following error:
Error using mvnrnd (line 110) SIGMA must be a symmetric positive semi-definite matrix.
From my understanding, if the eigen values of the covariance matrix are all >= 0, then sigma is indeed positive semi-definite.
The problem is I'm getting this error even when the eigen values are all positive, and I don't know why.
I've uploaded a .mat with a mean and covariance matrix with which i get this error even though the eigen values are >0:
https://dl.dropbox.com/u/15692375/maltab_mvnrnd_example.mat
Am i overlooking something? Does anyone have idea what i'm doing wrong?
Thanks, Alex

Best Answer

In this case, it's not the positive semi-definiteness, but the symmetry. You have relative differences that are on the order of single precision:
>> (Pp - Pp')./abs(Pp)
ans =
0 1.7455e-07 9.2053e-07
-1.7455e-07 0 2.2278e-10
-9.2053e-07 -2.2278e-10 0