Spurious complex eigenvalues caused by roundoff.
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Subspace Methods finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!