fbpx
Wikipedia

Cholesky decomposition

In linear algebra, the Cholesky decomposition or Cholesky factorization (pronounced /ʃəˈlɛski/ shə-LES-kee) is a decomposition of a Hermitian, positive-definite matrix into the product of a lower triangular matrix and its conjugate transpose, which is useful for efficient numerical solutions, e.g., Monte Carlo simulations. It was discovered by André-Louis Cholesky for real matrices, and posthumously published in 1924.[1] When it is applicable, the Cholesky decomposition is roughly twice as efficient as the LU decomposition for solving systems of linear equations.[2]

Statement

The Cholesky decomposition of a Hermitian positive-definite matrix A, is a decomposition of the form

 

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.[3]

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.

When A is a real matrix (hence symmetric positive-definite), the factorization may be written

 

where L is a real lower triangular matrix with positive diagonal entries.[4][5][6]

Positive semidefinite matrices

If a Hermitian matrix A is only positive semidefinite, instead of positive definite, then it still has a decomposition of the form A = LL* where the diagonal entries of L are allowed to be zero.[7] The decomposition need not be unique, for example:

 

However, if the rank of A is r, then there is a unique lower triangular L with exactly r positive diagonal elements and nr columns containing all zeroes.[8]

Alternatively, the decomposition can be made unique when a pivoting choice is fixed. Formally, if A is an n × n positive semidefinite matrix of rank r, then there is at least one permutation matrix P such that P A PT has a unique decomposition of the form P A PT = L L* with  , where L1 is an r × r lower triangular matrix with positive diagonal.[9]

LDL decomposition

A closely related variant of the classical Cholesky decomposition is the LDL decomposition,

 

where L is a lower unit triangular (unitriangular) matrix, and D is a diagonal matrix. That is, the diagonal elements of L are required to be 1 at the cost of introducing an additional diagonal matrix D in the decomposition. The main advantage is that the LDL decomposition can be computed and used with essentially the same algorithms, but avoids extracting square roots.[10]

For this reason, the LDL decomposition is often called the square-root-free Cholesky decomposition. For real matrices, the factorization has the form A = LDLT and is often referred to as LDLT decomposition (or LDLT decomposition, or LDL′). It is reminiscent of the eigendecomposition of real symmetric matrices, A = QΛQT, but is quite different in practice because Λ and D are not similar matrices.

The LDL decomposition is related to the classical Cholesky decomposition of the form LL* as follows:

 

Conversely, given the classical Cholesky decomposition   of a positive definite matrix, if S is a diagonal matrix that contains the main diagonal of  , then A can be decomposed as   where

  (this rescales each column to make diagonal elements 1),
 

If A is positive definite then the diagonal elements of D are all positive. For positive semidefinite A, an   decomposition exists where the number of non-zero elements on the diagonal D is exactly the rank of A.[11] Some indefinite matrices for which no Cholesky decomposition exists have an LDL decomposition with negative entries in D: it suffices that the first n−1 leading principal minors of A are non-singular.[12]

Example

Here is the Cholesky decomposition of a symmetric real matrix:

 

And here is its LDLT decomposition:

 

Applications

The Cholesky decomposition is mainly used for the numerical solution of linear equations  . If A is symmetric and positive definite, then we can solve   by first computing the Cholesky decomposition  , then solving   for y by forward substitution, and finally solving   for x by back substitution.

An alternative way to eliminate taking square roots in the   decomposition is to compute the LDL decomposition  , then solving   for y, and finally solving  .

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.[2]

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 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 equations.

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 iteration k, the search steps in a direction   defined by solving   for  , where   is the step direction,   is the gradient, and   is an approximation to the Hessian matrix formed by repeating rank-1 updates at each iteration. Two well-known update formulas are called Davidon–Fletcher–Powell (DFP) and 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 .[13]

Monte Carlo simulation

The Cholesky decomposition is commonly used in the Monte Carlo method for simulating systems with multiple correlated variables. The covariance 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.[14]

The following simplified example shows the economy one gets from the Cholesky decomposition: suppose the goal is to generate two correlated normal variables   and   with given correlation coefficient  . To accomplish that, it is necessary to first generate two uncorrelated Gaussian random variables   and  , which can be done using a Box–Muller transform. Given the required correlation coefficient  , the correlated normal variables can be obtained via the transformations   and  .

Kalman filters

Unscented Kalman filters 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 × N matrix P. The matrix P is always positive semi-definite and can be decomposed into LLT. The columns of L can be added and subtracted from the mean x to form a set of 2N vectors called sigma points. These sigma points completely capture the mean and covariance of the system state.

Matrix inversion

The explicit inverse of a Hermitian matrix can be computed by Cholesky decomposition, in a manner similar to solving linear systems, using   operations (  multiplications).[10] 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:

 

Computation

There are various methods for calculating the Cholesky decomposition. The computational complexity of commonly used algorithms is O(n3) in general.[citation needed] The algorithms described below all involve about (1/3)n3 FLOPs (n3/6 multiplications and the same number of additions) for real flavors and (4/3)n3 FLOPs for complex flavors,[15] where n is the size of the matrix A. Hence, they have half the cost of the LU decomposition, which uses 2n3/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(1) := A.

At step i, the matrix A(i) has the following form:

 

where Ii−1 denotes the identity matrix of dimension i − 1.

If we now define the matrix Li by

 

(note that ai,i > 0 since A(i) is positive definite), then we can write A(i) as

 

where

 

Note that bi b*i 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(n+1) = I. Hence, the lower triangular matrix L we are looking for is calculated as

 

The Cholesky–Banachiewicz and Cholesky–Crout algorithms

 
Access pattern (white) and writing pattern (yellow) for the in-place Cholesky—Banachiewicz algorithm on a 5×5 matrix

If we write out the equation

 

we obtain the following:

 

and therefore the following formulas for the entries of L:

 
 

For complex and real matrices, inconsequential arbitrary sign changes of diagonal and associated off-diagonal elements are allowed. The expression under the square root is always positive if A is real and positive-definite.

For complex Hermitian matrix, the following formula applies:

 
 

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–Banachiewicz algorithm starts from the upper left corner of the matrix L and proceeds to calculate the matrix row by row.
for (i = 0; i < dimensionSize; i++) {  for (j = 0; j <= i; j++) {  float sum = 0;  for (k = 0; k < j; k++)  sum += L[i][k] * L[j][k];  if (i == j)  L[i][j] = sqrt(A[i][i] - sum);  else  L[i][j] = (1.0 / L[j][j] * (A[i][j] - sum));  } } 

The above algorithm can be succinctly expressed as combining a dot product and matrix multiplication in vectorized programming languages such as Fortran as the following,

do i = 1, size(A,1)  L(i,i) = sqrt(A(i,i) - dot_product(L(i,1:i-1), L(i,1:i-1)))  L(i+1:,i) = (A(i+1:,i) - matmul(conjg(L(i,1:i-1)), L(i+1:,1:i-1))) / L(i,i) end do 

where conjg refers to complex conjugate of the elements.

  • The Cholesky–Crout algorithm starts from the upper left corner of the matrix L and proceeds to calculate the matrix column by column.
    for (j = 0; j < dimensionSize; j++) {  float sum = 0;  for (k = 0; k < j; k++) {  sum += L[j][k] * L[j][k];  }  L[j][j] = sqrt(A[j][j] - sum);  for (i = j + 1; i < dimensionSize; i++) {  sum = 0;  for (k = 0; k < j; k++) {  sum += L[i][k] * L[j][k];  }  L[i][j] = (1.0 / L[j][j] * (A[i][j] - sum));  } } 

The above algorithm can be succinctly expressed as combining a dot product and matrix multiplication in vectorized programming languages such as Fortran as the following,

do i = 1, size(A,1)  L(i,i) = sqrt(A(i,i) - dot_product(L(1:i-1,i), L(1:i-1,i)))  L(i,i+1:) = (A(i,i+1:) - matmul(conjg(L(1:i-1,i)), L(1:i-1,i+1:))) / L(i,i) end do 

where conjg refers to complex conjugate of the elements.

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 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 perturbed system (A + E)y = b, where

 

Here ||·||2 is the matrix 2-norm, cn 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 errors, 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.[16] 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 when A is symmetric, is the symmetric indefinite factorization[17]

 

The following recursive relations apply for the entries of D and L:

 
 

This works as long as the generated diagonal elements in D stay non-zero. The decomposition is then unique. D and L are real if A is real.

For complex Hermitian matrix A, the following formula applies:

 
 

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;[18] specifically, the elements of the factorization can grow arbitrarily. A possible improvement is to perform the factorization on block sub-matrices, commonly 2 × 2:[19]

 

where every element in the matrices above is a square submatrix. From this, these analogous recursive relations follow:

 
 

This involves matrix products and explicit inversion, thus limiting 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   of some matrix  , then one changes the matrix   in some way into another matrix, say  , and one wants to compute the Cholesky decomposition of the updated matrix:  . The question is now whether one can use the Cholesky decomposition of   that was computed before to compute the Cholesky decomposition of  .

Rank-one update

The specific case, where the updated matrix   is related to the matrix   by  , is known as a rank-one update.

Here is a function[20] written in Matlab syntax that realizes a rank-one update:

function [L] = cholupdate(L, x)  n = length(x);  for k = 1:n  r = sqrt(L(k, k)^2 + x(k)^2);  c = r / L(k, k);  s = x(k) / L(k, k);  L(k, k) = r;  if k < n  L((k+1):n, k) = (L((k+1):n, k) + s * x((k+1):n)) / c;  x((k+1):n) = c * x((k+1):n) - s * L((k+1):n, k);  end  end end 

A rank-n update is one where for a matrix   one updates the decomposition such that  . This can be achieved by successively performing rank-one updates for each of the columns of  .

Rank-one downdate

A rank-one downdate is similar to a rank-one update, except that the addition is replaced by subtraction:  . This only works if the new matrix   is still positive definite.

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 r and L((k+1):n, k) by subtractions.

Adding and removing rows and columns

If we have a symmetric and positive definite matrix   represented in block form as

 

and its upper Cholesky factor

 

then for a new matrix  , which is the same as   but with the insertion of new rows and columns,

 

we are interested in finding the Cholesky factorization of  , which we call  , without directly computing the entire decomposition.

 

Writing   for the solution of  , which can be found easily for triangular matrices, and   for the Cholesky decomposition of  , the following relations can be found:

 

These formulas may be used to determine the Cholesky factor after the insertion of rows or columns in any position, if we set the row and column dimensions appropriately (including to zero). The inverse problem, when we have

 

with known Cholesky decomposition

 

and wish to determine the Cholesky factor

 

of the matrix   with rows and columns removed,

 

yields the following rules:

 

Notice that the equations above that involve finding the Cholesky decomposition of a new matrix are all of the form  , which allows them to be efficiently calculated using the update and downdate procedures detailed in the previous section.[21]

Proof for positive semi-definite matrices

Proof by limiting argument

The above algorithms show that every positive definite matrix   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   is an   positive semi-definite matrix, then the sequence   consists of positive definite matrices. (This is an immediate consequence of, for example, the spectral mapping theorem for the polynomial functional calculus.) Also,

 

in operator norm. From the positive definite case, each   has Cholesky decomposition  . By property of the operator norm,

 

The   holds because   equipped with the operator norm is a C* algebra. So   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  , with limit  . It can be easily checked that this   has the desired properties, i.e.  , and   is lower triangular with non-negative diagonal entries: for all   and  ,

 

Therefore,  . Because the underlying vector space is finite-dimensional, all topologies on the space of operators are equivalent. So   tends to   in norm means   tends to   entrywise. This in turn implies that, since each   is lower triangular with non-negative diagonal entries,   is also.

Proof by QR decomposition

Let   be a positive semi-definite Hermitian matrix. Then it can be written as a product of its square root matrix,  . Now QR decomposition can be applied to  , resulting in   , where   is unitary and   is upper triangular. Inserting the decomposition into the original equality yields  . Setting   completes the proof.

Generalization

The Cholesky factorization can be generalized[citation needed] to (not necessarily finite) matrices with operator entries. Let   be a sequence of Hilbert spaces. Consider the operator matrix

 

acting on the direct sum

 

where each

 

is a bounded operator. If A is positive (semidefinite) in the sense that for all finite k and for any

 

we have  , 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 libraries

  • C programming language: the GNU Scientific Library provides several implementations of Cholesky decomposition.
  • Maxima computer algebra system: function cholesky computes Cholesky decomposition.
  • GNU Octave numerical computations system provides several functions to calculate, update, and apply a Cholesky decomposition.
  • The LAPACK library provides a high performance implementation of the Cholesky decomposition that can be accessed from Fortran, C and most languages.
  • In Python, the function cholesky from the numpy.linalg module performs Cholesky decomposition.
  • In Matlab, the chol function gives the Cholesky decomposition. Note that chol uses the upper triangular factor of the input matrix by default, i.e. it computes   where   is upper triangular. A flag can be passed to use the lower triangular factor instead.
  • In R, the chol function gives the Cholesky decomposition.
  • In Julia, the cholesky function from the LinearAlgebra standard library gives the Cholesky decomposition.
  • In Mathematica, the function "CholeskyDecomposition" can be applied to a matrix.
  • In C++, multiple linear algebra libraries support this decomposition:
    • The Armadillo (C++ library) supplies the command chol to perform Cholesky decomposition.
    • The Eigen library supplies Cholesky factorizations for both sparse and dense matrices.
    • In the ROOT package, the TDecompChol class is available.
  • In Analytica, the function Decompose gives the Cholesky decomposition.
  • The Apache Commons Math library has an implementation which can be used in Java, Scala and any other JVM language.

See also

Notes

  1. ^ Benoit (1924). "Note sur une méthode de résolution des équations normales provenant de l'application de la méthode des moindres carrés à un système d'équations linéaires en nombre inférieur à celui des inconnues (Procédé du Commandant Cholesky)". Bulletin Géodésique (in French). 2: 66–67. doi:10.1007/BF03031308.
  2. ^ a b Press, William H.; Saul A. Teukolsky; William T. Vetterling; Brian P. Flannery (1992). Numerical Recipes in C: The Art of Scientific Computing (second ed.). Cambridge University England EPress. p. 994. ISBN 0-521-43108-5. Retrieved 2009-01-28.
  3. ^ Golub & Van Loan (1996, p. 143), Horn & Johnson (1985, p. 407), Trefethen & Bau (1997, p. 174).
  4. ^ Horn & Johnson (1985, p. 407).
  5. ^ "matrices - Diagonalizing a Complex Symmetric Matrix". MathOverflow. Retrieved 2020-01-25.
  6. ^ Schabauer, Hannes; Pacher, Christoph; Sunderland, Andrew G.; Gansterer, Wilfried N. (2010-05-01). "Toward a parallel solver for generalized complex symmetric eigenvalue problems". Procedia Computer Science. ICCS 2010. 1 (1): 437–445. doi:10.1016/j.procs.2010.04.047. ISSN 1877-0509.
  7. ^ Golub & Van Loan (1996, p. 147).
  8. ^ Gentle, James E. (1998). Numerical Linear Algebra for Applications in Statistics. Springer. p. 94. ISBN 978-1-4612-0623-1.
  9. ^ Higham, Nicholas J. (1990). "Analysis of the Cholesky Decomposition of a Semi-definite Matrix". In Cox, M. G.; Hammarling, S. J. (eds.). Reliable Numerical Computation. Oxford, UK: Oxford University Press. pp. 161–185. ISBN 978-0-19-853564-5.
  10. ^ a b Krishnamoorthy, Aravindh; Menon, Deepak (2011). "Matrix Inversion Using Cholesky Decomposition". 1111: 4144. arXiv:1111.4144. Bibcode:2011arXiv1111.4144K. {{cite journal}}: Cite journal requires |journal= (help)
  11. ^ So, Anthony Man-Cho (2007). A Semidefinite Programming Approach to the Graph Realization Problem: Theory, Applications and Extensions (PDF) (PhD). Theorem 2.2.6.
  12. ^ Golub & Van Loan (1996, Theorem 4.1.3)
  13. ^ Arora, J.S. Introduction to Optimum Design (2004), p. 327. https://books.google.com/books?id=9FbwVe577xwC&pg=PA327
  14. ^ Matlab randn documentation. mathworks.com.
  15. ^ ?potrf Intel® Math Kernel Library [1]
  16. ^ Fang, Haw-ren; O'Leary, Dianne P. (8 August 2006). "Modified Cholesky Algorithms: A Catalog with New Approaches" (PDF). {{cite journal}}: Cite journal requires |journal= (help)
  17. ^ Watkins, D. (1991). Fundamentals of Matrix Computations. New York: Wiley. p. 84. ISBN 0-471-61414-9.
  18. ^ Nocedal, Jorge (2000). Numerical Optimization. Springer.
  19. ^ Fang, Haw-ren (24 August 2007). "Analysis of Block LDLT Factorizations for Symmetric Indefinite Matrices". {{cite journal}}: Cite journal requires |journal= (help)
  20. ^ Based on: Stewart, G. W. (1998). Basic decompositions. Philadelphia: Soc. for Industrial and Applied Mathematics. ISBN 0-89871-414-1.
  21. ^ Osborne, M. (2010), Appendix B.

References

  • Dereniowski, Dariusz; Kubale, Marek (2004). "Cholesky Factorization of Matrices in Parallel and Ranking of Graphs". (PDF). Lecture Notes on Computer Science. Vol. 3019. Springer-Verlag. pp. 985–992. doi:10.1007/978-3-540-24669-5_127. ISBN 978-3-540-21946-0. Archived from the original (PDF) on 2011-07-16.
  • Golub, Gene H.; Van Loan, Charles F. (1996). Matrix Computations (3rd ed.). Baltimore: Johns Hopkins. ISBN 978-0-8018-5414-9.
  • Horn, Roger A.; Johnson, Charles R. (1985). Matrix Analysis. Cambridge University Press. ISBN 0-521-38632-2.
  • S. J. Julier and J. K. Uhlmann. "".
  • 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. 182–193.
  • Trefethen, Lloyd N.; Bau, David (1997). Numerical linear algebra. Philadelphia: Society for Industrial and Applied Mathematics. ISBN 978-0-89871-361-9.
  • Osborne, Michael (2010). Bayesian Gaussian Processes for Sequential Prediction, Optimisation and Quadrature (PDF) (thesis). University of Oxford.
  • Ruschel, João Paulo Tarasconi, Bachelor degree "Parallel Implementations of the Cholesky Decomposition on CPUs and GPUs" Universidade Federal Do Rio Grande Do Sul, Instituto De Informatica, 2016, pp. 29-30.

External links

History of science

  • Sur la résolution numérique des systèmes d'équations linéaires, Cholesky's 1910 manuscript, online and analyzed on BibNum (in French and English) [for English, click 'A télécharger']

Information

  • "Cholesky factorization", Encyclopedia of Mathematics, EMS Press, 2001 [1994]
  • , The Data Analysis BriefBook
  • Cholesky Decomposition on www.math-linux.com
  • Cholesky Decomposition Made Simple on Science Meanderthal

Computer code

  • LAPACK is a collection of FORTRAN subroutines for solving dense linear algebra problems (DPOTRF, DPOTRF2, details performance)
  • ALGLIB includes a partial port of the LAPACK to C++, C#, Delphi, Visual Basic, etc. (spdmatrixcholesky, hpdmatrixcholesky)
  • libflame is a C library with LAPACK functionality.
  • Notes and video on high-performance implementation of Cholesky factorization at The University of Texas at Austin.
  • Cholesky : TBB + Threads + SSE is a book explaining the implementation of the CF with TBB, threads and SSE (in Spanish).
  • library "Ceres Solver" by Google.
  • routines in Matlab.
  • Armadillo is a C++ linear algebra package
  • Rosetta Code is a programming chrestomathy site. on page topic.
  • AlgoWiki is an open encyclopedia of algorithms’ properties and features of their implementations on page topic
  • Intel® oneAPI Math Kernel Library Intel-Optimized Math Library for Numerical Computing ?potrf, ?potrs

Use of the matrix in simulation

  • Generating Correlated Random Variables and Stochastic Processes, Martin Haugh, Columbia University

Online calculators

  • Performs Cholesky decomposition of matrices online.

cholesky, decomposition, linear, algebra, cholesky, factorization, pronounced, shə, decomposition, hermitian, positive, definite, matrix, into, product, lower, triangular, matrix, conjugate, transpose, which, useful, efficient, numerical, solutions, monte, car. In linear algebra the Cholesky decomposition or Cholesky factorization pronounced ʃ e ˈ l ɛ s k i she LES kee is a decomposition of a Hermitian positive definite matrix into the product of a lower triangular matrix and its conjugate transpose which is useful for efficient numerical solutions e g Monte Carlo simulations It was discovered by Andre Louis Cholesky for real matrices and posthumously published in 1924 1 When it is applicable the Cholesky decomposition is roughly twice as efficient as the LU decomposition for solving systems of linear equations 2 Contents 1 Statement 1 1 Positive semidefinite matrices 2 LDL decomposition 3 Example 4 Applications 4 1 Linear least squares 4 2 Non linear optimization 4 3 Monte Carlo simulation 4 4 Kalman filters 4 5 Matrix inversion 5 Computation 5 1 The Cholesky algorithm 5 2 The Cholesky Banachiewicz and Cholesky Crout algorithms 5 3 Stability of the computation 5 4 LDL decomposition 5 5 Block variant 5 6 Updating the decomposition 5 6 1 Rank one update 5 6 2 Rank one downdate 5 6 3 Adding and removing rows and columns 6 Proof for positive semi definite matrices 6 1 Proof by limiting argument 6 2 Proof by QR decomposition 7 Generalization 8 Implementations in programming libraries 9 See also 10 Notes 11 References 12 External links 12 1 History of science 12 2 Information 12 3 Computer code 12 4 Use of the matrix in simulation 12 5 Online calculatorsStatement EditThe Cholesky decomposition of a Hermitian positive definite matrix A is a decomposition of the form A L L displaystyle mathbf A mathbf LL 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 3 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 When A is a real matrix hence symmetric positive definite the factorization may be written A L L T displaystyle mathbf A mathbf LL mathsf T where L is a real lower triangular matrix with positive diagonal entries 4 5 6 Positive semidefinite matrices Edit If a Hermitian matrix A is only positive semidefinite instead of positive definite then it still has a decomposition of the form A LL where the diagonal entries of L are allowed to be zero 7 The decomposition need not be unique for example 0 0 0 1 L L L 0 0 cos 8 sin 8 displaystyle begin bmatrix 0 amp 0 0 amp 1 end bmatrix mathbf L mathbf L quad quad mathbf L begin bmatrix 0 amp 0 cos theta amp sin theta end bmatrix However if the rank of A is r then there is a unique lower triangular L with exactly r positive diagonal elements and n r columns containing all zeroes 8 Alternatively the decomposition can be made unique when a pivoting choice is fixed Formally if A is an n n positive semidefinite matrix of rank r then there is at least one permutation matrix P such that P A PT has a unique decomposition of the form P A PT L L with L L 1 0 L 2 0 displaystyle mathbf L begin bmatrix mathbf L 1 amp 0 mathbf L 2 amp 0 end bmatrix where L1 is an r r lower triangular matrix with positive diagonal 9 LDL decomposition EditA closely related variant of the classical Cholesky decomposition is the LDL decomposition A L D L displaystyle mathbf A mathbf LDL where L is a lower unit triangular unitriangular matrix and D is a diagonal matrix That is the diagonal elements of L are required to be 1 at the cost of introducing an additional diagonal matrix D in the decomposition The main advantage is that the LDL decomposition can be computed and used with essentially the same algorithms but avoids extracting square roots 10 For this reason the LDL decomposition is often called the square root free Cholesky decomposition For real matrices the factorization has the form A LDLT and is often referred to as LDLT decomposition or LDLT decomposition or LDL It is reminiscent of the eigendecomposition of real symmetric matrices A QLQT but is quite different in practice because L and D are not similar matrices The LDL decomposition is related to the classical Cholesky decomposition of the form LL as follows A L D L L D 1 2 D 1 2 L L D 1 2 L D 1 2 displaystyle mathbf A mathbf LDL mathbf L mathbf D 1 2 left mathbf D 1 2 right mathbf L mathbf L mathbf D 1 2 left mathbf L mathbf D 1 2 right Conversely given the classical Cholesky decomposition A C C displaystyle mathbf A mathbf C mathbf C of a positive definite matrix if S is a diagonal matrix that contains the main diagonal of C displaystyle mathbf C then A can be decomposed as L D L displaystyle mathbf L mathbf D mathbf L where L C S 1 displaystyle mathbf L mathbf C mathbf S 1 this rescales each column to make diagonal elements 1 D S 2 displaystyle mathbf D mathbf S 2 If A is positive definite then the diagonal elements of D are all positive For positive semidefinite A an L D L displaystyle mathbf L mathbf D mathbf L decomposition exists where the number of non zero elements on the diagonal D is exactly the rank of A 11 Some indefinite matrices for which no Cholesky decomposition exists have an LDL decomposition with negative entries in D it suffices that the first n 1 leading principal minors of A are non singular 12 Example EditHere is the Cholesky decomposition of a symmetric real matrix 4 12 16 12 37 43 16 43 98 2 0 0 6 1 0 8 5 3 2 6 8 0 1 5 0 0 3 displaystyle begin aligned begin pmatrix 4 amp 12 amp 16 12 amp 37 amp 43 16 amp 43 amp 98 end pmatrix begin pmatrix 2 amp 0 amp 0 6 amp 1 amp 0 8 amp 5 amp 3 end pmatrix begin pmatrix 2 amp 6 amp 8 0 amp 1 amp 5 0 amp 0 amp 3 end pmatrix end aligned And here is its LDLT decomposition 4 12 16 12 37 43 16 43 98 1 0 0 3 1 0 4 5 1 4 0 0 0 1 0 0 0 9 1 3 4 0 1 5 0 0 1 displaystyle begin aligned begin pmatrix 4 amp 12 amp 16 12 amp 37 amp 43 16 amp 43 amp 98 end pmatrix amp begin pmatrix 1 amp 0 amp 0 3 amp 1 amp 0 4 amp 5 amp 1 end pmatrix begin pmatrix 4 amp 0 amp 0 0 amp 1 amp 0 0 amp 0 amp 9 end pmatrix begin pmatrix 1 amp 3 amp 4 0 amp 1 amp 5 0 amp 0 amp 1 end pmatrix end aligned Applications EditThe Cholesky decomposition is mainly used for the numerical solution of linear equations A x b displaystyle mathbf Ax mathbf b If A is symmetric and positive definite then we can solve A x b displaystyle mathbf Ax mathbf b by first computing the Cholesky decomposition A L L displaystyle mathbf A mathbf LL mathrm then solving L y b displaystyle mathbf Ly mathbf b for y by forward substitution and finally solving L x y displaystyle mathbf L x mathbf y for x by back substitution An alternative way to eliminate taking square roots in the L L displaystyle mathbf LL mathrm decomposition is to compute the LDL decomposition A L D L displaystyle mathbf A mathbf LDL mathrm then solving L y b displaystyle mathbf Ly mathbf b for y and finally solving D L x y displaystyle mathbf DL mathrm mathbf x mathbf y 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 2 Linear least squares Edit 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 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 equations Non linear optimization Edit Non linear multi variate functions may be minimized over their parameters using variants of Newton s method called quasi Newton methods At iteration k the search steps in a direction p k displaystyle p k defined by solving B k p k g k displaystyle B k p k g k for p k displaystyle p k where p k displaystyle p k is the step direction g k displaystyle g k is the gradient and B k displaystyle B k is an approximation to the Hessian matrix formed by repeating rank 1 updates at each iteration Two well known update formulas are called Davidon Fletcher Powell DFP and 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 13 Monte Carlo simulation Edit The Cholesky decomposition is commonly used in the Monte Carlo method for simulating systems with multiple correlated variables The covariance 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 14 The following simplified example shows the economy one gets from the Cholesky decomposition suppose the goal is to generate two correlated normal variables x 1 displaystyle x 1 and x 2 displaystyle x 2 with given correlation coefficient r displaystyle rho To accomplish that it is necessary to first generate two uncorrelated Gaussian random variables z 1 displaystyle z 1 and z 2 displaystyle z 2 which can be done using a Box Muller transform Given the required correlation coefficient r displaystyle rho the correlated normal variables can be obtained via the transformations x 1 z 1 displaystyle x 1 z 1 and x 2 r z 1 1 r 2 z 2 textstyle x 2 rho z 1 sqrt 1 rho 2 z 2 Kalman filters Edit Unscented Kalman filters 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 N matrix P The matrix P is always positive semi definite and can be decomposed into LLT The columns of L can be added and subtracted from the mean x to form a set of 2N vectors called sigma points These sigma points completely capture the mean and covariance of the system state Matrix inversion Edit The explicit inverse of a Hermitian matrix can be computed by Cholesky decomposition in a manner similar to solving linear systems using n 3 displaystyle n 3 operations 1 2 n 3 displaystyle tfrac 1 2 n 3 multiplications 10 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 B 1 B B B 1 displaystyle mathbf B 1 mathbf B mathbf BB 1 Computation EditThere are various methods for calculating the Cholesky decomposition The computational complexity of commonly used algorithms is O n3 in general citation needed The algorithms described below all involve about 1 3 n3 FLOPs n3 6 multiplications and the same number of additions for real flavors and 4 3 n3 FLOPs for complex flavors 15 where n is the size of the matrix A Hence they have half the cost of the LU decomposition which uses 2n3 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 Edit 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 1 A At step i the matrix A i has the following form A i I i 1 0 0 0 a i i b i 0 b i B i displaystyle mathbf A i begin pmatrix mathbf I i 1 amp 0 amp 0 0 amp a i i amp mathbf b i 0 amp mathbf b i amp mathbf B i end pmatrix where Ii 1 denotes the identity matrix of dimension i 1 If we now define the matrix Li by L i I i 1 0 0 0 a i i 0 0 1 a i i b i I n i displaystyle mathbf L i begin pmatrix mathbf I i 1 amp 0 amp 0 0 amp sqrt a i i amp 0 0 amp frac 1 sqrt a i i mathbf b i amp mathbf I n i end pmatrix note that ai i gt 0 since A i is positive definite then we can write A i as A i L i A i 1 L i displaystyle mathbf A i mathbf L i mathbf A i 1 mathbf L i where A i 1 I i 1 0 0 0 1 0 0 0 B i 1 a i i b i b i displaystyle mathbf A i 1 begin pmatrix mathbf I i 1 amp 0 amp 0 0 amp 1 amp 0 0 amp 0 amp mathbf B i frac 1 a i i mathbf b i mathbf b i end pmatrix Note that bi b i is an outer product therefore this algorithm is called the outer product version in Golub amp Van Loan We repeat this for i from 1 to n After n steps we get A n 1 I Hence the lower triangular matrix L we are looking for is calculated as L L 1 L 2 L n displaystyle mathbf L mathbf L 1 mathbf L 2 dots mathbf L n The Cholesky Banachiewicz and Cholesky Crout algorithms Edit Access pattern white and writing pattern yellow for the in place Cholesky Banachiewicz algorithm on a 5 5 matrixIf we write out the equation A L L T L 11 0 0 L 21 L 22 0 L 31 L 32 L 33 L 11 L 21 L 31 0 L 22 L 32 0 0 L 33 L 11 2 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 displaystyle begin aligned mathbf A mathbf LL T amp begin pmatrix L 11 amp 0 amp 0 L 21 amp L 22 amp 0 L 31 amp L 32 amp L 33 end pmatrix begin pmatrix L 11 amp L 21 amp L 31 0 amp L 22 amp L 32 0 amp 0 amp L 33 end pmatrix 8pt amp begin pmatrix L 11 2 amp amp text symmetric L 21 L 11 amp L 21 2 L 22 2 amp L 31 L 11 amp L 31 L 21 L 32 L 22 amp L 31 2 L 32 2 L 33 2 end pmatrix end aligned we obtain the following L A 11 0 0 A 21 L 11 A 22 L 21 2 0 A 31 L 11 A 32 L 31 L 21 L 22 A 33 L 31 2 L 32 2 displaystyle begin aligned mathbf L begin pmatrix sqrt A 11 amp 0 amp 0 A 21 L 11 amp sqrt A 22 L 21 2 amp 0 A 31 L 11 amp left A 32 L 31 L 21 right L 22 amp sqrt A 33 L 31 2 L 32 2 end pmatrix end aligned and therefore the following formulas for the entries of L L j j A j j k 1 j 1 L j k 2 displaystyle L j j pm sqrt A j j sum k 1 j 1 L j k 2 L i j 1 L j j A i j k 1 j 1 L i k L j k for i gt j displaystyle L i j frac 1 L j j left A i j sum k 1 j 1 L i k L j k right quad text for i gt j For complex and real matrices inconsequential arbitrary sign changes of diagonal and associated off diagonal elements are allowed The expression under the square root is always positive if A is real and positive definite For complex Hermitian matrix the following formula applies L j j A j j k 1 j 1 L j k L j k displaystyle L j j sqrt A j j sum k 1 j 1 L j k L j k L i j 1 L j j A i j k 1 j 1 L j k L i k for i gt j displaystyle L i j frac 1 L j j left A i j sum k 1 j 1 L j k L i k right quad text for i gt j 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 Banachiewicz algorithm starts from the upper left corner of the matrix L and proceeds to calculate the matrix row by row for i 0 i lt dimensionSize i for j 0 j lt i j float sum 0 for k 0 k lt j k sum L i k L j k if i j L i j sqrt A i i sum else L i j 1 0 L j j A i j sum The above algorithm can be succinctly expressed as combining a dot product and matrix multiplication in vectorized programming languages such as Fortran as the following do i 1 size A 1 L i i sqrt A i i dot product L i 1 i 1 L i 1 i 1 L i 1 i A i 1 i matmul conjg L i 1 i 1 L i 1 1 i 1 L i i end do where conjg refers to complex conjugate of the elements The Cholesky Crout algorithm starts from the upper left corner of the matrix L and proceeds to calculate the matrix column by column for j 0 j lt dimensionSize j float sum 0 for k 0 k lt j k sum L j k L j k L j j sqrt A j j sum for i j 1 i lt dimensionSize i sum 0 for k 0 k lt j k sum L i k L j k L i j 1 0 L j j A i j sum The above algorithm can be succinctly expressed as combining a dot product and matrix multiplication in vectorized programming languages such as Fortran as the following do i 1 size A 1 L i i sqrt A i i dot product L 1 i 1 i L 1 i 1 i L i i 1 A i i 1 matmul conjg L 1 i 1 i L 1 i 1 i 1 L i i end do where conjg refers to complex conjugate of the elements Either pattern of access allows the entire computation to be performed in place if desired Stability of the computation Edit Suppose that we want to solve a 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 perturbed system A E y b where E 2 c n e A 2 displaystyle mathbf E 2 leq c n varepsilon mathbf A 2 Here 2 is the matrix 2 norm cn is a small constant depending on n and e 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 errors 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 16 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 Edit An alternative form eliminating the need to take square roots when A is symmetric is the symmetric indefinite factorization 17 A L D L T 1 0 0 L 21 1 0 L 31 L 32 1 D 1 0 0 0 D 2 0 0 0 D 3 1 L 21 L 31 0 1 L 32 0 0 1 D 1 s y m m e t r i c L 21 D 1 L 21 2 D 1 D 2 L 31 D 1 L 31 L 21 D 1 L 32 D 2 L 31 2 D 1 L 32 2 D 2 D 3 displaystyle begin aligned mathbf A mathbf LDL mathrm T amp begin pmatrix 1 amp 0 amp 0 L 21 amp 1 amp 0 L 31 amp L 32 amp 1 end pmatrix begin pmatrix D 1 amp 0 amp 0 0 amp D 2 amp 0 0 amp 0 amp D 3 end pmatrix begin pmatrix 1 amp L 21 amp L 31 0 amp 1 amp L 32 0 amp 0 amp 1 end pmatrix 8pt amp begin pmatrix D 1 amp amp mathrm symmetric L 21 D 1 amp L 21 2 D 1 D 2 amp L 31 D 1 amp L 31 L 21 D 1 L 32 D 2 amp L 31 2 D 1 L 32 2 D 2 D 3 end pmatrix end aligned The following recursive relations apply for the entries of D and L D j A j j k 1 j 1 L j k 2 D k displaystyle D j A jj sum k 1 j 1 L jk 2 D k L i j 1 D j A i j k 1 j 1 L i k L j k D k for i gt j displaystyle L ij frac 1 D j left A ij sum k 1 j 1 L ik L jk D k right quad text for i gt j This works as long as the generated diagonal elements in D stay non zero The decomposition is then unique D and L are real if A is real For complex Hermitian matrix A the following formula applies D j A j j k 1 j 1 L j k L j k D k displaystyle D j A jj sum k 1 j 1 L jk L jk D k L i j 1 D j A i j k 1 j 1 L i k L j k D k for i gt j displaystyle L ij frac 1 D j left A ij sum k 1 j 1 L ik L jk D k right quad text for i gt j Again the pattern of access allows the entire computation to be performed in place if desired Block variant Edit When used on indefinite matrices the LDL factorization is known to be unstable without careful pivoting 18 specifically the elements of the factorization can grow arbitrarily A possible improvement is to perform the factorization on block sub matrices commonly 2 2 19 A L D L T I 0 0 L 21 I 0 L 31 L 32 I D 1 0 0 0 D 2 0 0 0 D 3 I L 21 T L 31 T 0 I L 32 T 0 0 I D 1 s y m m e t r i c L 21 D 1 L 21 D 1 L 21 T D 2 L 31 D 1 L 31 D 1 L 21 T L 32 D 2 L 31 D 1 L 31 T L 32 D 2 L 32 T D 3 displaystyle begin aligned mathbf A mathbf LDL mathrm T amp begin pmatrix mathbf I amp 0 amp 0 mathbf L 21 amp mathbf I amp 0 mathbf L 31 amp mathbf L 32 amp mathbf I end pmatrix begin pmatrix mathbf D 1 amp 0 amp 0 0 amp mathbf D 2 amp 0 0 amp 0 amp mathbf D 3 end pmatrix begin pmatrix mathbf I amp mathbf L 21 mathrm T amp mathbf L 31 mathrm T 0 amp mathbf I amp mathbf L 32 mathrm T 0 amp 0 amp mathbf I end pmatrix 8pt amp begin pmatrix mathbf D 1 amp amp mathrm symmetric mathbf L 21 mathbf D 1 amp mathbf L 21 mathbf D 1 mathbf L 21 mathrm T mathbf D 2 amp mathbf L 31 mathbf D 1 amp mathbf L 31 mathbf D 1 mathbf L 21 mathrm T mathbf L 32 mathbf D 2 amp 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 aligned where every element in the matrices above is a square submatrix From this these analogous recursive relations follow D j A j j k 1 j 1 L j k D k L j k T displaystyle mathbf D j mathbf A jj sum k 1 j 1 mathbf L jk mathbf D k mathbf L jk mathrm T L i j A i j k 1 j 1 L i k D k L j k T D j 1 displaystyle 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 This involves matrix products and explicit inversion thus limiting the practical block size Updating the decomposition Edit 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 L L displaystyle mathbf A mathbf L mathbf L of some matrix A displaystyle mathbf A then one changes the matrix A displaystyle mathbf A in some way into another matrix say A displaystyle tilde mathbf A and one wants to compute the Cholesky decomposition of the updated matrix A L L displaystyle tilde mathbf A tilde mathbf L tilde mathbf L The question is now whether one can use the Cholesky decomposition of A displaystyle mathbf A that was computed before to compute the Cholesky decomposition of A displaystyle tilde mathbf A Rank one update Edit The specific case where the updated matrix A displaystyle tilde mathbf A is related to the matrix A displaystyle mathbf A by A A x x displaystyle tilde mathbf A mathbf A mathbf x mathbf x is known as a rank one update Here is a function 20 written in Matlab syntax that realizes a rank one update function L cholupdate L x n length x for k 1 n r sqrt L k k 2 x k 2 c r L k k s x k L k k L k k r if k lt n L k 1 n k L k 1 n k s x k 1 n c x k 1 n c x k 1 n s L k 1 n k end end end A rank n update is one where for a matrix M displaystyle mathbf M one updates the decomposition such that A A M M displaystyle tilde mathbf A mathbf A mathbf M mathbf M This can be achieved by successively performing rank one updates for each of the columns of M displaystyle mathbf M Rank one downdate Edit A rank one downdate is similar to a rank one update except that the addition is replaced by subtraction A A x x displaystyle tilde mathbf A mathbf A mathbf x mathbf x This only works if the new matrix A displaystyle tilde mathbf A is still positive definite 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 r and L k 1 n k by subtractions Adding and removing rows and columns Edit If we have a symmetric and positive definite matrix A displaystyle mathbf A represented in block form as A A 11 A 13 A 13 T A 33 displaystyle mathbf A begin pmatrix mathbf A 11 amp mathbf A 13 mathbf A 13 mathrm T amp mathbf A 33 end pmatrix and its upper Cholesky factor L L 11 L 13 0 L 33 displaystyle mathbf L begin pmatrix mathbf L 11 amp mathbf L 13 0 amp mathbf L 33 end pmatrix then for a new matrix A displaystyle tilde mathbf A which is the same as A displaystyle mathbf A but with the insertion of new rows and columns A A 11 A 12 A 13 A 12 T A 22 A 23 A 13 T A 23 T A 33 displaystyle begin aligned tilde mathbf A amp begin pmatrix mathbf A 11 amp mathbf A 12 amp mathbf A 13 mathbf A 12 mathrm T amp mathbf A 22 amp mathbf A 23 mathbf A 13 mathrm T amp mathbf A 23 mathrm T amp mathbf A 33 end pmatrix end aligned we are interested in finding the Cholesky factorization of A displaystyle tilde mathbf A which we call S displaystyle tilde mathbf S without directly computing the entire decomposition S S 11 S 12 S 13 0 S 22 S 23 0 0 S 33 displaystyle begin aligned tilde mathbf S amp begin pmatrix mathbf S 11 amp mathbf S 12 amp mathbf S 13 0 amp mathbf S 22 amp mathbf S 23 0 amp 0 amp mathbf S 33 end pmatrix end aligned Writing A b displaystyle mathbf A setminus mathbf b for the solution of A x b displaystyle mathbf A mathbf x mathbf b which can be found easily for triangular matrices and chol M displaystyle text chol mathbf M for the Cholesky decomposition of M displaystyle mathbf M the following relations can be found S 11 L 11 S 12 L 11 T A 12 S 13 L 13 S 22 c h o l A 22 S 12 T S 12 S 23 S 22 T A 23 S 12 T S 13 S 33 c h o l L 33 T L 33 S 23 T S 23 displaystyle begin aligned mathbf S 11 amp mathbf L 11 mathbf S 12 amp mathbf L 11 mathrm T setminus mathbf A 12 mathbf S 13 amp mathbf L 13 mathbf S 22 amp mathrm chol left mathbf A 22 mathbf S 12 mathrm T mathbf S 12 right mathbf S 23 amp mathbf S 22 mathrm T setminus left mathbf A 23 mathbf S 12 mathrm T mathbf S 13 right mathbf S 33 amp mathrm chol left mathbf L 33 mathrm T mathbf L 33 mathbf S 23 mathrm T mathbf S 23 right end aligned These formulas may be used to determine the Cholesky factor after the insertion of rows or columns in any position if we set the row and column dimensions appropriately including to zero The inverse problem when we have A A 11 A 12 A 13 A 12 T A 22 A 23 A 13 T A 23 T A 33 displaystyle begin aligned tilde mathbf A amp begin pmatrix mathbf A 11 amp mathbf A 12 amp mathbf A 13 mathbf A 12 mathrm T amp mathbf A 22 amp mathbf A 23 mathbf A 13 mathrm T amp mathbf A 23 mathrm T amp mathbf A 33 end pmatrix end aligned with known Cholesky decomposition S S 11 S 12 S 13 0 S 22 S 23 0 0 S 33 displaystyle begin aligned tilde mathbf S amp begin pmatrix mathbf S 11 amp mathbf S 12 amp mathbf S 13 0 amp mathbf S 22 amp mathbf S 23 0 amp 0 amp mathbf S 33 end pmatrix end aligned and wish to determine the Cholesky factor L L 11 L 13 0 L 33 displaystyle begin aligned mathbf L amp begin pmatrix mathbf L 11 amp mathbf L 13 0 amp mathbf L 33 end pmatrix end aligned of the matrix A displaystyle mathbf A with rows and columns removed A A 11 A 13 A 13 T A 33 displaystyle begin aligned mathbf A amp begin pmatrix mathbf A 11 amp mathbf A 13 mathbf A 13 mathrm T amp mathbf A 33 end pmatrix end aligned yields the following rules L 11 S 11 L 13 S 13 L 33 c h o l S 33 T S 33 S 23 T S 23 displaystyle begin aligned mathbf L 11 amp mathbf S 11 mathbf L 13 amp mathbf S 13 mathbf L 33 amp mathrm chol left mathbf S 33 mathrm T mathbf S 33 mathbf S 23 mathrm T mathbf S 23 right end aligned Notice that the equations above that involve finding the Cholesky decomposition of a new matrix are all of the form A A x x displaystyle tilde mathbf A mathbf A pm mathbf x mathbf x which allows them to be efficiently calculated using the update and downdate procedures detailed in the previous section 21 Proof for positive semi definite matrices EditProof by limiting argument Edit The above algorithms show that every positive definite matrix A displaystyle mathbf 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 displaystyle mathbf A is an n n displaystyle n times n positive semi definite matrix then the sequence A k k A 1 k I n k textstyle left mathbf A k right k left mathbf A frac 1 k mathbf I n right k consists of positive definite matrices This is an immediate consequence of for example the spectral mapping theorem for the polynomial functional calculus Also A k A for k displaystyle mathbf A k rightarrow mathbf A quad text for quad k rightarrow infty in operator norm From the positive definite case each A k displaystyle mathbf A k has Cholesky decomposition A k L k L k displaystyle mathbf A k mathbf L k mathbf L k By property of the operator norm L k 2 L k L k A k displaystyle mathbf L k 2 leq mathbf L k mathbf L k mathbf A k The displaystyle leq holds because M n C displaystyle M n mathbb C equipped with the operator norm is a C algebra So L k k displaystyle left mathbf L k right k 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 k k displaystyle left mathbf L k right k with limit L displaystyle mathbf L It can be easily checked that this L displaystyle mathbf L has the desired properties i e A L L displaystyle mathbf A mathbf L mathbf L and L displaystyle mathbf L is lower triangular with non negative diagonal entries for all x displaystyle x and y displaystyle y A x y lim A k x y lim L k L k x y L L x y displaystyle langle mathbf A x y rangle left langle lim mathbf A k x y right rangle langle lim mathbf L k mathbf L k x y rangle langle mathbf L mathbf L x y rangle Therefore A L L displaystyle mathbf A mathbf L mathbf L Because the underlying vector space is finite dimensional all topologies on the space of operators are equivalent So L k k displaystyle left mathbf L k right k tends to L displaystyle mathbf L in norm means L k k displaystyle left mathbf L k right k tends to L displaystyle mathbf L entrywise This in turn implies that since each L k displaystyle mathbf L k is lower triangular with non negative diagonal entries L displaystyle mathbf L is also Proof by QR decomposition Edit Let A displaystyle mathbf A be a positive semi definite Hermitian matrix Then it can be written as a product of its square root matrix A B B displaystyle mathbf A mathbf B mathbf B Now QR decomposition can be applied to B displaystyle mathbf B resulting in B Q R displaystyle mathbf B mathbf Q mathbf R where Q displaystyle mathbf Q is unitary and R displaystyle mathbf R is upper triangular Inserting the decomposition into the original equality yields A B B Q R Q R R Q Q R R R displaystyle A mathbf B mathbf B mathbf QR mathbf QR mathbf R mathbf Q mathbf QR mathbf R mathbf R Setting L R displaystyle mathbf L mathbf R completes the proof Generalization EditThe Cholesky factorization can be generalized citation needed to not necessarily finite matrices with operator entries Let H n displaystyle mathcal H n be a sequence of Hilbert spaces Consider the operator matrix A A 11 A 12 A 13 A 12 A 22 A 23 A 13 A 23 A 33 displaystyle mathbf A begin bmatrix mathbf A 11 amp mathbf A 12 amp mathbf A 13 amp mathbf A 12 amp mathbf A 22 amp mathbf A 23 amp mathbf A 13 amp mathbf A 23 amp mathbf A 33 amp amp amp amp ddots end bmatrix acting on the direct sum H n H n displaystyle mathcal H bigoplus n mathcal H n where each A i j H j H i displaystyle mathbf A ij mathcal H j rightarrow mathcal H i is a bounded operator If A is positive semidefinite in the sense that for all finite k and for any h n 1 k H k displaystyle h in bigoplus n 1 k mathcal H k we have h A h 0 displaystyle langle h mathbf A h rangle geq 0 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 libraries EditC programming language the GNU Scientific Library provides several implementations of Cholesky decomposition Maxima computer algebra system function cholesky computes Cholesky decomposition GNU Octave numerical computations system provides several functions to calculate update and apply a Cholesky decomposition The LAPACK library provides a high performance implementation of the Cholesky decomposition that can be accessed from Fortran C and most languages In Python the function cholesky from the numpy linalg module performs Cholesky decomposition In Matlab the chol function gives the Cholesky decomposition Note that chol uses the upper triangular factor of the input matrix by default i e it computes A R R displaystyle A R R where R displaystyle R is upper triangular A flag can be passed to use the lower triangular factor instead In R the chol function gives the Cholesky decomposition In Julia the cholesky function from the LinearAlgebra standard library gives the Cholesky decomposition In Mathematica the function CholeskyDecomposition can be applied to a matrix In C multiple linear algebra libraries support this decomposition The Armadillo C library supplies the command chol to perform Cholesky decomposition The Eigen library supplies Cholesky factorizations for both sparse and dense matrices In the ROOT package the TDecompChol class is available In Analytica the function Decompose gives the Cholesky decomposition The Apache Commons Math library has an implementation which can be used in Java Scala and any other JVM language See also EditCycle rank Incomplete Cholesky factorization Matrix decomposition Minimum degree algorithm Square root of a matrix Sylvester s law of inertia Symbolic Cholesky decompositionNotes Edit Benoit 1924 Note sur une methode de resolution des equations normales provenant de l application de la methode des moindres carres a un systeme d equations lineaires en nombre inferieur a celui des inconnues Procede du Commandant Cholesky Bulletin Geodesique in French 2 66 67 doi 10 1007 BF03031308 a b Press William H Saul A Teukolsky William T Vetterling Brian P Flannery 1992 Numerical Recipes in C The Art of Scientific Computing second ed Cambridge University England EPress p 994 ISBN 0 521 43108 5 Retrieved 2009 01 28 Golub amp Van Loan 1996 p 143 Horn amp Johnson 1985 p 407 Trefethen amp Bau 1997 p 174 Horn amp Johnson 1985 p 407 matrices Diagonalizing a Complex Symmetric Matrix MathOverflow Retrieved 2020 01 25 Schabauer Hannes Pacher Christoph Sunderland Andrew G Gansterer Wilfried N 2010 05 01 Toward a parallel solver for generalized complex symmetric eigenvalue problems Procedia Computer Science ICCS 2010 1 1 437 445 doi 10 1016 j procs 2010 04 047 ISSN 1877 0509 Golub amp Van Loan 1996 p 147 Gentle James E 1998 Numerical Linear Algebra for Applications in Statistics Springer p 94 ISBN 978 1 4612 0623 1 Higham Nicholas J 1990 Analysis of the Cholesky Decomposition of a Semi definite Matrix In Cox M G Hammarling S J eds Reliable Numerical Computation Oxford UK Oxford University Press pp 161 185 ISBN 978 0 19 853564 5 a b Krishnamoorthy Aravindh Menon Deepak 2011 Matrix Inversion Using Cholesky Decomposition 1111 4144 arXiv 1111 4144 Bibcode 2011arXiv1111 4144K a href Template Cite journal html title Template Cite journal cite journal a Cite journal requires journal help So Anthony Man Cho 2007 A Semidefinite Programming Approach to the Graph Realization Problem Theory Applications and Extensions PDF PhD Theorem 2 2 6 Golub amp Van Loan 1996 Theorem 4 1 3 Arora J S Introduction to Optimum Design 2004 p 327 https books google com books id 9FbwVe577xwC amp pg PA327 Matlab randn documentation mathworks com potrf Intel Math Kernel Library 1 Fang Haw ren O Leary Dianne P 8 August 2006 Modified Cholesky Algorithms A Catalog with New Approaches PDF a href Template Cite journal html title Template Cite journal cite journal a Cite journal requires journal help Watkins D 1991 Fundamentals of Matrix Computations New York Wiley p 84 ISBN 0 471 61414 9 Nocedal Jorge 2000 Numerical Optimization Springer Fang Haw ren 24 August 2007 Analysis of Block LDLT Factorizations for Symmetric Indefinite Matrices a href Template Cite journal html title Template Cite journal cite journal a Cite journal requires journal help Based on Stewart G W 1998 Basic decompositions Philadelphia Soc for Industrial and Applied Mathematics ISBN 0 89871 414 1 Osborne M 2010 Appendix B References EditDereniowski Dariusz Kubale Marek 2004 Cholesky Factorization of Matrices in Parallel and Ranking of Graphs 5th International Conference on Parallel Processing and Applied Mathematics PDF Lecture Notes on Computer Science Vol 3019 Springer Verlag pp 985 992 doi 10 1007 978 3 540 24669 5 127 ISBN 978 3 540 21946 0 Archived from the original PDF on 2011 07 16 Golub Gene H Van Loan Charles F 1996 Matrix Computations 3rd ed Baltimore Johns Hopkins ISBN 978 0 8018 5414 9 Horn Roger A Johnson Charles R 1985 Matrix Analysis 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 182 193 Trefethen Lloyd N Bau David 1997 Numerical linear algebra Philadelphia Society for Industrial and Applied Mathematics ISBN 978 0 89871 361 9 Osborne Michael 2010 Bayesian Gaussian Processes for Sequential Prediction Optimisation and Quadrature PDF thesis University of Oxford Ruschel Joao Paulo Tarasconi Bachelor degree Parallel Implementations of the Cholesky Decomposition on CPUs and GPUs Universidade Federal Do Rio Grande Do Sul Instituto De Informatica 2016 pp 29 30 External links EditHistory of science Edit Sur la resolution numerique des systemes d equations lineaires Cholesky s 1910 manuscript online and analyzed on BibNum in French and English for English click A telecharger Information Edit Cholesky factorization Encyclopedia of Mathematics EMS Press 2001 1994 Cholesky Decomposition The Data Analysis BriefBook Cholesky Decomposition on www math linux com Cholesky Decomposition Made Simple on Science MeanderthalComputer code Edit LAPACK is a collection of FORTRAN subroutines for solving dense linear algebra problems DPOTRF DPOTRF2 details performance ALGLIB includes a partial port of the LAPACK to C C Delphi Visual Basic etc spdmatrixcholesky hpdmatrixcholesky libflame is a C library with LAPACK functionality Notes and video on high performance implementation of Cholesky factorization at The University of Texas at Austin Cholesky TBB Threads SSE is a book explaining the implementation of the CF with TBB threads and SSE in Spanish library Ceres Solver by Google LDL decomposition routines in Matlab Armadillo is a C linear algebra package Rosetta Code is a programming chrestomathy site on page topic AlgoWiki is an open encyclopedia of algorithms properties and features of their implementations on page topic Intel oneAPI Math Kernel Library Intel Optimized Math Library for Numerical Computing potrf potrsUse of the matrix in simulation Edit Generating Correlated Random Variables and Stochastic Processes Martin Haugh Columbia UniversityOnline calculators Edit Online Matrix Calculator Performs Cholesky decomposition of matrices online Retrieved from https en wikipedia org w index php title Cholesky decomposition amp oldid 1165845794, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.