Numerical sensitivity of function kron(X,Y)

2 ビュー (過去 30 日間)
Qian Feng
Qian Feng 2016 年 12 月 19 日
コメント済み: James Tursa 2016 年 12 月 20 日
Assume X and Y are both symmetric matrices with double floating-point format. Can kron(X,Y) potentially become asymmetric due to the floating point numerics similar to the situation like X'*Y*X ?
I personally think it would be quite unlikely to have the problem I stated above given the mathematical definition of the Kronecker product. Nevertheless, if anyone has suggestions, please share them.
Thanks

採用された回答

Matt J
Matt J 2016 年 12 月 19 日
編集済み: Matt J 2016 年 12 月 19 日
My instinct and my tests say no. There are only scalar multiplications in A=kron(X,Y), so those should be pretty safe. However, if you plan to start multiplying A with other data, the benefits of the symmetry might go out the window pretty fast. Note, for example, that C as computed with,
C=reshape( kron(X,X)*Y(:) ,N,N);
should be symmetric in exact arithmetic for symmetric X and Y. However, I find that this fails in most numerical tests, likely due to the very same issue you pointed out with X.'*Y*X.

その他の回答 (1 件)

John D'Errico
John D'Errico 2016 年 12 月 19 日
Never trust the LSBs in a floating point computation. If it can go bad, it probably will.
A = randn(200);
B = randn(100);
A = A + A';
B = B + B';
C = kron(A,B);
all(all(C == C'))
all(all(C == C'))
ans =
logical
1
I did my best above, but symmetry remains. C is pretty large, enough so that the blas should be kicking in, just in case they might have gotten me in trouble. I even chose different sizes for A and B, in case that might get me in trouble.
So I did a quick look at the guts of kron. It looks like it is safe to retain symmetry to me. A computation like X'*Y*X is a problem, because first MATLAB forms X'*Y, which is not symmetric, even if X and Y are symmetric. Then, even though a final multiplication by X should restore symmetry, that simply won't happen in floating point arithmetic.
Though still a conjecture and not proved, I think kron is ok.
  2 件のコメント
Qian Feng
Qian Feng 2016 年 12 月 20 日
Yes, it looks like kron() is not sensitive to floating point numeric problems. BTW, what is the meaning of LSBs ?
James Tursa
James Tursa 2016 年 12 月 20 日
Least Significant Bits.

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

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by