Second law of thermodynamics: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>BG19bot
m WP:CHECKWIKI error fix for #61. Punctuation goes before References. Do general fixes if a problem exists. - using AWB (9916)
en>Chjoaygame
wording
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
In [[linear algebra]], the '''Cholesky decomposition''' or '''Cholesky factorization''' is a [[matrix decomposition|decomposition]] of a [[Hermitian matrix|Hermitian]], [[positive-definite matrix]] into the product of a [[lower triangular matrix]] and its [[conjugate transpose]], useful for efficient numerical solutions and [[Monte Carlo simulation]]s. It was discovered by [[André-Louis Cholesky]] for real matrices. When it is applicable, the Cholesky decomposition is roughly twice as efficient as the [[LU decomposition]] for solving [[System of linear equations|systems of linear equations]].<ref>{{cite book|last=Press|first=William H.|coauthors=Saul A. Teukolsky, William T. Vetterling, Brian P. Flannery|title=Numerical Recipes in C: The Art of Scientific Computing (second edition)|publisher=Cambridge University Press|year=1992|pages=994|url=http://www.nr.com/|isbn=0-521-43108-5}}</ref>
My name's Eileen Steinberg but everybody calls me Eileen. I'm from Italy. I'm studying at the university (3rd year) and I play the Clarinet for 9 years. Usually I choose songs from the famous films :D. <br>I have two brothers. I like Vintage clothing, watching TV (The Simpsons) and Element collecting.<br><br>Look into my web-site :: [http://hetilainat.fi http://hetilainat.fi/]
 
== Statement ==
The Cholesky decomposition of a [[Hermitian matrix|Hermitian]] [[positive-definite matrix]] '''A''' is a decomposition of the form
 
: <math>\mathbf{A = L L}^{*}</math>
 
where '''L''' is a [[lower triangular matrix]] with real and positive diagonal entries, and '''L'''* denotes the [[conjugate transpose]] of '''L'''. Every Hermitian positive-definite matrix (and thus also every real-valued symmetric positive-definite matrix) has a unique Cholesky decomposition.<ref>{{harvtxt|Golub|Van Loan|1996|p=143}}, {{harvtxt|Horn|Johnson|1985|p=407}}, {{harvtxt|Trefethen|Bau|1997|p=174}}</ref>
 
If the matrix '''A''' is Hermitian and positive semi-definite, then it still has a decomposition of the form '''A''' = '''LL'''* if the diagonal entries of '''L''' are allowed to be zero.<ref>{{harvtxt|Golub|Van Loan|1996|p=147}}</ref>
 
When '''A''' has real entries, '''L''' has real entries as well and the factorization may be written '''A = LL<sup>T</sup>''' <ref>{{harvtxt|Horn|Johnson|1985|p=407}}</ref>
 
The Cholesky decomposition is unique when '''A''' is [[positive definite matrix|positive definite]]; there is only one lower triangular matrix '''L''' with strictly positive diagonal entries such that '''A''' = '''LL'''*. However, the decomposition need not be unique when '''A''' is positive semidefinite.
 
The converse holds trivially: if '''A''' can be written as '''LL'''* for some invertible '''L''', lower triangular or otherwise, then '''A''' is Hermitian and positive definite.
 
== LDL decomposition ==
 
A closely related variant of the classical Cholesky decomposition is the LDL decomposition,
 
: <math>\mathbf{A = L D L}^{*}</math>
 
where '''L''' is a [[Triangular matrix#Unitriangular matrix|lower unit triangular (unitriangular)]] matrix and '''D''' is a [[diagonal matrix|diagonal]] matrix.
 
This decomposition is related to the classical Cholesky decomposition, of the form '''LL'''*, as follows:
 
: <math>\mathbf{A = L D L}^{*} = \mathbf L \mathbf D^{\frac 1 2} \mathbf D^{{\frac 1 2}{*}} \mathbf L^{*} =
\mathbf L \mathbf D^{\frac 1 2} (\mathbf L \mathbf D^{\frac 1 2})^{*}</math>
 
The LDL variant, if efficiently implemented, requires the same space and computational complexity to construct and use but avoids extracting square roots.<ref name="kri">{{cite journal|last=Krishnamoorthy|first=Aravindh|coauthors=Menon, Deepak|title=Matrix Inversion Using Cholesky Decomposition|year=2011|url=http://arxiv.org/abs/1111.4144}}</ref> Some indefinite matrices for which no Cholesky decomposition exists have an LDL decomposition with negative entries in '''D'''. For these reasons, the LDL decomposition may be preferred.
For real matrices, the factorization has the form '''A = LDL<sup>T</sup>''' and is often referred to as '''LDLT decomposition''' (or LDL<sup>T</sup> decomposition).  It is closely related to the [[eigendecomposition of a matrix#Real symmetric matrices|eigendecomposition of real symmetric matrices]], '''A=QΛQ<sup>T</sup>'''.
 
== Example ==
 
Here is the Cholesky decomposition of a symmetric real matrix:
 
: <math>\begin{align}
\left(
  \begin{array}{*{3}{r}}
      4 &  12 & -16 \\
    12 &  37 & -43 \\
    -16 & -43 &  98 \\
  \end{array}
\right)
& =
\left(
  \begin{array}{*{3}{r}}
    2 &    &    \\
    6 &  1 &    \\
    -8 &  5 &  3 \\
  \end{array}
\right)
\left(
  \begin{array}{*{3}{r}}
    2 &  6 & -8 \\
      &  1 &  5 \\
      &    &  3 \\
  \end{array}
\right)
\end{align}</math>
 
And here is the LDL<sup>T</sup> decomposition of the same matrix:
 
: <math>\begin{align}
\left(
  \begin{array}{*{3}{r}}
      4 &  12 & -16 \\
    12 &  37 & -43 \\
    -16 & -43 &  98 \\
  \end{array}
\right)
& =
\left(
  \begin{array}{*{3}{r}}
    1 &    &    \\
    3 &  1 &    \\
    -4 &  5 &  1 \\
  \end{array}
\right)
\left(
  \begin{array}{*{3}{r}}
    4 &    &    \\
      &  1 &    \\
      &    &  9 \\
  \end{array}
\right)
\left(
  \begin{array}{*{3}{r}}
    1 &  3 & -4 \\
      &  1 &  5 \\
      &    &  1 \\
  \end{array}
\right)
\end{align}</math>
 
== Applications ==
The Cholesky decomposition is mainly used for the numerical solution of [[system of linear equations|linear equations]] '''Ax''' = '''b'''. If '''A''' is symmetric and positive definite, then we can solve '''Ax''' = '''b''' by first computing the Cholesky decomposition '''A''' = '''LL'''*, then solving '''Ly''' = '''b''' for '''y''' by [[forward substitution]], and finally solving '''L'''*'''x''' = '''y''' for '''x''' by [[back substitution]].
 
For linear systems that can be put into symmetric form, the Cholesky decomposition (or its LDL variant) is the method of choice, for superior efficiency and numerical stability. Compared to the [[LU decomposition]], it is roughly twice as efficient.
 
===Linear least squares===
Systems of the form '''Ax''' = '''b''' with '''A''' symmetric and positive definite arise quite often in applications. For instance, the normal equations in [[linear least squares (mathematics)|linear least squares]] problems are of this form. It may also happen that matrix '''A''' comes from an energy functional which must be positive from physical considerations; this happens frequently in the numerical solution of [[partial differential equation]]s.
 
===Non-linear optimization===
Non-linear multi-variate functions may be minimized over their parameters using variants of Newton's method called ''quasi-Newton'' methods.  At each iteration, the search takes a step '''s''' defined by solving '''Hs''' = '''-g''' for '''s''', where '''s''' is the step, '''g''' is the ''gradient'' vector of the function's partial first derivatives with respect to the parameters, and '''H''' is an approximation to the [[Hessian matrix]] of partial second derivatives formed by repeated rank 1 updates at each iteration.  Two well-known update formulae are called [[Davidon-Fletcher-Powell]] (DFP) and [[BFGS method|Broyden-Fletcher-Goldfarb-Shanno]] (BFGS). Loss of the positive-definite condition through round-off error is avoided if rather than updating an approximation to the inverse of the Hessian, one updates the Cholesky decomposition of an approximation of the Hessian matrix itself.{{Citation needed|date=February 2011}}
 
===Monte Carlo simulation===
The Cholesky decomposition is commonly used in the [[Monte Carlo method]] for simulating systems with multiple correlated variables: The [[correlation matrix]] is decomposed, to give the lower-triangular '''L'''. Applying this to a vector of uncorrelated samples, '''u''', produces a sample vector '''Lu''' with the covariance properties of the system being modeled.<ref name="Matlab documentation">[http://www.mathworks.com/help/techdoc/ref/randn.html Matlab randn documentaion].</ref>
 
For a simplified example that shows the economy one gets from Cholesky's decomposition, say one needs to generate two correlated normal variables <math>x_1</math> and <math>x_2</math>. All one needs to do is generate two uncorrelated Gaussian random variables <math>z_1</math> and <math>z_2</math>. We set <math>x_1 = z_1</math> and <math>x_2 =  \rho z_1 + \sqrt{1-\rho^2} z_2</math>.
 
===Kalman filters===
[[Unscented Kalman filter]]s commonly use the Cholesky decomposition to choose a set of so-called sigma points.  The Kalman filter tracks the average state of a system as a vector '''x''' of length ''N'' and covariance as an ''N''-by-''N'' matrix '''P'''.  The matrix '''P''' is always positive semi-definite, and can be decomposed into '''LL'''<sup>T</sup>.  The columns of '''L''' can be added and subtracted from the mean '''x''' to form a set of 2''N'' vectors called ''sigma points''.  These sigma points completely capture the mean and covariance of the system state.
 
===Matrix inversion===
The explicit [[inverse matrix|inverse]] of a Hermitian matrix can be computed via Cholesky decomposition, in a manner similar to solving linear systems, using <math>\textstyle{n^3}</math> operations (<math>\textstyle\frac{1}{2}n^3</math> multiplications).<ref name="kri"/> The entire inversion can even be efficiently performed in-place.
 
A non-Hermitian matrix '''B''' can also be inverted using the following identity, where '''BB'''* will always be Hermitian:
 
: <math>\mathbf{B}^{-1} = \mathbf{B}^{*} \mathbf{(B B ^ {*})}^{-1}</math>.
 
== Computation ==
There are various methods for calculating the Cholesky decomposition. The computational complexity of commonly used algorithms is ''O''(''n''<sup>3</sup>) in general.{{Citation needed|date=June 2011}} The algorithms described below all involve about ''n''<sup>3</sup>/3 [[FLOP]]s, where ''n'' is the size of the matrix '''A'''. Hence, they are half the cost of the [[LU decomposition]], which uses 2''n''<sup>3</sup>/3 FLOPs (see Trefethen and Bau 1997).
 
Which of the algorithms below is faster depends on the details of the implementation. Generally, the first algorithm will be slightly slower because it accesses the data in a less regular manner.
 
=== The Cholesky algorithm ===
The '''Cholesky algorithm''', used to calculate the decomposition matrix ''L'', is a modified version of [[Gaussian elimination]].
 
The recursive algorithm starts with ''i'' := 1 and
:'''A'''<sup>(1)</sup> := '''A'''.
 
At step ''i'', the matrix '''A'''<sup>(''i'')</sup> has the following form:
:<math>\mathbf{A}^{(i)}=
\begin{pmatrix}
\mathbf{I}_{i-1} & 0              & 0 \\
0                & a_{i,i}        & \mathbf{b}_{i}^{*} \\
0                & \mathbf{b}_{i} & \mathbf{B}^{(i)}
\end{pmatrix},
</math>
where '''I'''<sub>''i''&minus;1</sub> denotes the [[identity matrix]] of dimension ''i'' &minus; 1.
 
If we now define the matrix '''L'''<sub>''i''</sub> by
:<math>\mathbf{L}_{i}:=
\begin{pmatrix}
\mathbf{I}_{i-1} & 0                                  & 0 \\
0                & \sqrt{a_{i,i}}          & 0 \\
0                & \frac{1}{\sqrt{a_{i,i}}} \mathbf{b}_{i} & \mathbf{I}_{n-i}
\end{pmatrix},
</math>
then we can write '''A'''<sup>(''i'')</sup> as
:<math>\mathbf{A}^{(i)} = \mathbf{L}_{i} \mathbf{A}^{(i+1)} \mathbf{L}_{i}^{*}</math>
where
:<math>\mathbf{A}^{(i+1)}=
\begin{pmatrix}
\mathbf{I}_{i-1} & 0 & 0 \\
0                & 1 & 0 \\
0                & 0 & \mathbf{B}^{(i)} - \frac{1}{a_{i,i}} \mathbf{b}_{i} \mathbf{b}_{i}^{*}
\end{pmatrix}.</math>
Note that '''b'''<sub>''i''</sub> '''b'''*<sub>''i''</sub> is an [[outer product]], therefore this algorithm is called the ''outer product version'' in (Golub & Van Loan).
 
We repeat this for ''i'' from 1 to ''n''. After ''n'' steps, we get '''A'''<sup>(''n''+1)</sup> = '''I'''. Hence, the lower triangular matrix ''L'' we are looking for is calculated as
 
:<math>\mathbf{L} := \mathbf{L}_{1} \mathbf{L}_{2} \dots \mathbf{L}_{n}.</math>
 
=== The Cholesky&ndash;Banachiewicz and Cholesky&ndash;Crout algorithms ===
[[File:Chol.gif|thumb|Access pattern (white) and writing pattern (yellow) for the in-place Cholesky—Banachiewicz  algorithm on a 5x5 matrix.]]
If we write out the equation '''A''' = '''LL'''*,
:<math>\begin{align}
{\mathbf{A=LL^T}} & =
\begin{pmatrix}  L_{11} & 0 & 0 \\
  L_{21} & L_{22} & 0 \\
  L_{31} & L_{32} & L_{33}\\
\end{pmatrix}
\begin{pmatrix}  L_{11} & L_{21} & L_{31} \\
  0 & L_{22} & L_{32} \\
  0 & 0 & L_{33}
\end{pmatrix} \\
& =
\begin{pmatrix}  L_{11}^2 &  &(\text{symmetric})  \\
  L_{21}L_{11} & L_{21}^2 + L_{22}^2& \\
  L_{31}L_{11} & L_{31}L_{21}+L_{32}L_{22} & L_{31}^2 + L_{32}^2+L_{33}^2
\end{pmatrix}
\end{align}</math>
 
we obtain the following formula for the entries of '''L''':
 
:<math> L_{j,j} = \sqrt{ A_{j,j} - \sum_{k=1}^{j-1} L_{j,k}^2 }. </math>
:<math> L_{i,j} = \frac{1}{L_{j,j}} \left( A_{i,j} - \sum_{k=1}^{j-1} L_{i,k} L_{j,k} \right), \qquad\text{for } i>j. </math>
 
The expression under the [[square root]] is always positive if '''A''' is real and positive-definite.
 
For complex Hermitian matrix, the following formula applies:
 
:<math> L_{j,j} = \sqrt{ A_{j,j} - \sum_{k=1}^{j-1} L_{j,k}L_{j,k}^* }. </math>
:<math> L_{i,j} = \frac{1}{L_{j,j}} \left( A_{i,j} - \sum_{k=1}^{j-1} L_{i,k} L_{j,k}^* \right), \qquad\text{for } i>j. </math>
 
So we can compute the (''i'', ''j'') entry if we know the entries to the left and above. The computation is usually arranged in either of the following orders.
* The '''Cholesky&ndash;Banachiewicz algorithm''' starts from the upper left corner of the matrix ''L'' and proceeds to calculate the matrix row by row.
* The '''Cholesky&ndash;Crout algorithm''' starts from the upper left corner of the matrix ''L'' and proceeds to calculate the matrix column by column.
 
Either pattern of access allows the entire computation to be performed in-place if desired.
 
=== Stability of the computation ===
Suppose that we want to solve a [[condition number|well-conditioned]] system of linear equations. If the LU decomposition is used, then the algorithm is unstable unless we use some sort of pivoting strategy. In the latter case, the error depends on the so-called growth factor of the matrix, which is usually (but not always) small.
 
Now, suppose that the Cholesky decomposition is applicable. As mentioned above, the algorithm will be twice as fast. Furthermore, no pivoting is necessary and the error will always be small. Specifically, if we want to solve '''Ax''' = '''b''', and '''y''' denotes the computed solution, then '''y''' solves the disturbed system ('''A''' + '''E''')'''y''' = '''b''' where
:<math> \|\mathbf{E}\|_2 \le c_n \varepsilon \|\mathbf{A}\|_2. </math>
Here, || ||<sub>2</sup> is the [[matrix norm|matrix 2-norm]], ''c<sub>n</sub>'' is a small constant depending on ''n'', and ε denotes the [[unit round-off]].
 
One concern with the Cholesky decomposition to be aware of is the use of square roots. If the matrix being factorized is positive definite as required, the numbers under the square roots are always positive ''in exact arithmetic''. Unfortunately, the numbers can become negative because of [[round-off error]]s, in which case the algorithm cannot continue. However, this can only happen if the matrix is very ill-conditioned. One way to address this is to add a diagonal correction matrix to the matrix being decomposed in an attempt to promote the positive-definiteness.<ref>{{cite journal|last=Fang|first=Haw-ren|coauthors=O’Leary, Dianne P.|title=Modified Cholesky Algorithms: A Catalog with New Approaches|date=8 August 2006|url=http://www.cs.umd.edu/~oleary/tr/tr4807.pdf}}</ref> While this might lessen the accuracy of the decomposition, it can be very favorable for other reasons; for example, when performing [[Newton's method in optimization]], adding a diagonal matrix can improve stability when far from the optimum.
 
=== LDL decomposition ===
An alternative form, eliminating the need to take square roots, is the symmetric indefinite factorization<ref>{{cite book |first=D. |last=Watkins |year=1991 |title=Fundamentals of Matrix Computations |location=New York |publisher=Wiley |page=84 |isbn=0-471-61414-9 }}</ref>
:<math>
\begin{align}
{\mathbf{A=LDL}^\mathrm{T}} & =
\begin{pmatrix}  1 & 0 & 0 \\
  L_{21} & 1 & 0 \\
  L_{31} & L_{32} & 1\\
\end{pmatrix}
\begin{pmatrix}  D_1 & 0 & 0 \\
  0 & D_2 & 0 \\
  0 & 0 & D_3\\
\end{pmatrix}
\begin{pmatrix}  1 & L_{21} & L_{31} \\
  0 & 1 & L_{32} \\
  0 & 0 & 1\\
\end{pmatrix} \\
& = \begin{pmatrix}  D_1 &  &(\mathrm{symmetric})  \\
  L_{21}D_1 & L_{21}^2D_1 + D_2& \\
  L_{31}D_1 & L_{31}L_{21}D_{1}+L_{32}D_2 & L_{31}^2D_1 + L_{32}^2D_2+D_3.
\end{pmatrix}
\end{align}
</math>
 
If '''A''' is real, the following recursive relations apply for the entries of '''D''' and '''L''':
:<math> D_j = A_{jj} - \sum_{k=1}^{j-1} L_{jk}^2 D_k </math>
:<math> L_{ij} = \frac{1}{D_j} \left( A_{ij} - \sum_{k=1}^{j-1} L_{ik} L_{jk} D_k \right), \qquad\text{for } i>j. </math>
 
For complex Hermitian matrix '''A''', the following formula applies:
:<math> D_{j} = A_{jj} - \sum_{k=1}^{j-1} L_{jk}L_{jk}^* D_k </math>
:<math> L_{ij} = \frac{1}{D_j} \left( A_{ij} - \sum_{k=1}^{j-1} L_{ik} L_{jk}^* D_k \right), \qquad\text{for } i>j. </math>
 
Again, the pattern of access allows the entire computation to be performed in-place if desired.
 
===Block variant===
When used on indefinite matrices, the '''LDL'''* factorization is known to be unstable without careful pivoting;<ref>{{cite book|last=Nocedal|first=Jorge|title=Numerical Optimization|year=2000|publisher=Springer}}</ref> specifically, the elements of the factorization can grow arbitrarily. A possible improvement is to perform the factorization on block sub-matrices, commonly 2x2:<ref>{{cite journal|last=Fang|first=Haw-ren|title=Analysis of Block LDLT Factorizations for Symmetric Indefinite Matrices|date=24 August 2007}}</ref>
 
:<math>\begin{align}
{\mathbf{A=LDL}^\mathrm{T}} & =
\begin{pmatrix}
\mathbf I & 0 & 0 \\
\mathbf L_{21} & \mathbf I & 0 \\
\mathbf L_{31} & \mathbf L_{32} & \mathbf I\\
\end{pmatrix}
\begin{pmatrix}
\mathbf D_1 & 0 & 0 \\
0 & \mathbf D_2 & 0 \\
0 & 0 & \mathbf D_3\\
\end{pmatrix}
\begin{pmatrix}
\mathbf I & \mathbf L_{21}^\mathrm T & \mathbf L_{31}^\mathrm T \\
0 & \mathbf I & \mathbf L_{32}^\mathrm T \\
0 & 0 & \mathbf I\\
\end{pmatrix} \\
& = \begin{pmatrix}
\mathbf D_1 &  &(\mathrm{symmetric})  \\
\mathbf L_{21} \mathbf D_1 & \mathbf L_{21} \mathbf D_1 \mathbf L_{21}^\mathrm T + \mathbf D_2& \\
\mathbf L_{31} \mathbf D_1 & \mathbf  L_{31} \mathbf D_{1} \mathbf L_{21}^\mathrm T + \mathbf  L_{32} \mathbf D_2 & \mathbf L_{31} \mathbf D_1 \mathbf L_{31}^\mathrm T + \mathbf L_{32} \mathbf D_2 \mathbf L_{32}^\mathrm T + \mathbf D_3
\end{pmatrix}
\end{align}
</math>
 
where every element in the matrices above is a square submatrix. From this, these analogous recursive relations follow:
 
:<math>\mathbf D_j = \mathbf A_{jj} - \sum_{k=1}^{j-1} \mathbf L_{jk} \mathbf D_k \mathbf L_{jk}^\mathrm T</math>
:<math>\mathbf L_{ij} = \left(\mathbf A_{ij} - \sum_{k=1}^{j-1} \mathbf L_{ik} \mathbf D_k \mathbf L_{jk}^\mathrm T\right) \mathbf D_j^{-1}</math>
 
Note the presence of matrix products and explicit inversion, this limits the practical block size.
 
===Updating the decomposition===
A task that often arises in practice is that one needs to update a Cholesky decomposition. In more details, one has already computed the Cholesky decomposition '''A''' = '''LL'''* of some matrix '''A''', then one changes the matrix '''A''' in some way into another matrix, say <math> \tilde{\mathbf{A}} </math>, and one wants to compute the Cholesky decomposition of the updated matrix: <math> \tilde{\mathbf{A}} = \tilde{\mathbf{L}} \tilde{\mathbf{L}}^* </math>. The question is now whether one can use the Cholesky decomposition of '''A''' that was computed before to compute the Cholesky decomposition of <math> \tilde{\mathbf{A}} </math>.
 
==== Rank-one update ====
The specific case, where the updated matrix <math> \tilde{\mathbf{A}} </math> is related to the matrix '''A''' by <math> \tilde{\mathbf{A}} = \mathbf{A} + \mathbf{x} \mathbf{x}^* </math>, is known as a ''rank-one update''.
 
Here is a little function based on <ref>{{cite book|last=Stewart|first=G. W.|title=Basic decompositions|year=1998|publisher=Soc. for Industrial and Applied Mathematics|location=Philadelphia|isbn=0-89871-414-1}}</ref> written in [[Matlab]] syntax which realizes a rank-one update:
<syntaxhighlight lang="matlab">
function [L] = cholupdate(L,x)
    p = length(x);
    x = x';
    for k=1:p
        r = sqrt(L(k,k)^2 + x(k)^2);
        c = r / L(k, k);
        s = x(k) / L(k, k);
        L(k, k) = r;
        L(k,k+1:p) = (L(k,k+1:p) + s*x(k+1:p)) / c;
        x(k+1:p) = c*x(k+1:p) - s*L(k, k+1:p);
    end
end
</syntaxhighlight>
 
==== Rank-one downdate ====
A ''rank-one downdate'' is similar to a rank-one update, except that the addition is replaced by subtraction: <math> \tilde{\mathbf{A}} = \mathbf{A} - \mathbf{x} \mathbf{x}^* </math>. This only works if the new matrix <math> \tilde{\mathbf{A}} </math> is still definite positive, which is the case if every element of the vector '''x''' is bigger in absolute value than the corresponding element on the diagonal of '''L'''.
 
The code for the rank-one update shown above can easily be adapted to do a rank-one downdate: one merely needs to replace the two additions in the assignment to <code> r </code> and <code> L(k,k+1:p) </code> by subtractions.
 
== Proof for positive semi-definite matrices ==
The above algorithms show that every positive definite matrix '''A''' has a Cholesky decomposition. This result can be extended to the positive semi-definite case by a limiting argument. The argument is not fully constructive, i.e., it gives no explicit numerical algorithms for computing Cholesky factors.
 
If '''A''' is an ''n''-by-''n'' positive semi-definite matrix, then the sequence {'''A'''<sub>''k''</sub>} = {'''A''' + (1/''k'')'''I'''<sub>''n''</sub>} consists of positive definite matrices. (This is an immediate consequence of, for example, the spectral mapping theorem for the polynomial functional calculus.) Also,
 
:'''A'''<sub>''k''</sub> → '''A'''
 
in [[operator norm]]. From the positive definite case, each '''A'''<sub>''k''</sub> has Cholesky decomposition '''A'''<sub>''k''</sub> = '''L'''<sub>''k''</sub>'''L'''*<sub>''k''</sub>. By property of the operator norm,
 
:<math>\| \mathbf{L}_k \|^2 \le \|  \mathbf{L}_k \mathbf{L}_k ^* \| = \| \mathbf{A}_k \|.</math>
 
So {'''L'''<sub>''k''</sub>} is a bounded set in the [[Banach space]] of operators, therefore [[relatively compact]] (because the underlying vector space is finite dimensional). Consequently it has a convergent subsequence, also denoted by {'''L'''<sub>''k''</sub>}, with limit '''L'''. It can be easily checked that this '''L''' has the desired properties, i.e. '''A''' = '''LL*''' and '''L''' is lower triangular with non-negative diagonal entries: for all ''x'' and ''y'',
 
:<math> \langle \mathbf{A} x, y \rangle = \langle \lim \mathbf{A}_k x, y \rangle = \langle \lim \mathbf{L}_k \mathbf{L}_k^* x, y \rangle = \langle \mathbf{L} \mathbf{L}^*x, y \rangle. </math>
 
Therefore '''A''' = '''LL'''*. Because the underlying vector space is finite dimensional, all topologies on the space of operators are equivalent. So '''L'''<sub>''k''</sub> tends to '''L''' in norm means '''L'''<sub>''k''</sub> tends to '''L''' entrywise. This in turn implies that, since each '''L'''<sub>''k''</sub> is lower triangular with non-negative diagonal entries, '''L''' is also.
 
== Generalization ==
The Cholesky factorization can be generalized to (not necessarily finite) matrices with operator entries. Let <math>\{\mathcal{H}_n \}</math> be a sequence of [[Hilbert spaces]]. Consider the operator matrix
 
:<math>
\mathbf{A} =
\begin{bmatrix}
\mathbf{A}_{11}  & \mathbf{A}_{12}  & \mathbf{A}_{13} & \; \\
\mathbf{A}_{12}^* & \mathbf{A}_{22}  & \mathbf{A}_{23} & \; \\
\mathbf{A} _{13}^* & \mathbf{A}_{23}^* & \mathbf{A}_{33} & \; \\
\;      & \;      & \;    & \ddots
\end{bmatrix}
</math>
 
acting on the direct sum
 
:<math>\mathcal{H} = \oplus _n  \mathcal{H}_n,</math>
 
where each
 
:<math>\mathbf{A}_{ij} : \mathcal{H}_j \rightarrow \mathcal{H} _i</math>
 
is a [[bounded operator]]. If '''A''' is positive (semidefinite) in the sense that for all finite ''k'' and for any
 
:<math>h \in \oplus _{n = 1 }^k \mathcal{H}_k ,</math>
 
we have <math>\langle h, \mathbf{A} h\rangle \ge 0</math>, then there exists a lower triangular operator matrix '''L''' such that '''A''' = '''LL*'''. One can also take the diagonal entries of '''L''' to be positive.
 
== Implementations in Programming Languages ==
In Python, the command "cholesky" from the numpy.linalg module performs Cholesky decomposition. In Matlab Programming, the "chol" command can be used to simply apply this to a matrix. Please see Matlab help documents for more details. In R the "chol" gives Cholesky decomposition.
 
==See also==
*[[Symbolic Cholesky decomposition]]
*[[Minimum degree algorithm]]
*[[Matrix decomposition]]
*[[Sylvester's law of inertia]]
*[[Cycle rank]]
*[[Matrix square root]]
 
==Notes==
{{Reflist}}
 
==References==
*{{Cite journal
| last1 = Dereniowski | first1 = Dariusz
| last2 = Kubale | first2 = Marek
| contribution = Cholesky Factorization of Matrices in Parallel and Ranking of Graphs | doi = 10.1007/978-3-540-24669-5_127
| pages = 985–992
| publisher = Springer-Verlag
| series = Lecture Notes on Computer Science
| title = 5th International Conference on Parallel Processing and Applied Mathematics
| url = http://www.eti.pg.gda.pl/katedry/kams/wwwkams/pdf/Cholesky_fmprg.pdf
| volume = 3019
| year = 2004
| postscript = <!-- Bot inserted parameter. Either remove it; or change its value to "." for the cite to end in a ".", as necessary. -->{{inconsistent citations}}
| isbn = 978-3-540-21946-0}}.
* {{citation | first1=Gene H. | last1=Golub | author1-link=Gene H. Golub | first2=Charles F. | last2=Van Loan | author2-link=Charles F. Van Loan | year=1996 | title=Matrix Computations | edition=3rd | publisher=Johns Hopkins | place=Baltimore | isbn=978-0-8018-5414-9}}.
* {{citation | first1=Roger A. | last1=Horn | first2=Charles R. | last2=Johnson | year=1985 | title=Matrix Analysis | publisher=Cambridge University Press | isbn=0-521-38632-2 }}.
* S. J. Julier and J. K. Uhlmann. "A General Method for Approximating Nonlinear Transformations of ProbabilityDistributions".
* S. J. Julier and J.K. Uhlmann, "A new extension of the Kalman filter to nonlinear systems," in Proc. AeroSense: 11th Int. Symp. Aerospace/Defence Sensing, Simulation and Controls, 1997, pp.&nbsp;182–193.
* {{Citation | last1=Trefethen | first1=Lloyd N. | author1-link=Lloyd N. Trefethen | last2=Bau | first2=David | title=Numerical linear algebra | publisher=Society for Industrial and Applied Mathematics | location=Philadelphia | isbn=978-0-89871-361-9 | year=1997}}.
 
== External links ==
 
===Information===
* {{springer|title=Cholesky factorization|id=p/c120160}}
* {{planetmath reference|id=1287|title=Cholesky Decomposition}}
*[http://rkb.home.cern.ch/rkb/AN16pp/node33.html#SECTION000330000000000000000 Cholesky Decomposition], The Data Analysis BriefBook
*[http://math.fullerton.edu/mathews/n2003/CholeskyMod.html Module for Cholesky Factorization]
*[http://www.math-linux.com/spip.php?article43 Cholesky Decomposition] on www.math-linux.com
*[http://sciencemeanderthal.wordpress.com/2012/06/28/cholesky-decomposition-of-variance-covariance-matrices-in-the-classic-twin-study/ Cholesky Decomposition Made Simple] on Science Meanderthal
 
===Computer code===
*[http://netlib.org/lapack/ LAPACK] is a collection of FORTRAN subroutines for solving dense linear algebra problems
*[http://www.alglib.net/ ALGLIB] includes a partial port of the LAPACK to C++, C#, Delphi, Visual Basic, etc.
*[http://www.cs.utexas.edu/users/flame/ libflame] is a C library with LAPACK functionality.
*[http://www.cs.utexas.edu/users/flame/Movies.html#Chol Notes and video on high-performance implementation of Cholesky factorization] at The University of Texas at Austin.
*[http://upcommons.upc.edu/pfc/handle/2099.1/10988/ Cholesky : TBB + Threads + SSE] is a book explaining the implementation of the CF with TBB,threads and SSE (in Spanish).
*[http://code.google.com/p/ceres-solver/ library "Ceres Solver" ] by Google.
*[http://infohost.nmt.edu/~borchers/ldlt.html LDL decomposition] routines in Matlab.
 
===Use of the matrix in simulation===
*[http://approximity.com/papers/ptfopt/node19.html Simulation of correlated normal random variables]
*[http://www.columbia.edu/~mh2078/MCS04/MCS_framework_FEegs.pdf Generating Correlated Random Variables], Martin Haugh, [[Columbia University]]
 
===Online calculators===
* [http://www.bluebit.gr/matrix-calculator/  Online Matrix Calculator] Performs Cholesky decomposition of matrices online.
 
{{Numerical linear algebra}}
 
[[Category:Operator theory]]
[[Category:Matrix decompositions]]
[[Category:Numerical linear algebra]]

Latest revision as of 12:45, 13 January 2015

My name's Eileen Steinberg but everybody calls me Eileen. I'm from Italy. I'm studying at the university (3rd year) and I play the Clarinet for 9 years. Usually I choose songs from the famous films :D.
I have two brothers. I like Vintage clothing, watching TV (The Simpsons) and Element collecting.

Look into my web-site :: http://hetilainat.fi/