chol() Error with Real, Symmetric, Positive Definite, 3-by-3 Matrix
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
mm_123
am 10 Mär. 2017
Beantwortet: Gillian Rosen
am 13 Mär. 2017
Hi all,
I am trying to use the chol() function to find the upper/lower triangular Cholesky factor of the following 3-by-3 matrix:
X = [1.000000000000000, 0.316227766016838, 1.732050807568878;
0.316227766016838, 2.000000000000000, 1.643167672515499;
1.732050807568878, 1.643167672515499, 3.000000000000002];
The matrix is symmetric:
X == X'
ans =
3×3 logical array
1 1 1
1 1 1
1 1 1
Using svd() yields that the matrix has 3 real, strictly positive eigenvalues and is therefore positive definite and full rank:
svd(X)
ans =
4.885302431570409
1.303185501452844
0.188487933023250
The rank function confirms that X is full rank:
rank(X)
ans =
3
However, when trying to use the chol() function to obtain the upper/lower Cholesky factor of X it fails:
chol(X)
Error using chol
Matrix must be positive definite.
Any help with this problem would be much appreciated.
Thanks in advance!
0 Kommentare
Akzeptierte Antwort
Gillian Rosen
am 13 Mär. 2017
Hi Matthias,
I understand that you are trying to use the 'chol' function to find the upper/lower triangular Cholesky factor of a certain 3x3 matrix. You are getting an error that the matrix 'must be positive definite', even though it looks like the matrix is already positive definite.
Unfortunately, it seems that the matrix X is not actually positive definite. To explain, the 'svd' function returns the singular values of the input matrix, not the eigenvalues. These two are not the same, and in particular, the singular values will always be nonnegative; therefore, they will not help in determining whether the eigenvalues are nonnegative. To obtain the eigenvalues, you can use the 'eig' function, as follows:
>> eig(X)
ans =
-0.1885
1.3032
4.8853
Note that when you use the 'eig' function to obtain the eigenvalues, one of the values is -0.1885; therefore, the eigenvalues are not strictly positive, and the matrix is not positive definite.
For more information, see the documentation on singular values and eigenvalues:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra 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!