- Gram–Schmidt process
In
mathematics , particularlylinear algebra andnumerical analysis , the Gram–Schmidt process is a method for orthogonalizing a set of vectors in aninner product space , most commonly theEuclidean space R"n". The Gram–Schmidt process takes a finite,linearly independent set "S" = {"v"1, …, "v""n"} and generates anorthogonal set "S"' = {"u"1, …, "u""n"} that spans the same subspace as "S".The method is named for
Jørgen Pedersen Gram andErhard Schmidt but it appeared earlier in the work ofLaplace andCauchy . In the theory ofLie group decompositions it is generalized by theIwasawa decomposition .The application of the Gram–Schmidt process to the column vectors of a full column rank matrix yields the
QR decomposition (it is decomposed into an orthogonal and atriangular matrix ).The Gram–Schmidt process
We define the projection
operator by:where <u, v> denotes theinner product of the vectors u and v. This operator projects the vector v orthogonally onto the vector u.The Gram–Schmidt process then works as follows:
-
| ||
| ||
-
| ||
| ||
-
| ||
| ||
-
| ||align="center"|
| ||align="center"|
-
| ||
| ||The sequence u1, …, u"k" is the required system of orthogonal vectors, and the normalized vectors e1, …, e"k" form an ortho"normal" set.To check that these formulas yield an orthogonal sequence, first compute ⟨u1, u2⟩ by substituting the above formula for u2: you will get zero. Then use this to compute ⟨u1, u3⟩ again by substituting the formula for u3: you will get zero. The general proof proceeds by
mathematical induction .Geometrically, this method proceeds as follows: to compute u"i", it projects v"i" orthogonally onto the subspace "U" generated by u1, …, u"i"−1, which is the same as the subspace generated by v1, …, v"i"−1. The vector u"i" is then defined to be the difference between v"i" and this projection, guaranteed to be orthogonal to all of the vectors in the subspace "U".
The Gram–Schmidt process also applies to a linearly independent
infinite sequence {v"i"}"i". The result is an orthogonal (or orthonormal) sequence {u"i"}"i" such that for natural number "n":the algebraic span of v1, …, v"n" is the same as that of u1, …, u"n".If the Gram–Schmidt process is applied to a linearly dependent sequence, it outputs the 0 vector on the th step, assuming that is a linear combination of .
Example
Consider the following set of vectors in R2 (with the conventional inner product):
Now, perform Gram–Schmidt, to obtain an orthogonal set of vectors:::
We check that the vectors u1 and u2 are indeed orthogonal::
We can then normalize the vectors by dividing out their sizes as shown above:::
Numerical stability
When this process is implemented on a computer, the vectors are often not quite orthogonal, due to rounding errors. For the Gram–Schmidt process as described above this loss of orthogonality is particularly bad; therefore, it is said that the (naïve) Gram–Schmidt process is numerically unstable.
The Gram–Schmidt process can be stabilized by a small modification. Instead of computing the vector u"k" as:it is computed as:::::::This series of computations gives the same result as the original formula in exact arithmetic, but it introduces smaller errors in finite-precision arithmetic.
Algorithm
The following algorithm implements the stabilized Gram–Schmidt process. The vectors v1, …, v"k" are replaced by orthonormal vectors which span the same subspace.: for "j" from 1 to "k" do:: for "i" from 1 to "j" − 1 do::: ("remove component in direction" v"i"):: end for:: ("normalize"): end forThe cost of this algorithm is asymptotically 2"nk"2 floating point operations, where "n" is the dimensionality of the vectors harv|Golub|Van Loan|1996|loc=§5.2.8.
Alternatives
Other orthogonalization algorithms use
Householder transformation s orGivens rotation s. The algorithms using Householder transformations are more stable than the stabilized Gram–Schmidt process. On the other hand, the Gram–Schmidt process produces the th orthogonalized vector after the th iteration, while orthogonalization using Householder reflections produces all the vectors only at the end. This makes only the Gram–Schmidt process applicable foriterative method s like theArnoldi iteration .References
*.
*.External links
* [http://video.google.com/videoplay?docid=-2274442444593051761 MIT Linear Algebra Lecture on Orthogonal Matrices] at Google Video, from MIT OpenCourseWare
* [http://members.aol.com/jeff570/g.html Gram–Schmidt orthogonalization] on the [http://members.aol.com/jeff570/mathword.html Earliest known uses of some of the words of mathematics]
Wikimedia Foundation. 2010.