QRDecomposition

QRDecomposition[m]

yields the QR decomposition for a numerical matrix m. The result is a list {q,r}, where q is a unitary matrix and r is an uppertriangular matrix.

Details and Options

Examples

open allclose all

Basic Examples  (2)

Compute the QR decomposition for a 3×2 matrix with exact values:

Compute the QR decomposition for a 2×3 matrix with approximate numerical values:

Scope  (2)

m is a 3×4 matrix:

QR decomposition computed with exact arithmetic:

QR decomposition computed with machine arithmetic:

QR decomposition computed with 24-digit arithmetic:

QR decomposition for a 3×3 matrix with random complex entries:

Options  (1)

Pivoting  (1)

Compute the QR decomposition using machine arithmetic with pivoting:

The elements along the diagonal of r are in order of decreasing magnitude:

The matrix p is a permutation matrix:

QRDecomposition satisfies m.p==ConjugateTranspose[q].r:

Applications  (1)

Here is some data:

is a design matrix for fitting with basis functions , , :

Find the QR decomposition of :

This finds a vector such that is a minimum:

These are the coefficients for the least-squares fit:

Properties & Relations  (1)

m is a 3×4 matrix:

Compute the QR decomposition:

The rows of q are orthonormal:

r is upper triangular:

m is equal to ConjugateTranspose[q].r:

Introduced in 1991
 (2.0)