Filter löschen
Filter löschen

error using multivariate Gaussian number generator (mvnrnd)

1 Ansicht (letzte 30 Tage)
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

Akzeptierte Antwort

Peter Perkins
Peter Perkins am 6 Nov. 2012
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

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by