Numerical sensitivity of X'*Y*X given X is a permutation matrix

1 回表示 (過去 30 日間)
Qian Feng
Qian Feng 2017 年 3 月 31 日
編集済み: John D'Errico 2017 年 3 月 31 日
Assume X is an arbitrary matrix and Y is a symmetric matrix with double floating-point format. I understand that the product X'*Y*X can become asymmetric due to the floating point numerics problem.
However, I am not sure this potential 'asymmetric' problem would happen if X here is assumed to be a permutation matrix. I would think the structure of a permutation matrix may not cause any problem to the symmetric structure of X'*Y*X
If anyone has suggestions, please share them.
  2 件のコメント
Jan
Jan 2017 年 3 月 31 日
What is your question?
David Goodmanson
David Goodmanson 2017 年 3 月 31 日
Hi Qian, If your matrices are real then M' is the same as the transpose M.', so the statement about being symmetric makes sense. If anything were complex then you would have to make different statements about X' *Y*X and X.' *Y*X . That nitpick aside, for matrix multiplication by permutation matrices all you are doing is multiplying by 1 and adding 0, and it's hard to see how that could have any bad effect numerically.

サインインしてコメントする。

採用された回答

John D'Errico
John D'Errico 2017 年 3 月 31 日
編集済み: John D'Errico 2017 年 3 月 31 日
Not a true answer, but IF it were going to happen, you would see it here:
[Q,R,X] = qr(rand(3000));
Y = randn(3000);
Y = Y + Y';
Z = X'*Y*X;
all(all((Z-Z') == 0))
ans =
logical
1
Often a simple test is worth a lot, just to verify intuition.
So X is a random permutation matrix. Y a random symmetric matrix. Z is perfectly symmetrical. I chose a large enough matrix so that it had 4 CPUs running on the problem, so the BLAS will be kicking in. Usually when there are problems on something like this, it is the BLAS that are claimed to be the culprit.
I think the important point is (I see David made this in his comment) that there are NO adds involved between two non-zero numbers. All of the adds will always end up being of the form u+0 or 0+u, where there can never be any kind of error introduced into the least significant bits.
So I'll claim that this operation, where Y is symmetric and X a permutation matrix will never introduce an asymmetry into the result.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by