mvnpdf says my covariance matrix is not symmetric and positive-definite. BUT IT IS!
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
The matrix I'm working with is
G=[1.193220936874846 1.752209119064988 0; 1.752209119064988 2.573066480861231 0; 0 0 2.666666666666666];
and the way that I test whether a matrix is positive-definite is
[R, err] = cholcov(G, 0).
If err is 0 then it is positive-definite, but if it's > 0 then the matrix is not positive-definite.
So, given that, Matlab says that G is positive-definite but that .5*G is not! According to the link below (#2 under further properties), any scalar multiple of a positive-definite matrix is also positive-definite.
So what gives? Anybody know a way to work around this and use my matrix .5*G as the sigma argument in mvnpdf?
0 comentarios
Respuestas (1)
Walter Roberson
el 26 de Jun. de 2011
That same page says that in order for a matrix to be positive definite, all of the eigenvalues must be positive.
>> eig(G)
ans =
0
2.66666666666667
3.76628741773608
0 is not positive, so G is not positive definite by that definition.
To understand what is going on...
>> cond(G)
ans =
1.50674422424918e+16
That is above 1/eps so you are losing enough precision in doing the calculations as to render them suspect; different calculation routines might or might not explode for them.
0 comentarios
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!