Example: barber

The Matrix Cookbook - Mathematics

The Matrix Cookbook [ ]. Kaare Brandt Petersen Michael Syskind Pedersen Version: November 15, 2012. 1. Introduction What is this? These pages are a collection of facts (identities, approxima- tions, inequalities, relations, ..) about matrices and matters relating to them. It is collected in this form for the convenience of anyone who wants a quick desktop reference . Disclaimer: The identities, approximations and relations presented here were obviously not invented but collected, borrowed and copied from a large amount of sources. These sources include similar but shorter notes found on the internet and appendices in books - see the references for a full list. Errors: Very likely there are errors, typos, and mistakes for which we apolo- gize and would be grateful to receive corrections at Its ongoing: The project of keeping a large repository of relations involving matrices is naturally ongoing and the version will be apparent from the date in the header. Suggestions: Your suggestion for additional content or elaboration of some topics is most welcome Keywords: Matrix algebra, Matrix relations, Matrix identities, derivative of determinant, derivative of inverse Matrix , differentiate a Matrix .

CONTENTS CONTENTS Notation and Nomenclature A Matrix A ij Matrix indexed for some purpose A i Matrix indexed for some purpose Aij Matrix indexed for some purpose An Matrix indexed for some purpose or The n.th power of a square matrix A 1 The inverse matrix of the matrix A A+ The pseudo inverse matrix of the matrix A (see Sec. 3.6) A1=2 The square root of a matrix (if unique), not …

Tags:

  Matrix, Cookbook, Matrix cookbook

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of The Matrix Cookbook - Mathematics

1 The Matrix Cookbook [ ]. Kaare Brandt Petersen Michael Syskind Pedersen Version: November 15, 2012. 1. Introduction What is this? These pages are a collection of facts (identities, approxima- tions, inequalities, relations, ..) about matrices and matters relating to them. It is collected in this form for the convenience of anyone who wants a quick desktop reference . Disclaimer: The identities, approximations and relations presented here were obviously not invented but collected, borrowed and copied from a large amount of sources. These sources include similar but shorter notes found on the internet and appendices in books - see the references for a full list. Errors: Very likely there are errors, typos, and mistakes for which we apolo- gize and would be grateful to receive corrections at Its ongoing: The project of keeping a large repository of relations involving matrices is naturally ongoing and the version will be apparent from the date in the header. Suggestions: Your suggestion for additional content or elaboration of some topics is most welcome Keywords: Matrix algebra, Matrix relations, Matrix identities, derivative of determinant, derivative of inverse Matrix , differentiate a Matrix .

2 Acknowledgements: We would like to thank the following for contributions and suggestions: Bill Baxter, Brian Templeton, Christian Rish j, Christian Schro ppel, Dan Boley, Douglas L. Theobald, Esben Hoegh-Rasmussen, Evripidis Karseras, Georg Martius, Glynne Casteel, Jan Larsen, Jun Bin Gao, Ju rgen Struckmeier, Kamil Dedecius, Karim T. Abou-Moustafa, Korbinian Strimmer, Lars Christiansen, Lars Kai Hansen, Leland Wilkinson, Liguo He, Loic Thibaut, Markus Froeb, Michael Hubatka, Miguel Bara o, Ole Winther, Pavel Sakov, Stephan Hattinger, Troels Pedersen, Vasile Sima, Vincent Rabaud, Zhaoshui He. We would also like thank The Oticon Foundation for funding our PhD. studies. Petersen & Pedersen, The Matrix Cookbook , Version: November 15, 2012, Page 2. CONTENTS CONTENTS. Contents 1 Basics 6. Trace .. 6. Determinant .. 6. The Special Case 2x2 .. 7. 2 Derivatives 8. Derivatives of a Determinant .. 8. Derivatives of an Inverse .. 9. Derivatives of Eigenvalues .. 10. Derivatives of Matrices, Vectors and Scalar Forms.

3 10. Derivatives of Traces .. 12. Derivatives of vector norms .. 14. Derivatives of Matrix norms .. 14. Derivatives of Structured Matrices .. 14. 3 Inverses 17. Basic .. 17. Exact Relations .. 18. Implication on Inverses .. 20. Approximations .. 20. Generalized Inverse .. 21. Pseudo Inverse .. 21. 4 Complex Matrices 24. Complex Derivatives .. 24. Higher order and non-linear derivatives .. 26. Inverse of complex sum .. 27. 5 Solutions and Decompositions 28. Solutions to linear equations .. 28. Eigenvalues and Eigenvectors .. 30. Singular Value Decomposition .. 31. Triangular Decomposition .. 32. LU decomposition .. 32. LDM decomposition .. 33. LDL decompositions .. 33. 6 Statistics and Probability 34. Definition of Moments .. 34. Expectation of Linear Combinations .. 35. Weighted Scalar Variable .. 36. 7 Multivariate Distributions 37. Cauchy .. 37. Dirichlet .. 37. Normal .. 37. Normal-Inverse Gamma .. 37. Gaussian .. 37. Multinomial .. 37. Petersen & Pedersen, The Matrix Cookbook , Version: November 15, 2012, Page 3.

4 CONTENTS CONTENTS. Student's t .. 37. Wishart .. 38. Wishart, Inverse .. 39. 8 Gaussians 40. Basics .. 40. Moments .. 42. Miscellaneous .. 44. Mixture of Gaussians .. 44. 9 Special Matrices 46. Block matrices .. 46. Discrete Fourier Transform Matrix , The .. 47. Hermitian Matrices and skew-Hermitian .. 48. Idempotent Matrices .. 49. Orthogonal matrices .. 49. Positive Definite and Semi-definite Matrices .. 50. Singleentry Matrix , The .. 52. Symmetric, Skew-symmetric/Antisymmetric .. 54. Toeplitz Matrices .. 54. Transition matrices .. 55. Units, Permutation and Shift .. 56. Vandermonde Matrices .. 57. 10 Functions and Operators 58. Functions and Series .. 58. Kronecker and Vec Operator .. 59. Vector Norms .. 61. Matrix Norms .. 61. Rank .. 62. Integral Involving Dirac Delta Functions .. 62. Miscellaneous .. 63. A One-dimensional Results 64. Gaussian .. 64. One Dimensional Mixture of Gaussians .. 65. B Proofs and Details 66. Misc Proofs .. 66. Petersen & Pedersen, The Matrix Cookbook , Version: November 15, 2012, Page 4.

5 CONTENTS CONTENTS. Notation and Nomenclature A Matrix Aij Matrix indexed for some purpose Ai Matrix indexed for some purpose Aij Matrix indexed for some purpose An Matrix indexed for some purpose or The power of a square Matrix A 1 The inverse Matrix of the Matrix A. A+ The pseudo inverse Matrix of the Matrix A (see Sec. ). A1/2 The square root of a Matrix (if unique), not elementwise (A)ij The (i, j).th entry of the Matrix A. Aij The (i, j).th entry of the Matrix A. [A]ij The ij-submatrix, A with row and column deleted a Vector (column-vector). ai Vector indexed for some purpose ai The element of the vector a a Scalar <z Real part of a scalar <z Real part of a vector <Z Real part of a Matrix =z Imaginary part of a scalar =z Imaginary part of a vector =Z Imaginary part of a Matrix det(A) Determinant of A. Tr(A) Trace of the Matrix A. diag(A) Diagonal Matrix of the Matrix A, (diag(A))ij = ij Aij eig(A) Eigenvalues of the Matrix A. vec(A) The vector-version of the Matrix A (see Sec.)

6 Sup Supremum of a set ||A|| Matrix norm (subscript if any denotes what norm). AT Transposed Matrix A T The inverse of the transposed and vice versa, A T = (A 1 )T = (AT ) 1 . A Complex conjugated Matrix AH Transposed and complex conjugated Matrix (Hermitian). A B Hadamard (elementwise) product A B Kronecker product 0 The null Matrix . Zero in all entries. I The identity Matrix Jij The single-entry Matrix , 1 at (i, j) and zero elsewhere A positive definite Matrix A diagonal Matrix Petersen & Pedersen, The Matrix Cookbook , Version: November 15, 2012, Page 5. 1 BASICS. 1 Basics (AB) 1 = B 1 A 1 (1). 1 1 1 1. ( ) = ..C B A (2). T 1 1 T. (A ) = (A ) (3). T T T. (A + B) = A +B (4). (AB)T = BT AT (5). ( )T = ..CT BT AT (6). H 1 1 H. (A ) = (A ) (7). (A + B)H = AH + BH (8). (AB)H = BH AH (9). H H H H. ( ) = ..C B A (10). Trace P. Tr(A) = Aii (11). Pi Tr(A) = i i , i = eig(A) (12). T. Tr(A) = Tr(A ) (13). Tr(AB) = Tr(BA) (14). Tr(A + B) = Tr(A) + Tr(B) (15). Tr(ABC) = Tr(BCA) = Tr(CAB) (16).

7 AT a = Tr(aaT ) (17). Determinant Let A be an n n Matrix . Q. det(A) = i i i = eig(A) (18). det(cA) = cn det(A), if A Rn n (19). det(AT ) = det(A) (20). det(AB) = det(A) det(B) (21). det(A 1 ) = 1/ det(A) (22). det(An ) = det(A)n (23). T T. det(I + uv ) = 1+u v (24). For n = 2: det(I + A) = 1 + det(A) + Tr(A) (25). For n = 3: 1 1. det(I + A) = 1 + det(A) + Tr(A) + Tr(A)2 Tr(A2 ) (26). 2 2. Petersen & Pedersen, The Matrix Cookbook , Version: November 15, 2012, Page 6. The Special Case 2x2 1 BASICS. For n = 4: 1. det(I + A) = 1 + det(A) + Tr(A) +. 2. 1. +Tr(A)2 Tr(A2 ). 2. 1 1 1. + Tr(A) Tr(A)Tr(A2 ) + Tr(A3 ). 3. (27). 6 2 3. For small , the following approximation holds 1 1. det(I + A) . = 1 + det(A) + Tr(A) + 2 Tr(A)2 2 Tr(A2 ) (28). 2 2. The Special Case 2x2. Consider the Matrix A . A11 A12. A=. A21 A22. Determinant and trace det(A) = A11 A22 A12 A21 (29). Tr(A) = A11 + A22 (30). Eigenvalues 2 Tr(A) + det(A) = 0. p p Tr(A) + Tr(A)2 4 det(A) Tr(A) Tr(A)2 4 det(A).

8 1 = 2 =. 2 2. 1 + 2 = Tr(A) 1 2 = det(A). Eigenvectors . A12 A12. v1 v2 . 1 A11 2 A11. Inverse . 1 1 A22 A12. A = (31). det(A) A21 A11. Petersen & Pedersen, The Matrix Cookbook , Version: November 15, 2012, Page 7. 2 DERIVATIVES. 2 Derivatives This section is covering differentiation of a number of expressions with respect to a Matrix X. Note that it is always assumed that X has no special structure, that the elements of X are independent ( not symmetric, Toeplitz, positive definite). See section for differentiation of structured matrices. The basic assumptions can be written in a formula as Xkl = ik lj (32). Xij that is for vector forms, . x xi x x x xi = = =. y i y y i yi y ij yj The following rules are general and very useful when deriving the differential of an expression ([19]): A = 0 (A is a constant) (33). ( X) = X (34). (X + Y) = X + Y (35). (Tr(X)) = Tr( X) (36). (XY) = ( X)Y + X( Y) (37). (X Y) = ( X) Y + X ( Y) (38). (X Y) = ( X) Y + X ( Y) (39). (X 1 ) = X 1 ( X)X 1 (40).

9 (det(X)) = Tr(adj(X) X) (41). (det(X)) = det(X)Tr(X 1 X) (42). (ln(det(X))) = Tr(X 1 X) (43). XT = ( X)T (44). XH = ( X)H (45). Derivatives of a Determinant General form . det(Y) 1 Y. = det(Y)Tr Y (46). x x X det(X). Xjk = ij det(X) (47). Xik k " " #. Y. 2 det(Y) 1 x = det(Y) Tr Y. x2 x . Y Y. +Tr Y 1 Tr Y 1. x x #. 1 Y 1 Y. Tr Y Y (48). x x Petersen & Pedersen, The Matrix Cookbook , Version: November 15, 2012, Page 8. Derivatives of an Inverse 2 DERIVATIVES. Linear forms det(X). = det(X)(X 1 )T (49). X. X det(X). Xjk = ij det(X) (50). Xik k det(AXB). = det(AXB)(X 1 )T = det(AXB)(XT ) 1 (51). X. Square forms If X is square and invertible, then det(XT AX). = 2 det(XT AX)X T (52). X. If X is not square but A is symmetric, then det(XT AX). = 2 det(XT AX)AX(XT AX) 1 (53). X. If X is not square and A is not symmetric, then det(XT AX). = det(XT AX)(AX(XT AX) 1 + AT X(XT AT X) 1 ) (54). X. Other nonlinear forms Some special cases are (See [9, 7]). ln det(XT X)|. = 2(X+ )T (55).

10 X. ln det(XT X). = 2XT (56). X+. ln | det(X)|. = (X 1 )T = (XT ) 1 (57). X. det(Xk ). = k det(Xk )X T (58). X. Derivatives of an Inverse From [27] we have the basic identity Y 1 Y 1. = Y 1 Y (59). x x Petersen & Pedersen, The Matrix Cookbook , Version: November 15, 2012, Page 9. Derivatives of Eigenvalues 2 DERIVATIVES. from which it follows (X 1 )kl = (X 1 )ki (X 1 )jl (60). Xij aT X 1 b = X T abT X T (61). X. det(X 1 ). = det(X 1 )(X 1 )T (62). X. Tr(AX 1 B). = (X 1 BAX 1 )T (63). X. Tr((X + A) 1 ). = ((X + A) 1 (X + A) 1 )T (64). X. From [32] we have the following result: Let A be an n n invertible square Matrix , W be the inverse of A, and J(A) is an n n -variate and differentiable function with respect to A, then the partial differentials of J with respect to A. and W satisfy J J T. = A T A. A W. Derivatives of Eigenvalues X . eig(X) = Tr(X) = I (65). X X. Y . eig(X) = det(X) = det(X)X T (66). X X. If A is real and symmetric, i and vi are distinct eigenvalues and eigenvectors of A (see (276)) with viT vi = 1, then [33].


Related search queries