Derivatives of matrix

来源:互联网 发布:青牛软件手机卡 编辑:程序博客网 时间:2024/05/29 16:26

  • matrix V scalar
  • scalar V matrix
  • vector V vector
  • Examples
    • 1 Derivative of inverse matrix
    • 2 Derivative of trace
    • 3 Applications
    • 4 Derivative of determinant
  • Reference

1. matrix V scalar

A(x)x=[A(x)ijx]i,j

2. scalar V matrix

f(A)A=[f(x)Aij]i,j

3. vector V vector

g(V)V=g(V)iVji,j

4. Examples

4.1 Derivative of inverse matrix

A1A=IA1Ax=0A1xA+A1Ax=0A1x=A1AxA1

For x=Aij with A being nonsymmetric, we have

AAij=Iij

and
A1Aij=A1IijA1

and
2A1AijAkr=A1AkrAij=A1IkrA1Aij=A1AijIkrA1A1IkrA1IkrA1Aij=(A1IijA1)IkrA1A1Ikr(A1IijA1)Ikr=A1IijA1IkrA1+A1IkrA1IijA1

For x=Aij with A being symmetric, we have

AAij=Iij+IjiδjiIji=dIij

Then all can be replaced by Iij

4.2 Derivative of trace

If A is not symmetric:

tr(A)A=[tr(A)Aij]ij=[tr(AAij)]ij=tr[Iij]ij=In

If A is symmetric:
tr(A)A=[tr(A)Aij]ij=[tr(AAij)]ij=tr[Iij+Iji+δjiIji]ij=In

If S is not symmetric:

f=tr(S1B)fSij=tr(S1B)Sij=tr(S1BSij)=tr(S1IijS1B)=tr(IijS1BS1)=Θ=S1BS1tr(IijΘ)=Θjitr(S1B)S=(S1BS1)T

If S is symmetric:

f=tr(S1B)fSij=tr(S1B)Sij=tr(S1BSij)=tr(IijΘ)=[Θji+ΘijδijΘij]tr(S1B)S=[S1(B+BT)S1diag(S1BS1)]

4.3 Applications

tr(AB)A=BT

tr(ATB)A=B

tr(ATSA)A=[tr(ATSA)Aij]ij=[tr(IjiSA+ATSIij)]ij=SA+SATA=(S+ST)A

S is symmetric

tr((ATSA)1R)A=tr((ATSA)1R)Aijij=tr(ATSA)1RAijij=[tr((ATSA)1ATSAAij(ATSA)1R)]ij=[tr((ATSA)1(IjiSA+ATSIij)(ATSA)1R)]ij=[tr(IjiSA(ATSA)1R(ATSA)1)]ij+[tr((ATSA)1R(ATSA)1ATSIij)]ij=SA(ATSA)1R(ATSA)1SA(ATSA)1RT(ATSA)1=SA(ATSA)1(R+RT)(ATSA)1

tr((ATS2A)1(ATS1A))A=tr((AT1S2A1)1(ATS1A))AA1=A+tr((ATS2A)1(AT2S1A2))AA2=A=2S2A(ATS2A)1(ATS1A)(ATS2A)1+2S1A(ATS2A)1

4.4 Derivative of determinant

|R|Rij=Cij

which is its cofactor(from the cofactor expansion). Then
|R|R=C

which is the adjoint matrix. Then from the fact that
|R|I=RCT

we have
|R|R=|R|R1T

Furthermore

ln|R|R=1|R||R|R=R1T

5. Reference

reference of book “Introduction to Statistical Pattern Recognition, second edition.”

0 0
原创粉丝点击