计算互补投影时的数值问题 [英] numerical issue when computing complementary projection

查看:108
本文介绍了计算互补投影时的数值问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用matlab计算以下问题:

I am using matlab to compute the following problem:

AB是两个m x n正交矩阵,A'*A = IB'*B = I,其中I是单位矩阵.并且mn大得多.我正在计算C = (2B*B'-I)*A,它也是一个正交矩阵.

A, B are two m by n orthogonal matrices, A'*A = I and B'*B = I where I is the identity matrix. And m is much bigger than n. I am computing C = (2B*B'-I)*A, which is also a orthogonal matrix.

但是在matlab中,数字的精度导致以下问题:

But in matlab, the precision of number leads to the following issue:

max(max(abs(A'*A-I))) = e0 > 0
max(max(abs(B'*B-I))) = e0 > 0

计算出的C具有max(max(abs(C'*C-I))) = e1 > e0.

如果我通过计算D = (2C*C'-I)*B重复上述过程,则对于D来说,此错误界限就会抬起头,随着此类迭代的进行,这种错误会爆炸.

If I repeat the above process by computing D = (2C*C'-I)*B, this error bound lift up for D, with more and more such kind of iterations, this error explodes.

有没有一种方法可以在不增加此错误界限的情况下进行计算?

Is there a way to compute without increasing this error bound?

谢谢!

推荐答案

通常,执行的计算和转换越多,您就越需要担心浮点错误.

As a general rule, the more computations and transformations your perform, the more you have to start worrying about floating point error.

为减轻影响,有两种可能:

To mitigate the effects, there are a couple of possibilities:

1)使用支持精确算术的Maple或Mathematica之类的软件,这将主要以增加计算负担为代价来消除此问题.我的理解是Matlab不支持精确的算术(但是我可能会错...)

1) Use software like Maple or Mathematica that support exact arithmetic, which will mostly eliminate the problem at the cost of greater computational burden. My understanding is that Matlab does not support exact arithmetic (but I could be wrong on this...)

2)使用比Double高的精度来减轻浮点错误.例如,FEX提交的用于MATLAB的Multiple Precision Toolbox 声称支持任意大精度格式. .不过,我本人从未使用过它,因此无法评论它的运行情况.

2) Use a higher precision than Double to mitigate the floating point error. For example, the FEX submission Multiple Precision Toolbox for MATLAB claims to support arbitrarily large precision formats. I've never used it myself though, so I can't comment on how well it works.

3)根据矩阵中数字的相对大小,可能会有一些数字技巧或转换可用来减少浮点误差.这是一个很大的话题,但是总的来说,想法是尝试解决问题,使数字尽可能按数量级彼此靠近.

3) Depending on the relative magnitudes of the numbers in your matrices, there may be some numerical tricks or transformations that you can exploit to reduce the floating point error. This is a big topic, but in general the idea is to try and scale your problem so that numbers are all as close to each other in order of magnitude as possible.

我可能还不知道其他一些可能性.我当然不是这方面的专家.我很想看看其他受访者的建议.

There may be some other possibilities that I'm not aware of. I'm certainly no expert in this area. I'll be interested to see what other respondents suggest.

哦,还有一件事,我偶然发现了一个

Oh, one other thing, I just stumbled upon a closely related SO question.

这篇关于计算互补投影时的数值问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆