Spurious complex eigenvalues caused by roundoff.
이전 댓글 표시
Hi everyone,
I found this piece of code in the MATLAB stats toolbox, file cmdscale.m
P = eye(n) - repmat(1/n,n,n);
B = P * (-.5 * D .* D) * P;
[V E] = eig((B+B')./2); % guard against spurious complex e-vals from roundoff
I understand that B+B'./2 is a common idiom of making a matrix symmetric, but I don't understand what dangers this is guarding against. Is it something to do with the computation of B? It's given that D is a symmetric matrix, so by definition B should be too. Perhaps very small values in the off-diagonal positions round to different values and this is a guard for that. What I don't understand is why this symmetric operation isn't itself susceptible to round-off errors. I don't have any intuition as to what's happening. Any comments or references to the literature would be most appreciated.
Thank you for your time,
Charles.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Subspace Methods에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!