Henry (unit): Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Dhaluza
Expand caption
Line 1: Line 1:
[[File:Gram–Schmidt process.svg|right|frame|The first two steps of the Gram–Schmidt process]]
The individual who wrote the post is called Jayson Hirano and he completely digs that title. Her family lives in Ohio. What me and my family members love is bungee leaping but I've been taking on new issues recently. Since he was eighteen he's been working as an information officer but he plans on altering it.<br><br>Also visit my homepage: [http://www.route41.com/excellent-advice-for-choosing-the-ideal-hobby/ psychic solutions by lynne]
In [[mathematics]], particularly [[linear algebra]] and [[numerical analysis]], the '''Gram–Schmidt process''' is a method for [[Orthonormal basis|orthonormalising]] a set of [[vector (geometry)|vectors]] in an [[inner product space]], most commonly the [[Euclidean space]] '''R'''<sup>''n''</sup>. The Gram–Schmidt process takes a [[finite set|finite]], [[linearly independent]] set ''S'' = {''v''<sub>1</sub>, …, ''v''<sub>''k''</sub>} for {{nowrap|''k'' ≤ ''n''}} and generates an [[orthogonal set]] {{nowrap|''S′'' {{=}} {''u''<sub>1</sub>, …, ''u''<sub>''k''</sub>} }} that spans the same ''k''-dimensional subspace of '''R'''<sup>''n''</sup> as ''S''.
 
The method is named after [[Jørgen Pedersen Gram]] and [[Erhard Schmidt]] but it appeared earlier in the work of [[Laplace]] and [[Cauchy]]. In the theory of [[Lie group decompositions]] it is generalized by the [[Iwasawa decomposition]].<ref>Cheney, Ward; Kincaid, David: ''Linear Algebra: Theory and Applications''. Sudbury, Ma: 2009.Pg. 544, 558.</ref>
 
The application of the Gram–Schmidt process to the column vectors of a full column [[rank (linear algebra)|rank]] [[matrix (mathematics)|matrix]] yields the [[QR decomposition]] (it is decomposed into an [[orthogonal matrix|orthogonal]] and a [[triangular matrix]]).
 
== The Gram–Schmidt process ==
[[File:Gram-Schmidt orthonormalization process.gif|frame|right|The Gram-Schmidt process being executed on three linearly independent, non-orthogonal vectors of a basis for '''R'''<sup>3</sup>. Click on image for details.]]
 
We define the [[projection (linear algebra)|projection]] [[operator (mathematics)|operator]] by
:<math>\mathrm{proj}_{\mathbf{u}}\,(\mathbf{v}) = {\langle \mathbf{u}, \mathbf{v}\rangle\over\langle \mathbf{u}, \mathbf{u}\rangle}\mathbf{u} , </math>
where <math>\langle \mathbf{u}, \mathbf{v}\rangle</math> denotes the [[inner product]] of the vectors '''u''' and '''v'''. This operator projects the vector '''v''' orthogonally onto the line spanned by vector '''u'''. If '''u'''=0, we define <math>\mathrm{proj}_0\,(\mathbf{v}) := 0</math>. i.e., the projection map <math>\mathrm{proj}_0</math> is the zero map, sending every vector to the zero vector.
 
The Gram–Schmidt process then works as follows:
 
: <math>
\begin{align}
\mathbf{u}_1 & = \mathbf{v}_1, & \mathbf{e}_1 & = {\mathbf{u}_1 \over \|\mathbf{u}_1\|} \\
\mathbf{u}_2 & = \mathbf{v}_2-\mathrm{proj}_{\mathbf{u}_1}\,(\mathbf{v}_2),
& \mathbf{e}_2 & = {\mathbf{u}_2 \over \|\mathbf{u}_2\|} \\
\mathbf{u}_3 & = \mathbf{v}_3-\mathrm{proj}_{\mathbf{u}_1}\,(\mathbf{v}_3)-\mathrm{proj}_{\mathbf{u}_2}\,(\mathbf{v}_3), & \mathbf{e}_3 & = {\mathbf{u}_3 \over \|\mathbf{u}_3\|} \\
\mathbf{u}_4 & = \mathbf{v}_4-\mathrm{proj}_{\mathbf{u}_1}\,(\mathbf{v}_4)-\mathrm{proj}_{\mathbf{u}_2}\,(\mathbf{v}_4)-\mathrm{proj}_{\mathbf{u}_3}\,(\mathbf{v}_4), & \mathbf{e}_4 & = {\mathbf{u}_4 \over \|\mathbf{u}_4\|} \\
& {}\ \  \vdots & & {}\ \  \vdots \\
\mathbf{u}_k & = \mathbf{v}_k-\sum_{j=1}^{k-1}\mathrm{proj}_{\mathbf{u}_j}\,(\mathbf{v}_k), & \mathbf{e}_k & = {\mathbf{u}_k\over \|\mathbf{u}_k \|}.
\end{align}
</math>
 
The sequence '''u'''<sub>1</sub>, ..., '''u'''<sub>''k''</sub> is the required system of orthogonal vectors, and the normalized vectors '''e'''<sub>1</sub>, ..., '''e'''<sub>''k''</sub> form an [[orthonormal|ortho''normal'']] set. The calculation of the sequence '''u'''<sub>1</sub>, ..., '''u'''<sub>''k''</sub> is known as ''Gram–Schmidt [[orthogonalization]]'', while the calculation of the sequence '''e'''<sub>1</sub>, ..., '''e'''<sub>''k''</sub> is known as ''Gram–Schmidt [[orthonormalization]]'' as the vectors are normalized.
 
To check that these formulas yield an orthogonal sequence, first compute &lsaquo; '''u'''<sub>1</sub>,'''u'''<sub>2</sub> &rsaquo; by substituting the above formula for '''u'''<sub>2</sub>: we get zero. Then use this to compute &lsaquo; '''u'''<sub>1</sub>,'''u'''<sub>3</sub> &rsaquo; again by substituting the formula for '''u'''<sub>3</sub>: we get zero. The general proof proceeds by [[mathematical induction]].
 
Geometrically, this method proceeds as follows: to compute '''u'''<sub>''i''</sub>, it projects '''v'''<sub>''i''</sub> orthogonally onto the subspace ''U'' generated by '''u'''<sub>1</sub>, ..., '''u'''<sub>''i''−1</sub>, which is the same as the subspace generated by '''v'''<sub>1</sub>, ..., '''v'''<sub>''i''−1</sub>. The vector '''u'''<sub>''i''</sub> is then defined to be the difference between '''v'''<sub>''i''</sub> 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 [[countably infinite]] sequence {'''v'''<sub>''i''</sub>}<sub>''i''</sub>. The result is an orthogonal (or orthonormal) sequence {'''u'''<sub>''i''</sub>}<sub>''i''</sub> such that for natural number ''n'':
the algebraic span of '''v'''<sub>1</sub>, ..., '''v'''<sub>''n''</sub> is the same as that of '''u'''<sub>1</sub>, ..., '''u'''<sub>''n''</sub>.
 
If the Gram–Schmidt process is applied to a linearly dependent sequence, it outputs the '''0''' vector on the ''i''th step, assuming that '''v'''<sub>''i''</sub> is a linear combination of {{nowrap|'''v'''<sub>1</sub>, ..., '''v'''<sub>''i''&minus;1</sub>}}. If an orthonormal basis is to be produced, then the algorithm should test for zero vectors in the output and discard them because no multiple of a zero vector can have a length of 1. The number of vectors output by the algorithm will then be the dimension of the space spanned by the original inputs.
 
A variant of the Gram–Schmidt process using [[transfinite recursion]] applied to a (possibly uncountably) infinite sequence of vectors <math>(v_\alpha)_{\alpha<\lambda}</math> yields a set of orthonormal vectors <math>(u_\alpha)_{\alpha<\kappa}</math> with <math>\kappa\leq\lambda</math> such that for any <math>\alpha\leq\lambda</math>, the [[Complete_space#Completion|completion]] of the span of <math>\lbrace u_\beta : \beta<\min(\alpha,\kappa)\rbrace</math> is the same as that of <math>\lbrace v_\beta:\beta<\alpha\rbrace</math>. In particular, when applied to a (algebraic) basis of a [[Hilbert space]] (or, more generally, a basis of any dense subspace), it yields a (functional-analytic) orthonormal basis. Note that in the general case often the strict inequality <math>\kappa<\lambda</math> holds, even if the starting set was linearly independent, and the span of <math>(u_\alpha)_{\alpha<\kappa}</math> need not be a subspace of the span of <math>(v_\alpha)_{\alpha<\lambda}</math> (rather, it's a subspace of its completion).
 
== Example ==
Consider the following set of vectors in '''R'''<sup>2</sup> (with the conventional inner product)
:<math>S = \left\lbrace\mathbf{v}_1=\begin{pmatrix} 3 \\ 1\end{pmatrix}, \mathbf{v}_2=\begin{pmatrix}2 \\2\end{pmatrix}\right\rbrace.</math>
 
Now, perform Gram–Schmidt, to obtain an orthogonal set of vectors:
:<math>\mathbf{u}_1=\mathbf{v}_1=\begin{pmatrix}3\\1\end{pmatrix}</math>
:<math> \mathbf{u}_2 = \mathbf{v}_2 - \mathrm{proj}_{\mathbf{u}_1} \, (\mathbf{v}_2) = \begin{pmatrix}2\\2\end{pmatrix} - \mathrm{proj}_{({3 \atop 1})} \, ({\begin{pmatrix}2\\2\end{pmatrix})} = \begin{pmatrix} -2/5 \\6/5 \end{pmatrix}. </math>
 
We check that the vectors '''u'''<sub>1</sub> and '''u'''<sub>2</sub> are indeed orthogonal:
:<math>\langle\mathbf{u}_1,\mathbf{u}_2\rangle = \left\langle \begin{pmatrix}3\\1\end{pmatrix}, \begin{pmatrix}-2/5\\6/5\end{pmatrix} \right\rangle = -\frac65 + \frac65 = 0,</math>
noting that if the dot product of two vectors is ''0'' then they are orthogonal.
 
We can then normalize the vectors by dividing out their sizes as shown above:
:<math>\mathbf{e}_1 = {1 \over \sqrt {10}}\begin{pmatrix}3\\1\end{pmatrix}</math>
:<math>\mathbf{e}_2 = {1 \over \sqrt{40 \over 25}} \begin{pmatrix}-2/5\\6/5\end{pmatrix}
= {1\over\sqrt{10}} \begin{pmatrix}-1\\3\end{pmatrix}. </math>
 
== Numerical stability ==
When this process is implemented on a computer, the vectors <math>\mathbf{u}_k</math> are often not quite orthogonal, due to [[round-off error|rounding errors]]. For the Gram–Schmidt process as described above (sometimes referred to as "classical Gram–Schmidt") this loss of orthogonality is particularly bad; therefore, it is said that the (classical) Gram–Schmidt process is [[numerical stability|numerically unstable]].
 
The Gram–Schmidt process can be stabilized by a small modification; this version is sometimes referred to as '''modified Gram-Schmidt''' or MGS.
This approach gives the same result as the original formula in exact arithmetic and introduces smaller errors in finite-precision arithmetic.
Instead of computing the vector '''u'''<sub>''k''</sub> as
 
:<math> \mathbf{u}_k = \mathbf{v}_k - \mathrm{proj}_{\mathbf{u}_1}\,(\mathbf{v}_k) - \mathrm{proj}_{\mathbf{u}_2}\,(\mathbf{v}_k) - \cdots - \mathrm{proj}_{\mathbf{u}_{k-1}}\,(\mathbf{v}_k), </math>
it is computed as {{clarify|Are the Uk in the formula as calculated above, or the result of the recursive calculation?|date=April 2012}}
:<math> \begin{align}
\mathbf{u}_k^{(1)} &= \mathbf{v}_k - \mathrm{proj}_{\mathbf{u}_1}\,(\mathbf{v}_k), \\
\mathbf{u}_k^{(2)} &= \mathbf{u}_k^{(1)} - \mathrm{proj}_{\mathbf{u}_2} \, (\mathbf{u}_k^{(1)}), \\
& \,\,\, \vdots \\
\mathbf{u}_k^{(k-2)} &= \mathbf{u}_k^{(k-3)} - \mathrm{proj}_{\mathbf{u}_{k-2}} \, (\mathbf{u}_k^{(k-3)}), \\
\mathbf{u}_k^{(k-1)} &= \mathbf{u}_k^{(k-2)} - \mathrm{proj}_{\mathbf{u}_{k-1}} \, (\mathbf{u}_k^{(k-2)}).
\end{align} </math>
 
Each step finds a vector <math> \mathbf{u}_k^{(i)} </math> orthogonal to <math> \mathbf{u}_k^{(i-1)} </math>. Thus <math> \mathbf{u}_k^{(i)} </math> is also orthogonalized against any errors introduced in computation of  <math> \mathbf{u}_k^{(i-1)} </math>.
 
This method is used in the previous animation, when the intermediate v'<sub>3</sub> vector is used when orthogonalizing the blue vector v<sub>3</sub>.
 
== Algorithm ==
The following algorithm implements the stabilized Gram–Schmidt orthonormalization. The vectors '''v'''<sub>1</sub>, …, '''v'''<sub>''k''</sub> are replaced by orthonormal vectors which span the same subspace.
: '''for''' ''i'' '''from''' 1 '''to''' ''k'' '''do'''
:: <math> \mathbf{v}_i \leftarrow \frac{\mathbf{v}_i}{\|\mathbf{v}_i\|} </math> (''normalize'')
:: '''for''' ''j'' '''from''' i+1 '''to''' k '''do'''
::: <math> \mathbf{v}_j \leftarrow \mathbf{v}_j - \mathrm{proj}_{\mathbf{v}_{i}} \, (\mathbf{v}_j) </math> (''remove component in direction'' '''v'''<sub>''i''</sub>)
:: '''next j'''
 
: '''next i'''
The cost of this algorithm is asymptotically 2''nk''<sup>2</sup> floating point operations, where ''n'' is the dimensionality of the vectors {{harv|Golub|Van Loan|1996|loc=§5.2.8}}.
 
==Determinant formula==
The result of the Gram–Schmidt process may be expressed in a non-recursive formula using [[determinant]]s.
 
:<math> \mathbf{e}_j = \frac{1}{\sqrt{D_{j-1} D_j}} \begin{vmatrix}
\langle \mathbf{v}_1, \mathbf{v}_1 \rangle & \langle \mathbf{v}_2, \mathbf{v}_1 \rangle & \dots & \langle \mathbf{v}_j, \mathbf{v}_1 \rangle \\
\langle \mathbf{v}_1, \mathbf{v}_2 \rangle & \langle \mathbf{v}_2, \mathbf{v}_2 \rangle & \dots & \langle \mathbf{v}_j, \mathbf{v}_2 \rangle \\
\vdots & \vdots & \ddots & \vdots \\
\langle \mathbf{v}_1, \mathbf{v}_{j-1} \rangle & \langle \mathbf{v}_2, \mathbf{v}_{j-1} \rangle & \dots &
\langle \mathbf{v}_j, \mathbf{v}_{j-1} \rangle \\
\mathbf{v}_1 & \mathbf{v}_2 & \dots & \mathbf{v}_j \end{vmatrix} </math>
 
:<math> \mathbf{u}_j = \frac{1}{D_{j-1} } \begin{vmatrix}
\langle \mathbf{v}_1, \mathbf{v}_1 \rangle & \langle \mathbf{v}_2, \mathbf{v}_1 \rangle & \dots & \langle \mathbf{v}_j, \mathbf{v}_1 \rangle \\
\langle \mathbf{v}_1, \mathbf{v}_2 \rangle & \langle \mathbf{v}_2, \mathbf{v}_2 \rangle & \dots & \langle \mathbf{v}_j, \mathbf{v}_2 \rangle \\
\vdots & \vdots & \ddots & \vdots \\
\langle \mathbf{v}_1, \mathbf{v}_{j-1} \rangle & \langle \mathbf{v}_2, \mathbf{v}_{j-1} \rangle & \dots &
\langle \mathbf{v}_j, \mathbf{v}_{j-1} \rangle \\
\mathbf{v}_1 & \mathbf{v}_2 & \dots & \mathbf{v}_j \end{vmatrix} </math>
 
where ''D'' <sub>0</sub>=1 and, for ''j'' ≥ 1, ''D <sub>j</sub>'' is the [[Gram determinant]]
 
:<math> D_j = \begin{vmatrix}
\langle \mathbf{v}_1, \mathbf{v}_1 \rangle & \langle \mathbf{v}_2, \mathbf{v}_1 \rangle & \dots & \langle \mathbf{v}_j, \mathbf{v}_1 \rangle \\
\langle \mathbf{v}_1, \mathbf{v}_2 \rangle & \langle \mathbf{v}_2, \mathbf{v}_2 \rangle & \dots & \langle \mathbf{v}_j, \mathbf{v}_2 \rangle \\
\vdots & \vdots & \ddots & \vdots \\
\langle \mathbf{v}_1, \mathbf{v}_j \rangle & \langle \mathbf{v}_2, \mathbf{v}_j\rangle & \dots &
\langle \mathbf{v}_j, \mathbf{v}_j \rangle \end{vmatrix}.  </math>
 
Note that the expression for '''u'''<sub>k</sub> is a "formal" determinant, i.e. the matrix contains both scalars
and vectors; the meaning of this expression is defined to be the result of a [[Laplace expansion|cofactor expansion]] along
the row of vectors.
 
The determinant formula for the Gram-Schmidt is computationally slower (exponentially slower) than the recursive algorithms described above;
it is mainly of theoretical interest.
 
== Alternatives ==
Other orthogonalization algorithms use [[Householder transformation]]s or [[Givens 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 <math>j</math>th orthogonalized vector after the <math>j</math>th iteration, while orthogonalization using [[Householder reflection]]s produces all the vectors only at the end. This makes only the Gram–Schmidt process applicable for [[iterative method]]s like the [[Arnoldi iteration]].
 
Yet another alternative is motivated by the use of [[Cholesky decomposition]] for [[Ordinary least squares|inverting the matrix of the normal equations in linear least squares]]. Let <math>\mathbf{V}</math> be a [[full rank|full column rank]] matrix, which columns need to be orthogonalized. The matrix <math>\mathbf{V}^{*} \mathbf{V} </math> is [[Hermitian matrix|Hermitian]] and [[Positive definite matrix|positive definite]], so it can be written as <math> \mathbf{V}^{*} \mathbf{V} = \mathbf{L} \mathbf{L}^{*}, </math> using the [[Cholesky decomposition]]. The lower triangular matrix <math>\mathbf{L} </math> with strictly positive diagonal entries is [[invertible]]. Then columns of the matrix <math>\mathbf{U}= \mathbf{V}(\mathbf{L}^{-1})^{*}</math> are [[orthonormal]] and [[linear span|span]] the same subspace as the columns of the original matrix <math>\mathbf{V}</math>. The explicit use of the product <math>\mathbf{V}^{*} \mathbf{V} </math> makes the algorithm unstable, especially if the product's [[condition number]] is large. Nevertheless, this algorithm is used in practice and implemented in some software packages because of its high efficiency and simplicity.
 
In [[quantum mechanics]] there are several orthogonalization schemes with characteristics better suited for applications than the Gram–Schmidt one. The most important among them are the symmetric and the canonical orthonormalization (see Solivérez & Gagliano).{{Clarify|date=October 2012}}
 
==References==
<references/>
* {{Citation | last1=Bau III | first1=David | last2=Trefethen | first2=Lloyd N. | author2-link=Lloyd N. Trefethen | title=Numerical linear algebra | publisher=Society for Industrial and Applied Mathematics | location=Philadelphia | isbn=978-0-89871-361-9 | year=1997}}.
* {{Citation | last1=Golub | first1=Gene H. | author1-link=Gene H. Golub | last2=Van Loan | first2=Charles F. | author2-link=Charles F. Van Loan | title=Matrix Computations | publisher=Johns Hopkins | edition=3rd | isbn=978-0-8018-5414-9 | year=1996}}.
* {{Citation | last1=Greub | first1=Werner | title=Linear Algebra | publisher = Springer | edition=4th |year = 1975}}.
* {{Citation | last1=Soliverez | first1=C. E. | last2=Gagliano | first2=E.| title=[http://rmf.smf.mx/pdf/rmf/31/4/31_4_743.pdf Orthonormalization on the plane: a geometric approach] | publisher=Mex. J. Phys. '''31''' (Nº&nbsp;4), pp.&nbsp;743&#8209;758 | year=1985}}.
 
==External links==
{{Portal|Mathematics}}
* {{springer|title=Orthogonalization|id=p/o070420}}
* [http://www.math.hmc.edu/calculus/tutorials/gramschmidt/gramschmidt.pdf Harvey Mudd College Math Tutorial on the Gram-Schmidt algorithm]
* [http://jeff560.tripod.com/g.html Earliest known uses of some of the words of mathematics: G] The entry "Gram-Schmidt orthogonalization" has some information and references on the origins of the method.
* Demos: [http://www.bigsigma.com/en/demo/gram-schmidt-plane Gram Schmidt process in plane] and [http://www.bigsigma.com/en/demo/gram-schmidt-space Gram Schmidt process in space]
* [http://www.math.ucla.edu/~tao/resource/general/115a.3.02f/GramSchmidt.html Gram-Schmidt orthogonalization applet]
* [http://www.nag.co.uk/numeric/fl/nagdoc_fl24/html/F05/f05conts.html NAG Gram–Schmidt orthogonalization of n vectors of order m routine]
* Proof: [http://planetmath.org/ProofOfGramSchmidtOrthogonalizationProcedure Raymond Puzio, Keenan Kidwell. "proof of Gram-Schmidt orthogonalization algorithm" (version 8). PlanetMath.org.]
 
{{linear algebra}}
 
{{DEFAULTSORT:Gram-Schmidt Process}}
[[Category:Linear algebra]]
[[Category:Functional analysis]]

Revision as of 16:42, 24 February 2014

The individual who wrote the post is called Jayson Hirano and he completely digs that title. Her family lives in Ohio. What me and my family members love is bungee leaping but I've been taking on new issues recently. Since he was eighteen he's been working as an information officer but he plans on altering it.

Also visit my homepage: psychic solutions by lynne