Background Mathematics (2/2) 1. David Barber

Similar documents
Linear Algebra Review. Vectors

APPENDIX A. Background Mathematics. A.1 Linear Algebra. Vector algebra. Let x denote the n-dimensional column vector with components x 1 x 2.

Review problems for MA 54, Fall 2004.

Conceptual Questions for Review

MATH 20F: LINEAR ALGEBRA LECTURE B00 (T. KEMP)

Quantum Computing Lecture 2. Review of Linear Algebra

Foundations of Computer Vision

Dimension. Eigenvalue and eigenvector

The Singular Value Decomposition (SVD) and Principal Component Analysis (PCA)

YORK UNIVERSITY. Faculty of Science Department of Mathematics and Statistics MATH M Test #1. July 11, 2013 Solutions

Symmetric and anti symmetric matrices

Problem # Max points possible Actual score Total 120

Linear Algebra - Part II

Review of Linear Algebra

Maths for Signals and Systems Linear Algebra in Engineering

1. Linear systems of equations. Chapters 7-8: Linear Algebra. Solution(s) of a linear system of equations (continued)

MATH 583A REVIEW SESSION #1

Review of some mathematical tools

The Singular Value Decomposition

1. What is the determinant of the following matrix? a 1 a 2 4a 3 2a 2 b 1 b 2 4b 3 2b c 1. = 4, then det

Math 102, Winter Final Exam Review. Chapter 1. Matrices and Gaussian Elimination

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Elementary maths for GMT

1 Linearity and Linear Systems

Glossary of Linear Algebra Terms. Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB

Image Registration Lecture 2: Vectors and Matrices

Linear Algebra & Geometry why is linear algebra useful in computer vision?

Singular Value Decomposition

Cheng Soon Ong & Christian Walder. Canberra February June 2017

Chap 3. Linear Algebra

Linear Algebra Primer

Review of Some Concepts from Linear Algebra: Part 2

(a) If A is a 3 by 4 matrix, what does this tell us about its nullspace? Solution: dim N(A) 1, since rank(a) 3. Ax =

Lecture 02 Linear Algebra Basics

MATH 31 - ADDITIONAL PRACTICE PROBLEMS FOR FINAL

Linear Algebra Massoud Malek

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

AMS526: Numerical Analysis I (Numerical Linear Algebra)

CS 246 Review of Linear Algebra 01/17/19

LINEAR ALGEBRA SUMMARY SHEET.

3 (Maths) Linear Algebra

Lecture 10 - Eigenvalues problem

Math 1553, Introduction to Linear Algebra

Assignment #10: Diagonalization of Symmetric Matrices, Quadratic Forms, Optimization, Singular Value Decomposition. Name:

Eigenvalues and Eigenvectors

1 Last time: least-squares problems

Math Bootcamp An p-dimensional vector is p numbers put together. Written as. x 1 x =. x p

Linear Algebra: Matrix Eigenvalue Problems

Remark By definition, an eigenvector must be a nonzero vector, but eigenvalue could be zero.

Quiz ) Locate your 1 st order neighbors. 1) Simplify. Name Hometown. Name Hometown. Name Hometown.

7. Symmetric Matrices and Quadratic Forms

I. Multiple Choice Questions (Answer any eight)

33AH, WINTER 2018: STUDY GUIDE FOR FINAL EXAM

Linear Algebra (Review) Volker Tresp 2017

Linear Algebra Review. Fei-Fei Li

CAAM 335 Matrix Analysis

Computational Methods CMSC/AMSC/MAPL 460. Eigenvalues and Eigenvectors. Ramani Duraiswami, Dept. of Computer Science

B553 Lecture 5: Matrix Algebra Review

14 Singular Value Decomposition

Econ Slides from Lecture 7

3.3 Eigenvalues and Eigenvectors

Notes on Eigenvalues, Singular Values and QR

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Bastian Steder

Jordan Normal Form and Singular Decomposition

Large Scale Data Analysis Using Deep Learning

Matrix Vector Products

MTH 464: Computational Linear Algebra

Study Guide for Linear Algebra Exam 2

Mathematical foundations - linear algebra

Applied Linear Algebra in Geoscience Using MATLAB

Introduction to Matrix Algebra

YORK UNIVERSITY. Faculty of Science Department of Mathematics and Statistics MATH M Test #2 Solutions

MATH 315 Linear Algebra Homework #1 Assigned: August 20, 2018

Linear Algebra (Review) Volker Tresp 2018

Study Notes on Matrices & Determinants for GATE 2017

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Kai Arras, Maren Bennewitz

2. Linear algebra. matrices and vectors. linear equations. range and nullspace of matrices. function of vectors, gradient and Hessian

15 Singular Value Decomposition

Lecture II: Linear Algebra Revisited

Multivariate Statistical Analysis

22.3. Repeated Eigenvalues and Symmetric Matrices. Introduction. Prerequisites. Learning Outcomes

Lecture Summaries for Linear Algebra M51A

Eigenvalues and Eigenvectors

Matrices and Vectors. Definition of Matrix. An MxN matrix A is a two-dimensional array of numbers A =

Stat 159/259: Linear Algebra Notes

Linear Algebra Exercises

(a) II and III (b) I (c) I and III (d) I and II and III (e) None are true.

LinGloss. A glossary of linear algebra

Matrix Algebra: Summary

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

SUMMARY OF MATH 1600

Announcements Wednesday, November 01

Linear Algebra- Final Exam Review

Mathematical foundations - linear algebra

Applied Mathematics 205. Unit V: Eigenvalue Problems. Lecturer: Dr. David Knezevic

Linear Algebra Review. Fei-Fei Li

Eigenvalues and Eigenvectors. Review: Invertibility. Eigenvalues and Eigenvectors. The Finite Dimensional Case. January 18, 2018

Remark 1 By definition, an eigenvector must be a nonzero vector, but eigenvalue could be zero.

ANALYTICAL MATHEMATICS FOR APPLICATIONS 2018 LECTURE NOTES 3

Notes on singular value decomposition for Math 54. Recall that if A is a symmetric n n matrix, then A has real eigenvalues A = P DP 1 A = P DP T.

Transcription:

Background Mathematics (2/2) 1 David Barber University College London Modified by Samson Cheung (sccheung@ieee.org) 1 These slides accompany the book Bayesian Reasoning and Machine Learning. The book and demos can be downloaded from www.cs.ucl.ac.uk/staff/d.barber/brml. Feedback and corrections are also available on the site. Feel free to adapt these slides for your own purposes, but please include a link the above website.

Matrix inversion For a square matrix A, its inverse satisfies A 1 A = I = AA 1 Provided the inverses exist (AB) 1 = B 1 A 1 It is not always possible to find a matrix A 1 such that A 1 A = I, in which case A singular. Geometrically, singular matrices correspond to degenerate projections: there are null vectors e such that Ae = 0. The collection of null vectors form a subspace called the null space of A. Given a vector y and a singular transformation A, one cannot uniquely identify a vector x for which y = Ax because y = A(x + e) for any null vector e. Pseudo inverse For a m n matrix A with m n such that A T A is invertible, A = ( A T A ) 1 A T satisfies A A = I.

Matrix rank For an m n matrix A with n columns, each written as an m-vector: A = [ a 1,..., a n] the rank of A is the maximum number of linearly independent columns (or equivalently rows). In terms of linear transformation Ax, the rank of A is the dimension of the range space which includes all possible Ax for an arbitrary input x. Full rank An n n square matrix is full rank if the rank is n, in which case the matrix is must be non-singular. Otherwise the matrix is reduced rank and is singular.

Orthogonal matrix A square matrix A is orthogonal if its transpose is its inverse: AA T = I = A T A From the properties of the determinant, we see therefore that an orthogonal matrix has determinant ±1 and hence corresponds to a volume preserving transformation.

Solving Linear Systems Problem Given square N N matrix A and vector b, find the vector x that satisfies Ax = b Solution Algebraically, we have the inverse: x = A 1 b In practice, we solve solve for x numerically using Gaussian Elimination more stable numerically. Complexity Solving a linear system is O ( N 3) can be very expensive for large N. Approximate methods include conjugate gradient and related approaches.

Eigenvalues and eigenvectors For an n n square matrix A, e is an eigenvector of A with eigenvalue λ if Ae = λe For an (n n) dimensional matrix, there are (including repetitions) n eigenvalues, each with a corresponding eigenvector. We can write (A λi) e = 0 }{{} B If B has an inverse, then the only solution is e = B 1 0 = 0, which trivially satisfies the eigen-equation. For any non-trivial solution we therefore need B to be non-invertible. Hence λ is an eigenvalue of A if det (A λi) = 0 It may be that for an eigenvalue λ the eigenvector is not unique and there is a space of corresponding vectors.

Spectral decomposition A real symmetric matrix N N A has an eigen-decomposition n A = λ i e i e T i i=1 where λ i is the eigenvalue of eigenvector e i and the eigenvectors form an orthogonal set, ( e i ) T e j = δ ij ( e i ) T e i In matrix notation A = EΛE T where E is the orthogonal matrix of eigenvectors and Λ the corresponding diagonal eigenvalue matrix. More generally, for a square non-symmetric diagonalisable A we can write A = EΛE 1 Computational Complexity It generally takes O ( N 3) time to compute the eigen-decomposition.

Singular Value Decomposition The SVD decomposition of a n p matrix X is X = USV T where dim U = n n with U T U = I n. Also dim V = p p with V T V = I p. The matrix S has dim S = n p with zeros everywhere except on the diagonal entries. The singular values are the diagonal entries [S] ii and are positive. The singular values are ordered so that the upper left diagonal element of S contains the largest singular value. Computational Complexity ( It generally takes O max (n, p) (min (n, p)) 2) time to compute the SVD-decomposition.

Positive definite matrix A symmetric matrix A with the property that x T Ax 0 for any vector x is called positive semidefinite. A symmetric matrix A, with the property that x T Ax > 0 for any vector x 0 is called positive definite. A positive definite matrix has full rank and is thus invertible. Eigen-decomposition Using the eigen-decomposition of A, x T Ax = i λ i x T e i (e i ) T x = i λ i ( x T e i) 2 which is greater than zero if and only if all the eigenvalues are positive. Hence A is positive definite if and only if all its eigenvalues are positive.

Trace and Det trace (A) = i A ii = i λ i where λ i are the eigenvalues of A. n det (A) = i=1 λ i Trace-Log formula For a positive definite matrix A, trace (log A) log det (A) The above logarithm of a matrix is not the element-wise logarithm but defined through its power series: 1 log A = (A I)n n n=0 On the right, since det (A) is a scalar, the logarithm is the standard logarithm of a scalar.

Numerical issues: rounding error Often in machine learning we have a large number of terms to sum, for example when computing the log likelihood for a large number of datapoints. It s good to be aware of potential numerical limitations and ways to improve accuracy, should this be a problem. Double floats have a relative error of around 1 10 16. Operations that are mathematical identities may not remain so. For example [A] ij = n x n i x n j should give rise to a symmetric matrix. However, this symmetry can be lost due to roundoff. In general, it s worth checking key points in your code for such issues.

logsumexp It s common in ML to come across expressions such as S = exp(a) + exp(b) for large (in absolute value) a or b. If a = 1000, Matlab will return (0 for a = 1000). It s not sufficient to simply compute the log: log S = log (exp(a) + exp(b)) since this requires the exponentiation still of each term. Let m = max (a, b). log S = m + log (exp(a m) + exp(b m)) Let s say that m = a, then log S = a + log (1 + exp(b a)) Since a > b then exp(b a) < 1 and log (1 + exp(b a)) < log 2. We can compute log S more accurately this way. More generally, we define the logsumexp function logsumexp(x) = m+ ( N ) log exp(x i m), m = max (x 1,..., x N ) i i=1