Message Boards Message Boards

1
|
579 Views
|
3 Replies
|
9 Total Likes
View groups...
Share
Share this post:

QRDecomposition outcome from two "almost identical matrices" are different

Posted 2 months ago

I recently tried to QRDecomposition the following matrix

QRinput = {
{0.009826785535338169`, 0.008256655213562824`, 0.23496656662777898`, 0.0358164610814019`, -0.0321839377786013`},
{0.0071722245494631656`, -0.015518584863216923`, 0.6020493614610618`, 0.07500483541584589`, 0.08497539716512054`},
{-0.03658096909956766`, -0.6033290122631336`, 0.04440885991614449`, 0.05251191447416792`, -0.1155412502161208`},
{0.016037458609262225`, 0.15041754452642467`, 0.37150477907772345`, 0.14619332881870864`, -0.9388971297842233`},
{-0.08708998487947375`, -0.059641601478869766`, -0.0598827775374648`, -0.0287086274341603`, 0.19532143105542088`},
{-0.06405336407488192`, -0.09522309075175218`, -0.21918657234734668`, -0.09371626780925374`, 0.6114887968202849`},
{0.019567395967389333`, -0.38407644616386616`, -0.06667430927164489`, -0.003674467358392105`, 0.15580174872593694`},
{-0.007172224549463201`, 0.015518584863216955`, -0.6020493614610617`, -0.07500483541584584`, -0.0849753971651204`},
{0.03658096909956768`, 0.6033290122631337`, -0.04440885991614451`, -0.05251191447416782`, 0.11554125021612091`},
{-0.01603745860926223`, -0.15041754452642472`, -0.3715047790777235`, -0.1461933288187085`, 0.9388971297842233`},
{0.08708998487947348`, 0.05964160147886982`, 0.059882777537464786`, 0.02870862743416032`, -0.19532143105542066`},
{0.06405336407488181`, 0.09522309075175232`, 0.21918657234734693`, 0.09371626780925378`, -0.6114887968202853`},
{-0.0195673959673894`, 0.3840764461638662`, 0.06667430927164489`, 0.0036744673583921834`, -0.15580174872593688`}
};

And I "round" the above matrix to two different level as defined following:

a=N@Round[QRinput, 10^-16];   b=N@Round[QRinput, 10^-15];

And you can see in following, the QRDecomposition outcome from these two "almost identical matrix" is very different !!!

QRDecomposition[a][[1]] - QRDecomposition[b][[1]] // MatrixForm // Chop

enter image description here

I would appreciate any feedback or comments on this issue.

POSTED BY: ddtty kuso
3 Replies

The matrix is rank deficient.

Diagonal[SingularValueDecomposition[QRinput][[2]]]

(* Out[27]= {1.81074, 1.01266, 0.853008, 0.141301, 0.} *)

So I'm not very surprised there are different results for the final row of the q matrix.

POSTED BY: Daniel Lichtblau

I would think that the problem comes from the rank of QRinput being deficient. See for instance MatrixRank, SingularValueList, or Eigenvalues[Transpose[QRinput].QRinput]]. Probably most telling is the bottom left entry of $R$ in QRDecomposition[mat] for each of the matrices QRinput, a, and b. The entry is approximately zero, but nonzero, between $10^{-15}$ and $10^{-14}$. The perturbations of this entry in the matrices are of the same order. These perturbations are of a similar absolute magnitude to the perturbations of the matrices themselves. However, since the value are approximately zero, they are large relative ones. I would expect similarly large relative perturbations in the last row of a matrix $Q$ that satisfies $Q^T R = A$.

POSTED BY: Michael Rogers
Posted 2 months ago

The problem is in non stability of QR algorithm.
Here this problem is considered a simple example, maybe it will help you!

POSTED BY: Denis Ivanov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract