Why does chol([4, -4;-4, 4]) fail to produce an answer?

조회 수: 5 (최근 30일)
Paul Mellor
Paul Mellor 2015년 12월 22일
댓글: Paul Mellor 2015년 12월 22일
>> chol([4, -4;-4, 4])
Error using chol
Matrix must be positive definite.
Yet clearly
R = [2, -2];
R' * R
Gives ans =
4 -4
-4 4

채택된 답변

Stephen23
Stephen23 2015년 12월 22일
편집: Stephen23 2015년 12월 22일
Actually that matrix is not positive definite. From the chol documentation:
" [R,p] = chol(A) for positive definite A, produces an upper triangular matrix R from the diagonal and upper triangle of matrix A, satisfying the equation R'*R=A and p is zero. If A is not positive definite, then p is a positive integer and MATLAB® does not generate an error."
Lets try it:
>> [~,p] = chol([4, -4;-4, 4])
p =
2
This is the same method that TMW gives here:
  댓글 수: 1
Paul Mellor
Paul Mellor 2015년 12월 22일
I see. Then is there a way to obtain a factorization R' * R = A for this matrix, even though it is not defined to be positive definite (since one of its eigenvalues is zero)? This factorization clearly exists as R = [2, -2];

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by