George Herriman's Krazy Kat is lounging under an umbrella.

Linear Algebra Calculators

QR Factorization


This calculator uses Wedderburn rank reduction to find the QR factorization of a matrix $A$. The process constructs the two matrices $Q$ and $R$ in stages. $Q$ is constructed a column at a time while $R$ is constructed a row at a time.

At each stage you'll have an equation $A=QR+B$ where you start with $Q$ and $R$ nonexistent, and with $B=A$. Also note that at each stage after the first $Q^TQ=I$.

Now with these updated $Q$ and $R$ update $B=A-QR$. (The updated $B$ can also be obtained by subtracting $qr/\Vert q \Vert^2$ from the previous $B$.)

Eventually $B=0$ and $A=QR$.

At this point (if you've been following the Gram-Schmidt Algorithm) $R$ is upper triangular, and the columns of $Q$ contain an orthonormal basis for the column space of $A$.

If you've been following the Gram-Schmidt Algorithm with Column Pivoting, then $R$ is a (column) permuted upper triangular matrix, and the columns of $Q$ again contain an orthonormal basis (almost certainly different) for the column space of $A$.

Gram-Schmidt Algorithm
Choose $q$ to be the first nonzero column of $B$.
Gram-Schmidt Algorithm with Column Pivoting
Choose $q$ to be the column of $B$ with the largest 2-norm.


Either choose the number of columns and press this button to get a new matrix, or enter your matrix in the box below. (Look at the example to see the format.)

Matrix $A$:

Select a column number.

Update `Q`, `R` and `B`.

The reset button leaves the `A` matrix alone, but reinitializes `Q`, `R` and `B`.


Back to calculator page or home page.
Krazy Kat is singing.