Vous êtes sur la page 1sur 11

5/14/2017 CholeskydecompositionWikipedia

Choleskydecomposition
FromWikipedia,thefreeencyclopedia

Inlinearalgebra,theCholeskydecompositionorCholeskyfactorizationisadecompositionofaHermitian,
positivedefinitematrixintotheproductofalowertriangularmatrixanditsconjugatetranspose,whichis
usefule.g.forefficientnumericalsolutionsandMonteCarlosimulations.ItwasdiscoveredbyAndrLouis
Choleskyforrealmatrices.Whenitisapplicable,theCholeskydecompositionisroughlytwiceasefficientas
theLUdecompositionforsolvingsystemsoflinearequations.[1]

Contents
1 Statement
2 LDLdecomposition
3 Example
4 Applications
4.1 Linearleastsquares
4.2 Nonlinearoptimization
4.3 MonteCarlosimulation
4.4 Kalmanfilters
4.5 Matrixinversion
5 Computation
5.1 TheCholeskyalgorithm
5.2 TheCholeskyBanachiewiczandCholeskyCroutalgorithms
5.3 Stabilityofthecomputation
5.4 LDLdecomposition
5.5 Blockvariant
5.6 Updatingthedecomposition
5.6.1 Rankoneupdate
5.6.2 Rankonedowndate
6 Proofforpositivesemidefinitematrices
7 Generalization
8 Implementationsinprogramminglanguages
9 Seealso
10 Notes
11 References
12 Externallinks
12.1 Historyofscience
12.2 Information
12.3 Computercode
12.4 Useofthematrixinsimulation
12.5 Onlinecalculators

Statement
TheCholeskydecompositionofaHermitianpositivedefinitematrixAisadecompositionoftheform

whereLisalowertriangularmatrixwithrealandpositivediagonalentries,andL*denotestheconjugate
transposeofL.EveryHermitianpositivedefinitematrix(andthusalsoeveryrealvaluedsymmetricpositive
definitematrix)hasauniqueCholeskydecomposition.[2]

https://en.wikipedia.org/wiki/Cholesky_decomposition 1/11
5/14/2017 CholeskydecompositionWikipedia

IfthematrixAisHermitianandpositivesemidefinite,thenitstillhasadecompositionoftheformA=LL*if
thediagonalentriesofLareallowedtobezero.[3]

WhenAhasrealentries,LhasrealentriesaswellandthefactorizationmaybewrittenA=LLT[4]

TheCholeskydecompositionisuniquewhenAispositivedefinitethereisonlyonelowertriangularmatrixL
withstrictlypositivediagonalentriessuchthatA=LL*.However,thedecompositionneednotbeuniquewhen
Aispositivesemidefinite.

Theconverseholdstrivially:ifAcanbewrittenasLL*forsomeinvertibleL,lowertriangularorotherwise,
thenAisHermitianandpositivedefinite.

LDLdecomposition
AcloselyrelatedvariantoftheclassicalCholeskydecompositionistheLDLdecomposition,

whereLisalowerunittriangular(unitriangular)matrixandDisadiagonalmatrix.

ThisdecompositionisrelatedtotheclassicalCholeskydecomposition,oftheformLL*,asfollows:

OrgiventheclassicalCholeskydecomposition theLDLTformcanbefoundbyusingtheproperty
thatthediagonalofLmustbe1andthatboththeCholeskyandLDLTformarelowertriangles,[5]ifSisa
diagonalmatrixthatcontainsthemaindiagonalof then

TheLDLvariant,ifefficientlyimplemented,requiresthesamespaceandcomputationalcomplexityto
constructandusebutavoidsextractingsquareroots.[6]SomeindefinitematricesforwhichnoCholesky
decompositionexistshaveanLDLdecompositionwithnegativeentriesinD.Forthesereasons,theLDL
decompositionmaybepreferred.Forrealmatrices,thefactorizationhastheformA=LDLTandisoften
referredtoasLDLTdecomposition(orLDLTdecomposition).Itiscloselyrelatedtotheeigendecomposition
ofrealsymmetricmatrices,A=QQT.

Example
HereistheCholeskydecompositionofasymmetricrealmatrix:

AndhereisitsLDLTdecomposition:

https://en.wikipedia.org/wiki/Cholesky_decomposition 2/11
5/14/2017 CholeskydecompositionWikipedia

Applications
TheCholeskydecompositionismainlyusedforthenumericalsolutionoflinearequations .IfAis
symmetricandpositivedefinite,thenwecansolve byfirstcomputingtheCholeskydecomposition
,thensolving forybyforwardsubstitution,andfinallysolving forxbyback
substitution.

Analternativewaytoeliminatetakingsquarerootsinthe decompositionistocomputetheCholesky
decomposition ,thensolving fory,andfinallysolving .

Forlinearsystemsthatcanbeputintosymmetricform,theCholeskydecomposition(oritsLDLvariant)isthe
methodofchoice,forsuperiorefficiencyandnumericalstability.ComparedtotheLUdecomposition,itis
roughlytwiceasefficient.

Linearleastsquares

SystemsoftheformAx=bwithAsymmetricandpositivedefinitearisequiteofteninapplications.For
instance,thenormalequationsinlinearleastsquaresproblemsareofthisform.Itmayalsohappenthatmatrix
Acomesfromanenergyfunctionalwhichmustbepositivefromphysicalconsiderationsthishappens
frequentlyinthenumericalsolutionofpartialdifferentialequations.

Nonlinearoptimization

NonlinearmultivariatefunctionsmaybeminimizedovertheirparametersusingvariantsofNewton'smethod
calledquasiNewtonmethods.Ateachiteration,thesearchtakesastepsdefinedbysolvingHs=gfors,
wheresisthestep,gisthegradientvectorofthefunction'spartialfirstderivativeswithrespecttothe
parameters,andHisanapproximationtotheHessianmatrixofpartialsecondderivativesformedbyrepeated
rank1updatesateachiteration.TwowellknownupdateformulaearecalledDavidonFletcherPowell(DFP)
andBroydenFletcherGoldfarbShanno(BFGS).Lossofthepositivedefiniteconditionthroughroundoff
errorisavoidedifratherthanupdatinganapproximationtotheinverseoftheHessian,oneupdatesthe
CholeskydecompositionofanapproximationoftheHessianmatrixitself.

MonteCarlosimulation

TheCholeskydecompositioniscommonlyusedintheMonteCarlomethodforsimulatingsystemswith
multiplecorrelatedvariables:Thecorrelationmatrixisdecomposed,togivethelowertriangularL.Applying
thistoavectorofuncorrelatedsamples,u,producesasamplevectorLuwiththecovariancepropertiesofthe
systembeingmodeled.[7]

ForasimplifiedexamplethatshowstheeconomyonegetsfromCholesky'sdecomposition,sayoneneedsto
generatetwocorrelatednormalvariables and withgivencorrelationcoefficient .Alloneneedstodois
togeneratetwouncorrelatedGaussianrandomvariables and .Weset and
.

Kalmanfilters

UnscentedKalmanfilterscommonlyusetheCholeskydecompositiontochooseasetofsocalledsigmapoints.
TheKalmanfiltertrackstheaveragestateofasystemasavectorxoflengthNandcovarianceasanNbyN
matrixP.ThematrixPisalwayspositivesemidefinite,andcanbedecomposedintoLLT.ThecolumnsofL
canbeaddedandsubtractedfromthemeanxtoformasetof2Nvectorscalledsigmapoints.Thesesigma
pointscompletelycapturethemeanandcovarianceofthesystemstate.

https://en.wikipedia.org/wiki/Cholesky_decomposition 3/11
5/14/2017 CholeskydecompositionWikipedia

Matrixinversion

TheexplicitinverseofaHermitianmatrixcanbecomputedviaCholeskydecomposition,inamannersimilar
tosolvinglinearsystems,using operations( multiplications).[6]Theentireinversioncanevenbe
efficientlyperformedinplace.

AnonHermitianmatrixBcanalsobeinvertedusingthefollowingidentity,whereBB*willalwaysbe
Hermitian:

Computation
TherearevariousmethodsforcalculatingtheCholeskydecomposition.Thecomputationalcomplexityof
commonlyusedalgorithmsisO(n3)ingeneral.Thealgorithmsdescribedbelowallinvolveaboutn3/3FLOPs,
wherenisthesizeofthematrixA.Hence,theyarehalfthecostoftheLUdecomposition,whichuses2n3/3
FLOPs(seeTrefethenandBau1997).

Whichofthealgorithmsbelowisfasterdependsonthedetailsoftheimplementation.Generally,thefirst
algorithmwillbeslightlyslowerbecauseitaccessesthedatainalessregularmanner.

TheCholeskyalgorithm

TheCholeskyalgorithm,usedtocalculatethedecompositionmatrixL,isamodifiedversionofGaussian
elimination.

Therecursivealgorithmstartswithi:=1and

A(1):=A.

Atstepi,thematrixA(i)hasthefollowingform:

whereIi1denotestheidentitymatrixofdimensioni1.

IfwenowdefinethematrixLiby

thenwecanwriteA(i)as

where

https://en.wikipedia.org/wiki/Cholesky_decomposition 4/11
5/14/2017 CholeskydecompositionWikipedia

Notethatbib*iisanouterproduct,thereforethisalgorithmiscalledtheouterproductversionin(Golub&
VanLoan).

Werepeatthisforifrom1ton.Afternsteps,wegetA(n+1)=I.Hence,thelowertriangularmatrixLweare
lookingforiscalculatedas

TheCholeskyBanachiewiczandCholeskyCroutalgorithms

IfwewriteouttheequationA=LL*,

Accesspattern
(white)and
writingpattern
(yellow)forthe
weobtainthefollowingformulafortheentriesofL: inplace
Cholesky
Banachiewicz
algorithmona
55matrix.

TheexpressionunderthesquarerootisalwayspositiveifAisrealandpositivedefinite.

ForcomplexHermitianmatrix,thefollowingformulaapplies:

Sowecancomputethe(i,j)entryifweknowtheentriestotheleftandabove.Thecomputationisusually
arrangedineitherofthefollowingorders.

TheCholeskyBanachiewiczalgorithmstartsfromtheupperleftcornerofthematrixLandproceedsto
calculatethematrixrowbyrow.
TheCholeskyCroutalgorithmstartsfromtheupperleftcornerofthematrixLandproceedsto
calculatethematrixcolumnbycolumn.

Eitherpatternofaccessallowstheentirecomputationtobeperformedinplaceifdesired.

https://en.wikipedia.org/wiki/Cholesky_decomposition 5/11
5/14/2017 CholeskydecompositionWikipedia

Stabilityofthecomputation

Supposethatwewanttosolveawellconditionedsystemoflinearequations.IftheLUdecompositionisused,
thenthealgorithmisunstableunlessweusesomesortofpivotingstrategy.Inthelattercase,theerrordepends
onthesocalledgrowthfactorofthematrix,whichisusually(butnotalways)small.

Now,supposethattheCholeskydecompositionisapplicable.Asmentionedabove,thealgorithmwillbetwice
asfast.Furthermore,nopivotingisnecessaryandtheerrorwillalwaysbesmall.Specifically,ifwewantto
solveAx=b,andydenotesthecomputedsolution,thenysolvesthedisturbedsystem(A+E)y=bwhere

Here,||||2isthematrix2norm,cnisasmallconstantdependingonn,anddenotestheunitroundoff.

OneconcernwiththeCholeskydecompositiontobeawareofistheuseofsquareroots.Ifthematrixbeing
factorizedispositivedefiniteasrequired,thenumbersunderthesquarerootsarealwayspositiveinexact
arithmetic.Unfortunately,thenumberscanbecomenegativebecauseofroundofferrors,inwhichcasethe
algorithmcannotcontinue.However,thiscanonlyhappenifthematrixisveryillconditioned.Onewayto
addressthisistoaddadiagonalcorrectionmatrixtothematrixbeingdecomposedinanattempttopromotethe
positivedefiniteness.[8]Whilethismightlessentheaccuracyofthedecomposition,itcanbeveryfavorablefor
otherreasonsforexample,whenperformingNewton'smethodinoptimization,addingadiagonalmatrixcan
improvestabilitywhenfarfromtheoptimum.

LDLdecomposition

Analternativeform,eliminatingtheneedtotakesquareroots,isthesymmetricindefinitefactorization[9]

IfAisreal,thefollowingrecursiverelationsapplyfortheentriesofDandL:

ForcomplexHermitianmatrixA,thefollowingformulaapplies:

Again,thepatternofaccessallowstheentirecomputationtobeperformedinplaceifdesired.

https://en.wikipedia.org/wiki/Cholesky_decomposition 6/11
5/14/2017 CholeskydecompositionWikipedia

Blockvariant

Whenusedonindefinitematrices,theLDL*factorizationisknowntobeunstablewithoutcarefulpivoting[10]
specifically,theelementsofthefactorizationcangrowarbitrarily.Apossibleimprovementistoperformthe
factorizationonblocksubmatrices,commonly2x2:[11]

whereeveryelementinthematricesaboveisasquaresubmatrix.Fromthis,theseanalogousrecursiverelations
follow:

Thisinvolvesmatrixproductsandexplicitinversion,thuslimitingthepracticalblocksize.

Updatingthedecomposition

AtaskthatoftenarisesinpracticeisthatoneneedstoupdateaCholeskydecomposition.Inmoredetails,one
hasalreadycomputedtheCholeskydecomposition ofsomematrix ,thenonechangesthematrix
insomewayintoanothermatrix,say ,andonewantstocomputetheCholeskydecompositionofthe
updatedmatrix: .ThequestionisnowwhetheronecanusetheCholeskydecompositionof that
wascomputedbeforetocomputetheCholeskydecompositionof .

Rankoneupdate

Thespecificcase,wheretheupdatedmatrix isrelatedtothematrix by ,isknownasa


rankoneupdate.

Hereisalittlefunctionbasedon[12]writteninMatlabsyntaxwhichrealizesarankoneupdate:

function[L]=cholupdate(L,x)
n=length(x);
fork=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;
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

Rankonedowndate

https://en.wikipedia.org/wiki/Cholesky_decomposition 7/11
5/14/2017 CholeskydecompositionWikipedia

Arankonedowndateissimilartoarankoneupdate,exceptthattheadditionisreplacedbysubtraction:
.Thisonlyworksifthenewmatrix isstillpositivedefinite.

Thecodefortherankoneupdateshownabovecaneasilybeadaptedtodoarankonedowndate:onemerely
needstoreplacethetwoadditionsintheassignmenttorandL(k+1:n,k)bysubtractions.

Proofforpositivesemidefinitematrices
TheabovealgorithmsshowthateverypositivedefinitematrixAhasaCholeskydecomposition.Thisresultcan
beextendedtothepositivesemidefinitecasebyalimitingargument.Theargumentisnotfullyconstructive,
i.e.,itgivesnoexplicitnumericalalgorithmsforcomputingCholeskyfactors.

IfAisannbynpositivesemidefinitematrix,thenthesequence{Ak}={A+(1/k)In}consistsofpositive
definitematrices.(Thisisanimmediateconsequenceof,forexample,thespectralmappingtheoremforthe
polynomialfunctionalcalculus.)Also,

AkA

inoperatornorm.Fromthepositivedefinitecase,eachAkhasCholeskydecompositionAk=LkL*k.By
propertyoftheoperatornorm,

So{Lk}isaboundedsetintheBanachspaceofoperators,thereforerelativelycompact(becausethe
underlyingvectorspaceisfinitedimensional).Consequently,ithasaconvergentsubsequence,alsodenotedby
{Lk},withlimitL.ItcanbeeasilycheckedthatthisLhasthedesiredproperties,i.e.A=LL*andLislower
triangularwithnonnegativediagonalentries:forallxandy,

Therefore,A=LL*.Becausetheunderlyingvectorspaceisfinitedimensional,alltopologiesonthespaceof
operatorsareequivalent.SoLktendstoLinnormmeansLktendstoLentrywise.Thisinturnimpliesthat,
sinceeachLkislowertriangularwithnonnegativediagonalentries,Lisalso.

Generalization
TheCholeskyfactorizationcanbegeneralizedto(notnecessarilyfinite)matriceswithoperatorentries.Let
beasequenceofHilbertspaces.Considertheoperatormatrix

actingonthedirectsum

whereeach

https://en.wikipedia.org/wiki/Cholesky_decomposition 8/11
5/14/2017 CholeskydecompositionWikipedia

isaboundedoperator.IfAispositive(semidefinite)inthesensethatforallfinitekandforany

wehave ,thenthereexistsalowertriangularoperatormatrixLsuchthatA=LL*.Onecanalso
takethediagonalentriesofLtobepositive.

Implementationsinprogramminglanguages
Cprogramminglanguage:theGNUScientificLibraryprovidesseveralimplementationsofCholesky
decomposition.
Maximacomputeralgebrasystem:functioncholeskycomputesCholeskydecomposition.
GNUOctavenumericalcomputationssystemprovidesseveralfunctionstocalculate,update,andapplya
Choleskydecomposition.
TheLAPACKlibraryprovidesahighperformanceimplementationoftheCholeskydecompositionthat
canbeaccessedfromFortran,Candmostlanguages.
InPython,thecommand"cholesky"fromthenumpy.linalgmoduleperformsCholeskydecomposition.
InMatlabProgramming,the"chol"commandcanbeusedtosimplyapplythistoamatrix.
InR,the"chol"functiongivestheCholeskydecomposition.
InMathematica,thefunction"CholeskyDecomposition"canbeappliedtoamatrix.
InC++,thecommand"chol"fromthearmadillolibraryperformsCholeskydecomposition.TheEigen
librarysuppliesCholeskyfactorizationsforbothsparseanddensematrices.
InAnalytica,thefunctionDecomposegivestheCholeskydecomposition.
TheApacheCommonsMathlibraryhasanimplementation(http://commons.apache.org/proper/commons
math/javadocs/api3.4/org/apache/commons/math3/linear/CholeskyDecomposition.html)whichcanbe
usedinJava,ScalaandanyotherJVMlanguage.

Seealso
SymbolicCholeskydecomposition
Minimumdegreealgorithm
Matrixdecomposition
Sylvester'slawofinertia
Cyclerank
Matrixsquareroot

Notes
1.Press,WilliamH.SaulA.TeukolskyWilliamT.VetterlingBrianP.Flannery(1992).NumericalRecipesinC:The
ArtofScientificComputing(secondedition).CambridgeUniversityEnglandEPress.p.994.ISBN0521431085.
2.Golub&VanLoan(1996,p.143),Horn&Johnson(1985,p.407),Trefethen&Bau(1997,p.174)
3.Golub&VanLoan(1996,p.147)
4.Horn&Johnson(1985,p.407)
5.varianceLDLTdecompositionfromCholeskydecompositionCrossValidated(http://stats.stackexchange.com/ques
tions/208599/ldltdecompositionfromcholeskydecomposition).Stats.stackexchange.com(20160421).Retrievedon
20161102.
6.Krishnamoorthy,AravindhMenon,Deepak(2011)."MatrixInversionUsingCholeskyDecomposition".1111:4144.
arXiv:1111.4144 .Bibcode:2011arXiv1111.4144K.
7.Matlabrandndocumentation(http://www.mathworks.com/help/techdoc/ref/randn.html).mathworks.com
8.Fang,HawrenOLeary,DianneP.(8August2006)."ModiedCholeskyAlgorithms:ACatalogwithNew
Approaches"(PDF).
9.Watkins,D.(1991).FundamentalsofMatrixComputations.NewYork:Wiley.p.84.ISBN0471614149.
10.Nocedal,Jorge(2000).NumericalOptimization.Springer.
11.Fang,Hawren(24August2007)."AnalysisofBlockLDLTFactorizationsforSymmetricIndefiniteMatrices".
12.Stewart,G.W.(1998).Basicdecompositions.Philadelphia:Soc.forIndustrialandAppliedMathematics.ISBN0
898714141.

https://en.wikipedia.org/wiki/Cholesky_decomposition 9/11
5/14/2017 CholeskydecompositionWikipedia

References
Dereniowski,DariuszKubale,Marek(2004)."CholeskyFactorizationofMatricesinParalleland
RankingofGraphs".5thInternationalConferenceonParallelProcessingandAppliedMathematics
(PDF) .LectureNotesonComputerScience.3019.SpringerVerlag.pp.985992.doi:10.1007/9783540
246695_127.ISBN9783540219460..
Golub,GeneH.VanLoan,CharlesF.(1996).MatrixComputations(3rded.).Baltimore:JohnsHopkins.
ISBN9780801854149.
Horn,RogerA.Johnson,CharlesR.(1985).MatrixAnalysis.CambridgeUniversityPress.ISBN0521
386322..
S.J.JulierandJ.K.Uhlmann."AGeneralMethodforApproximatingNonlinearTransformationsof
ProbabilityDistributions".
S.J.JulierandJ.K.Uhlmann,"AnewextensionoftheKalmanfiltertononlinearsystems,"inProc.
AeroSense:11thInt.Symp.Aerospace/DefenceSensing,SimulationandControls,1997,pp.182193.
Trefethen,LloydN.Bau,David(1997).Numericallinearalgebra.Philadelphia:SocietyforIndustrial
andAppliedMathematics.ISBN9780898713619..

Externallinks
Historyofscience
Surlarsolutionnumriquedessystmesd'quationslinaires,Cholesky's1910manuscript,onlineand
analyzedonBibNum(http://bibnum.education.fr/mathematiques/algebre/surlaresolutionnumeriquedes
systemesdequationslineaires)(French)(English)[forEnglish,click'Atlcharger']

Information

Hazewinkel,Michiel,ed.(2001),"Choleskyfactorization",EncyclopediaofMathematics,Springer,
ISBN9781556080104
"CholeskyDecomposition".PlanetMath.
CholeskyDecomposition(http://rkb.home.cern.ch/rkb/AN16pp/node33.html#SECTION0003300000000
00000000),TheDataAnalysisBriefBook
CholeskyDecomposition(http://www.mathlinux.com/spip.php?article43)onwww.mathlinux.com
CholeskyDecompositionMadeSimple(http://sciencemeanderthal.wordpress.com/2012/06/28/cholesky
decompositionofvariancecovariancematricesintheclassictwinstudy/)onScienceMeanderthal

Computercode
LAPACK(http://netlib.org/lapack/)isacollectionofFORTRANsubroutinesforsolvingdenselinear
algebraproblems
ALGLIB(http://www.alglib.net/)includesapartialportoftheLAPACKtoC++,C#,Delphi,Visual
Basic,etc.
libflame(http://www.cs.utexas.edu/users/flame/)isaClibrarywithLAPACKfunctionality.
NotesandvideoonhighperformanceimplementationofCholeskyfactorization(http://www.cs.utexas.ed
u/users/flame/Movies.html#Chol)atTheUniversityofTexasatAustin.
Cholesky:TBB+Threads+SSE(http://upcommons.upc.edu/pfc/handle/2099.1/10988/)isabook
explainingtheimplementationoftheCFwithTBB,threadsandSSE(inSpanish).
library"CeresSolver"(http://ceressolver.org/)byGoogle.
LDLdecomposition(http://infohost.nmt.edu/~borchers/ldlt.html)routinesinMatlab.

Useofthematrixinsimulation

GeneratingCorrelatedRandomVariables(http://www.columbia.edu/~mh2078/MCS04/MCS_framework
_FEegs.pdf),MartinHaugh,ColumbiaUniversity

https://en.wikipedia.org/wiki/Cholesky_decomposition 10/11
5/14/2017 CholeskydecompositionWikipedia

Onlinecalculators

OnlineMatrixCalculator(http://www.bluebit.gr/matrixcalculator/)PerformsCholeskydecompositionof
matricesonline.

Retrievedfrom"https://en.wikipedia.org/w/index.php?title=Cholesky_decomposition&oldid=778616941"

Categories: Operatortheory Matrixdecompositions Numericallinearalgebra

Thispagewaslasteditedon4May2017,at06:26.
TextisavailableundertheCreativeCommonsAttributionShareAlikeLicenseadditionaltermsmay
apply.Byusingthissite,youagreetotheTermsofUseandPrivacyPolicy.Wikipediaisaregistered
trademarkoftheWikimediaFoundation,Inc.,anonprofitorganization.

https://en.wikipedia.org/wiki/Cholesky_decomposition 11/11

Vous aimerez peut-être aussi