MATLAB Function Reference Previous page   Next Page
qrupdate

Description

Rank 1 update to QR factorization

Syntax

Description

[Q1,R1] = qrupdate(Q,R,u,v) when [Q,R] = qr(A) is the original QR factorization of A, returns the QR factorization of A + u*v', where u and v are column vectors of appropriate lengths.

Remarks

qrupdate works only for full matrices.

Examples

The matrix

is a well-known example in least squares that indicates the dangers of forming A'*A. Instead, we work with the QR factorization - orthonormal Q and upper triangular R.

As we expect, R is upper triangular.

In this case, the upper triangular entries of R, excluding the first row, are on the order of sqrt(eps).

Consider the update vectors

Instead of computing the rather trivial QR factorization of this rank one update to A from scratch with

we may use qrupdate.

Note that both factorizations are correct, even though they are different.

Algorithm

qrupdate uses the algorithm in section 12.5.1 of the third edition of Matrix Computations by Golub and van Loan. qrupdate is useful since, if we take N = max(m,n), then computing the new QR factorization from scratch is roughly an algorithm, while simply updating the existing factors in this way is an algorithm.

References

[1]  Golub, Gene H. and Charles Van Loan, Matrix Computations, Third Edition, Johns Hopkins University Press, Baltimore, 1996

See Also

cholupdate, qr


Previous page  qrinsert quad, quad8 Next page

© 1994-2005 The MathWorks, Inc.