Why would chol fail?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
SingHua Tsai
am 25 Aug. 2018
Kommentiert: SingHua Tsai
am 26 Aug. 2018
I have a positive definite sparse array Ainv. When I do the chol like
L=chol(Ainv);
M = L*L';
isequal(M,Ainv)
I find that M is not equal to Ainv. How can I use chol to get a right answer?
0 Kommentare
Akzeptierte Antwort
Stephan
am 25 Aug. 2018
Bearbeitet: Stephan
am 25 Aug. 2018
Hi,
L*L'
is not the same as
L'*L
You can test with this little example:
A = [7 3; 3 7]
ev = eig(A)
Ch = chol(A)
B1 = Ch'*Ch
B2 = Ch * Ch'
EDIT:
Is Ainv symmetric? If it is, consider that we are dealing with double precision numbers and the operations you perform have rounding errors. See this example:
A = [7 3; 3 7]
Ch = chol(A)
B1 = Ch' * Ch
same = isequal(A,B1)
diff = A-B1
B2 = round(Ch' * Ch)
same2 = isequal(A,B2)
diff2 = A-B2
So there is not a problem with chol, since this is a normal behavior.
Best regards
Stephan
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Eigenvalue Problems 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!