Gram-schmidt decomposition

From HandWiki


Any set of linearly independent vectors Hepa img431.gif can be converted into a set of orthogonal vectors Hepa img432.gif by the Gram-Schmidt process. In three dimensions v1 determines a line; the vectors v1 and v2 determine a plane. The vector q1 is the unit vector in the direction v1. The (unit) vector q2 lies in the plane of v1, v2, and is normal to v1 (on the same side as v2). The (unit) vector q3 is normal to the plane of v1, v2, on the same side as v3.

In general, first set u1= v1, and then each ui is made orthogonal to the preceding Hepa img433.gif by subtraction of the projections of vi in the directions of Hepa img433.gif :

Hepa img434.gif

The i vectors ui span the same subspace as the vi. The vectors Hepa img435.gif are orthonormal. This leads to the following theorem:

Any (m,n) matrix A with linearly independent columns can be factorized into a product, A = QR. The columns of Q are orthonormal and R is upper triangular and invertible.

This ``classical Gram-Schmidt method is often numerically unstable, see Golub89 for a ``modified Gram-Schmidt method.