I'm trying to calculate a bivariate normal distribution in matlab(with mvnpdf), but the pdf I obtain has a strange shape with several peaks.
http://i.stack.imgur.com/gmiFZ.png
This is the code I use:
s=[3,1]';
C_ee = [0.0473 -0.1446;
-0.1446 0.4440]
x1 = -5:.2:5; x2 = -5:.2:5;
[X1,X2] = meshgrid(x1,x2);
F = mvnpdf([X1(:) X2(:)],s',C_ee);
F = reshape(F,length(x2),length(x1));
figure(1);
surf(x1,x2,F);
caxis([min(F(:))-.5*range(F(:)),max(F(:))]);
axis([-5 5 -5 5 0 5])
xlabel('Re'); ylabel('Im'); zlabel('Probability Density');
I've noticed, that when I increase the value of C_ee (sigma matrix), for instance C_ee+0.05 the shape starts to look normal.
I notice that this matrix is close to not being positive definite... but it still is.
Could anyone explain this behaviour?
Thank you for your time.

