Cholesky分解及一个例子

文字来源:

  1. C.E. Rasmussen & K.I. Williams, Gaissian Processes for Machine Learning,MIT
  2. 计算机科学计算,高等教育出版社,张宏伟 等

定义: cholesky分解是一种将任意n阶对称正定矩阵A分解成下三角矩阵L的一种方法:
L L T = A \pmb L\pmb L^T=\pmb A LLLLLLT=AAA其中,L称为Cholesky因子。如果L的对角元均为正数,则L是唯一确定的。

Cholesky分解对于解决带有对称正定系数矩阵A的线性问题非常有效。在计算机中,直接求解 A x = b A\mathbf x=\mathbf b Ax=b时间复杂度是很高的(Gauss消元法求解是 O ( n 3 ) O(n^3) O(n3)),用cholesky法对A提前变换之后再计算会有效降低复杂度。计算方法如下: A x = b ⇒ L L T x = b \pmb A\pmb x=\pmb b\Rightarrow\pmb L\pmb L^T\pmb x=\pmb b AAAxxx=bbbLLLLLLTxxx=bbb其等价于 { L y = b L T x = y \begin{cases} \pmb L\pmb y=\pmb b \\ \pmb L^T\pmb x=\pmb y \end{cases} {LLLyyy=bbbLLLTxxx=yyy
( a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋱ ⋮ a n 1 a n 2 … a n n ) = ( l 11 l 21 l 22 ⋮ ⋮ ⋱ l n 1 l n 2 … l n n ) ( l 11 l 12 ⋯ l 1 n l 22 ⋯ l 2 n ⋱ ⋮ l n n ) \begin{pmatrix} a_{11} & a_{12} & \cdots &a_{1n} \\ a_{21} & a_{22} & \cdots& a_{2n}\\ \vdots &\vdots&\ddots &\vdots\\ a_{n1} & a_{n2} & \dots & a_{nn} \end{pmatrix}= \begin{pmatrix} l_{11} & & & \\ l_{21} & l_{22} & & \\ \vdots &\vdots&\ddots & \\ l_{n1} & l_{n2} & \dots & l_{nn} \end{pmatrix} \begin{pmatrix} l_{11} & l_{12} & \cdots &l_{1n} \\ & l_{22} & \cdots& l_{2n}\\ & &\ddots &\vdots\\ & & & l_{nn} \end{pmatrix} a11a21an1a12a22an2a1na2nann=l11l21ln1l22ln2lnnl11l12l22l1nl2nlnn
a i j = ∑ k = 1 j − 1 l i k l j k + l i j l j j , i = j , j + 1 , ⋯   , n , a_{ij}=\sum_{k=1}^{j-1} l_{ik}l_{jk}+l_{ij}l_{jj}, \quad i=j,j+1,\cdots,n, aij=k=1j1likljk+lijljj,i=j,j+1,,n,则有
l j j = ( a j j − ∑ k = 1 j − 1 l j k 2 ) 1 2 , l_{jj}=\Bigl(a_{jj}-\sum_{k=1}^{j-1}l_{jk}^2\Bigr)^{\frac{1}{2}}, ljj=(ajjk=1j1ljk2)21,
l i j = ( a i j − ∑ k = 1 j − 1 l i k l j k ) / l j j , i = j + 1 , j + 2 , ⋯   , n l_{ij}=\Bigl( a_{ij}-\sum_{k=1}^{j-1}l_{ik}l_{jk} \Bigr)/l_{jj}, \quad i=j+1,j+2,\cdots,n lij=(aijk=1j1likljk)/ljj,i=j+1,j+2,,n计算次序为 l 11 , l 21 , . . . , l n 1 , l 22 , l 32 , . . . , l n 2 , . . . , l n n . l_{11},l_{21},...,l_{n1},l_{22},l_{32},...,l_{n2},...,l_{nn}. l11,l21,...,ln1,l22,l32,...,ln2,...,lnn.

注意,正定对称矩阵的行列式可以由下式得出:
∣ A ∣ = ∏ n i = 1 L i i 2 , |A|=\underset{i=1}{\overset{n}{\prod}}L^2_{ii}, A=i=1nLii2,或者 log ⁡ ∣ A ∣ = 2 ∑ n i = 1 log ⁡ L i i , \log|A|=2\underset{i=1}{\overset{n}{\sum}}\log L_{ii}, logA=2i=1nlogLii其中,L是由A得出的Cholesky因子。

例题
用cholesky方法求解线性方程组 A x = b \pmb A\pmb x=\pmb b AAAxxx=bbb,其中
A = ( 4 − 1 1 − 1 4.25 2.75 1 2.75 3.5 ) , b = ( 4 6 7.25 ) . \pmb A= \begin{pmatrix} 4 & -1 & 1 \\ -1 & 4.25 & 2.75\\ 1 & 2.75 & 3.5 \end{pmatrix}, \pmb b= \begin{pmatrix} 4\\ 6\\ 7.25 \end{pmatrix}. AAA=41114.252.7512.753.5,bbb=467.25.
显然 A T = A \pmb A^T=\pmb A AAAT=AAA,且 D 1 = 4 > 0 , D 2 = 16 > 0 , D 3 = 16 > 0 D_1=4>0,D_2=16>0,D_3=16>0 D1=4>0,D2=16>0,D3=16>0.因此,A为对称正定矩阵,故存在 A = L L T \pmb A=\pmb L\pmb L^T AAA=LLLLLLT.则有:
l 11 = a 11 = 2 ,   l 21 = a 21 l 11 = − 0.5 ,   l 31 = a 31 l 11 = 0.5 , l 22 = a 22 − l 21 2 = 2 , l 32 = a 32 − l 31 l 21 l 22 = 1.5 , l 33 = a 33 − l 31 2 − l 32 2 = 1 , \begin{aligned} & l_{11}=\sqrt{a_{11}}=2 , \ l_{21}=\frac{a_{21}}{l_{11}}=-0.5, \ l_{31}=\frac{a_{31}}{l_{11}}=0.5, \\ &l_{22}=\sqrt{a_{22}-l_{21}^2}=2, \\ &l_{32}=\frac{a_{32}-l_{31}l_{21}}{l_{22}}=1.5,\\ &l_{33}=\sqrt{a_{33}-l_{31}^2-l_{32}^2}=1, \end{aligned} l11=a11 =2, l21=l11a21=0.5, l31=l11a31=0.5,l22=a22l212 =2,l32=l22a32l31l21=1.5,l33=a33l312l322 =1,
L = ( 2 − 0.5 2 0.5 1.5 1 ) . \pmb L= \begin{pmatrix} 2&&\\ -0.5&2&\\ 0.5&1.5&1 \end{pmatrix}. LLL=20.50.521.51.再求
{ L y = b L T x = y \begin{cases} \pmb L\pmb y=\pmb b \\ \pmb L^T\pmb x=\pmb y \end{cases} {LLLyyy=bbbLLLTxxx=yyy解得 x = ( 1 , 1 , 1 ) T . \pmb x=(1,1,1)^T. xxx=(1,1,1)T.

你可能感兴趣的:(Cholesky分解及一个例子)