Scilab Function

qr - QR decomposition

Calling Sequence

[Q,R]=qr(X [,"e"])
[Q,R,E]=qr(X [,"e"])
[Q,R,rk,E]=qr(X [,tol])

Parameters

Description

  • - [Q,R] = qr(X) produces an upper triangular matrix R of the same dimension as X and an orthogonal (unitary in the complex case) matrix Q so that X = Q*R. [Q,R] = qr(X,"e") produces an "economy size": If X is m-by-n with m > n, then only the first n columns of Q are computed as well as the first n rows of R.
  • From Q*R = X , it follows that the kth column of the matrix X, is expressed as a linear combination of the k first columns of Q (with coefficients R(1,k), ..., R(k,k) ). The k first columns of Q make an orthogonal basis of the subspace spanned by the k first comumns of X. If column k of X (i.e. X(:,k) ) is a linear combination of the first p columns of X, then the entries R(p+1,k), ..., R(k,k) are zero. It this situation, R is upper trapezoidal. If X has rank rk, rows R(rk+1,:), R(rk+2,:), ... are zeros.

  • [Q,R,E] = qr(X) produces a (column) permutation matrix E, an upper triangular R with decreasing diagonal elements and an orthogonal (or unitary) Q so that X*E = Q*R. If rk is the rank of X, the rk first entries along the main diagonal of R, i.e. R(1,1), R(2,2), ..., R(rk,rk) are all different from zero. [Q,R,E] = qr(X,"e") produces an "economy size": If X is m-by-n with m > n, then only the first n columns of Q are computed as well as the first n rows of R.
  • [Q,R,rk,E] = qr(X ,tol)\FR returns rk = rank estimate of X i.e. rk is the number of diagonal elements in R which are larger than a given threshold tol.
  • [Q,R,rk,E] = qr(X) \FR returns rk = rank estimate of X i.e. rk is the number of diagonal elements in R which are larger than tol=R(1,1)*%eps*max(size(R)). See rankqr for a rank revealing QR factorization, using the condition number of R.
  • REFERENCES

    Examples

    See Also