. a m1 a mn. a 1 a 2 a = a n

Similar documents
Phys 201. Matrices and Determinants

Matrices: 2.1 Operations with Matrices

Introduction. Vectors and Matrices. Vectors [1] Vectors [2]

CS100: DISCRETE STRUCTURES. Lecture 3 Matrices Ch 3 Pages:

Knowledge Discovery and Data Mining 1 (VO) ( )

Elementary Row Operations on Matrices

Chapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

Matrix representation of a linear map

ICS 6N Computational Linear Algebra Matrix Algebra

Kevin James. MTHSC 3110 Section 2.1 Matrix Operations

Mathematics 13: Lecture 10

Lecture 6: Geometry of OLS Estimation of Linear Regession

Matrices and Linear Algebra

Matrices BUSINESS MATHEMATICS

Matrix Multiplication

Matrices. Chapter Definitions and Notations

Section 9.2: Matrices.. a m1 a m2 a mn

1 Matrices and matrix algebra

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Linear Algebra V = T = ( 4 3 ).

Review of Linear Algebra

MATRICES. a m,1 a m,n A =

Matrix Algebra Determinant, Inverse matrix. Matrices. A. Fabretti. Mathematics 2 A.Y. 2015/2016. A. Fabretti Matrices

CLASS 12 ALGEBRA OF MATRICES

Matrices. Math 240 Calculus III. Wednesday, July 10, Summer 2013, Session II. Matrices. Math 240. Definitions and Notation.

Linear Algebra Review

Matrix Arithmetic. j=1

MATRICES AND MATRIX OPERATIONS

Bare minimum on matrix algebra. Psychology 588: Covariance structure and factor models

CS 246 Review of Linear Algebra 01/17/19

Elementary maths for GMT

2. Matrix Algebra and Random Vectors

Linear Algebra review Powers of a diagonalizable matrix Spectral decomposition

Matrix representation of a linear map

Math 360 Linear Algebra Fall Class Notes. a a a a a a. a a a

Matrix operations Linear Algebra with Computer Science Application

10. Linear Systems of ODEs, Matrix multiplication, superposition principle (parts of sections )

Linear Algebra and Matrix Inversion

Chapter 5 Matrix Approach to Simple Linear Regression

Matrices and vectors A matrix is a rectangular array of numbers. Here s an example: A =

Matrix Operations. Linear Combination Vector Algebra Angle Between Vectors Projections and Reflections Equality of matrices, Augmented Matrix

* is a row matrix * An mxn matrix is a square matrix if and only if m=n * A= is a diagonal matrix if = 0 i

Chapter 2. Ma 322 Fall Ma 322. Sept 23-27

Matrix Algebra: Definitions and Basic Operations

INSTITIÚID TEICNEOLAÍOCHTA CHEATHARLACH INSTITUTE OF TECHNOLOGY CARLOW MATRICES

Linear Algebra. Matrices Operations. Consider, for example, a system of equations such as x + 2y z + 4w = 0, 3x 4y + 2z 6w = 0, x 3y 2z + w = 0.

[ Here 21 is the dot product of (3, 1, 2, 5) with (2, 3, 1, 2), and 31 is the dot product of

MATH2210 Notebook 2 Spring 2018

Section 9.2: Matrices. Definition: A matrix A consists of a rectangular array of numbers, or elements, arranged in m rows and n columns.

Lecture Notes in Linear Algebra

Chapter 2 Notes, Linear Algebra 5e Lay

Math 4377/6308 Advanced Linear Algebra

Foundations of Cryptography

Lecture 1 Review: Linear models have the form (in matrix notation) Y = Xβ + ε,

Lecture 3: Matrix and Matrix Operations

Matrix Algebra 2.1 MATRIX OPERATIONS Pearson Education, Inc.

Matrix & Linear Algebra

Introduction to Matrix Algebra

Section 12.4 Algebra of Matrices

A FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic

Raphael Mrode. Training in quantitative genetics and genomics 30 May 10 June 2016 ILRI, Nairobi. Partner Logo. Partner Logo

Basic Concepts in Matrix Algebra

Lecture 3 Linear Algebra Background

10: Representation of point group part-1 matrix algebra CHEMISTRY. PAPER No.13 Applications of group Theory

Linear Algebra (Review) Volker Tresp 2018

MAC Module 2 Systems of Linear Equations and Matrices II. Learning Objectives. Upon completing this module, you should be able to :

Chapter 4 - MATRIX ALGEBRA. ... a 2j... a 2n. a i1 a i2... a ij... a in

Two matrices of the same size are added by adding their corresponding entries =.

Materials engineering Collage \\ Ceramic & construction materials department Numerical Analysis \\Third stage by \\ Dalya Hekmat

Matrix Algebra. Learning Objectives. Size of Matrix

Linear Systems and Matrices

Fall Inverse of a matrix. Institute: UC San Diego. Authors: Alexander Knop

Numerical Analysis Lecture Notes

MATRICES The numbers or letters in any given matrix are called its entries or elements

Matrices. 1 a a2 1 b b 2 1 c c π

Prepared by: M. S. KumarSwamy, TGT(Maths) Page

Vectors and matrices: matrices (Version 2) This is a very brief summary of my lecture notes.

Announcements Wednesday, October 10

Announcements Monday, October 02

A matrix over a field F is a rectangular array of elements from F. The symbol

Exercise Set Suppose that A, B, C, D, and E are matrices with the following sizes: A B C D E

DM559 Linear and Integer Programming. Lecture 3 Matrix Operations. Marco Chiarandini

1 Multiply Eq. E i by λ 0: (λe i ) (E i ) 2 Multiply Eq. E j by λ and add to Eq. E i : (E i + λe j ) (E i )

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

MATH.2720 Introduction to Programming with MATLAB Vector and Matrix Algebra

Quick Tour of Linear Algebra and Graph Theory

Quantum Computing Lecture 2. Review of Linear Algebra

MA 138 Calculus 2 with Life Science Applications Matrices (Section 9.2)

Matrices and systems of linear equations

Graphics (INFOGR), , Block IV, lecture 8 Deb Panja. Today: Matrices. Welcome

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

Review of linear algebra

MATH 106 LINEAR ALGEBRA LECTURE NOTES

Finite Mathematics Chapter 2. where a, b, c, d, h, and k are real numbers and neither a and b nor c and d are both zero.

Instruction: Operations with Matrices ( ) ( ) log 8 log 25 = If the corresponding elements do not equal, then the matrices are not equal.

Chapter 1 Matrices and Systems of Equations

MA 575 Linear Models: Cedric E. Ginestet, Boston University Revision: Probability and Linear Algebra Week 1, Lecture 2

1 Matrices and Systems of Linear Equations. a 1n a 2n

Quick Tour of Linear Algebra and Graph Theory

Transcription:

Biostat 140655, 2008: Matrix Algebra Review 1 Definition: An m n matrix, A m n, is a rectangular array of real numbers with m rows and n columns Element in the i th row and the j th column is denoted by a ij a 11 a 12 a 1n a 21 a 21 a 2n A m n = a m1 a mn m n Definition: A vector a of length n is an n 1 matrix with each element denoted by a i The i th element is called the i th component of the vector and n is the dimensionality Matrix Operations a 1 a 2 a = a n 1 Two matrices A and B of the same dimensions can be added The sum A + B has (i, j) entry a ij + b ij So a11 a 12 b11 b + 12 a11 + b = 11 a 12 + b 12 a 21 a 22 b 21 b 22 a 21 + b 21 a 22 + b 22 1 3 3 2 4 5 Example : 2 6 B = 9 5 A + B = 11 11 1 3 3 0 2 3 A + B = B + A (A + B) + C = A + (B + C) 2 A matrix may also be multiplied by a constant c The product ca is the matrix that results from multiplying each element of A by c Thus ca 11 ca 12 ca 1n ca 21 ca 21 ca 2n ca m n = ca m1 ca mn m n

Biostat 140655, 2008: Matrix Algebra Review 2 3 The transpose operation A T or A of a matrix changes the columns into rows so that the first column of A becomes the first row of A T, the second column becomes second row, and etc So the (i,j) th element in A m n becomes the (j,i) th in the transpose A T n m (A T ) T = A (A + B ) T = A T + B T (A B ) T = B T A T (c A ) T = c A T 1 2 3 4 5 6 2 3 1 4 A T = 2 5 3 6 4 We can define matrix multiplication A B if the number of elements in a row of A is the same as the number of elements in the columns of B Eg when A is (p k) and B is (k n) An element of the new matrix AB is formed by taking the inner product of each row of A with each column of B The matrix product AB is A m n B n m = C m n with c ij = 3 2 n a ik + b kj a11 a 12 b11 b 12 a11 b = 11 + a 12 b 21 a 11 b 12 + a 12 b 22 a 21 a 22 b 21 b 22 a 21 b 11 + a 22 b 21 a 21 b 12 + a 22 b 22 (AB)C = A(BC) A(B+C) = AB+AC (A+B)C = AC+BC k=1 1 4 1 2 3 A T = 2 5 4 5 6 2 3 3 6 3 2 1(1) + 2(2) + 3(3) 1(4) + 2(5) + 3(6) A A T = 4(1) + 5(2) + 6(3) 4(4) + 5(5) + 6(6) AB does not generally equal to BA! Special Square Matrix 1 A square matrix A is said to be symmetric if A T or a ij = a ji for all i and j 3 5 3 5 is symmetric; is not symmetric 5 2 6 2

Biostat 140655, 2008: Matrix Algebra Review 3 2 Diagonal Matrix: A n n = diag(a 1,, a n ) = a 1 0 0 0 a 2 0 0 0 0 a n 3 Identity Matrix: I n n = diag(1 n ) = 1 0 0 0 1 0 0 0 0 1 The identity matrix is a square matrix with ones on the diagonal and zeros elsewhere It follows from the definition of matrix multiplication that the (i, j) enrty of AI is a i1 0 + + a i,j1 0 + a ij 1 + a i,j+1 0 + + a ik 0 = a ij So AI = A Similarly, I A Therefore matrix I acts like 1 in ordinary multiplication The fundamental scalar relation about the existence of an inverse number a 1 such that a 1 a = a a 1 = 1, if a 0, has the following matrix algebra extension B k k A k k = A k k B k k = I k k then B is called the inverse of A and is denoted by A 1 Other Matrix Properties 1 Trace: The sum of the diagonal elements, tr(a n n ) = n i=1 a ii 2 A square matrix that does not have a matrix inverse is called a singular matrix The inverse of a 2 2 matrix is given by a b A = A 1 1 d b = c d ad bc c a 3 A matrix is singular if and only if its determinant is 0 The determinant of a matrix A is denoted as A The determinant of a 2 2 matrix is given by a b A =, det(a) = ad bc c d

Biostat 140655, 2008: Matrix Algebra Review 4 Examples 1: Simultaneous equations 5x + 3y + z = 1 2x + 3y + 5z = 2 x + 9y + 6z = 3 We can rewrite the above three equations as a single matrix equation: 5 3 1 x 1 2 3 5 y = 2 1 9 6 z 3 Example 2: Variance/Covariance Matrix For a vector of random variables, (Y 1, Y 2,, Y n ), we can write a matrix containing their variances and their covariances Let σ 2 i be the variance of Y i and let cov ij be the covariance between Y i and Y j, i < j Then the variance/covariance matrix for (Y 1, Y 2,, Y n ) is σ1 2 cov 12 cov 1n cov 12 σ2 2 cov 2n cov 1n cov 2n σn 2 Also note that the above can be written as σ 1 0 0 1 ρ 12 ρ 1n σ 1 0 0 0 σ 2 0 ρ 12 1 ρ 2n 0 σ 2 0 0 0 σ n ρ 1n ρ 2n 1 0 0 σ n where ρ ij is the correlation of Y i and Y j Note that all of these matrices are symmetric Furthermore, the terms on the diagonal of the variance/covariance matrix must be positive and terms off the diagonal of the correlation matrix are bounded by -1 and 1 Example 3: Multiple Linear Regression We have a response Y and a set of p independnet variables X 1, X 2,, X p Assume we have n observations and for each i = 1,, n observation, we assume where ε i Normal (0, σ 2 ) Y i = β 0 + β 1 x i,1 + + β p x i,p + ε i

Biostat 140655, 2008: Matrix Algebra Review 5 We can represent n observations simultaneously in matrix form as Y = X n p+1 β p+1 1 + ε y 1 1 x 11 x 12 x 1p β 0 ε 1 y 2 Y = X = 1 x 21 x 22 x 2p β = β 1 ε = ε 2 y n 1 x n1 x n2 x np β p ε n The residual Y i (β 0 + β 1 x i,1 + + β p x i,p ) can be written as y 1 (β 0 + β 1 x 1,1 + β 2 x 1,2 + + β p x 1,p ) ( ) y 2 (β 0 + β 1 x 2,1 + β 2 x 2,2 + + β p x 2,p ) Y Xβ = y n (β 0 + β 1 x n,1 + β 2 x n,2 + + β p x n,p ) The residual sum of squares (RSS) is y 1 β 0 β 1 x 1,1 β 2 x 1,2 β p x 1,p ( ) T ( ) y 2 β 0 β 1 x 2,1 β 2 x 2,2 β p x 2,p Y Xβ Y Xβ = y n β 0 β 1 x n,1 β 2 x n,2 β p x n,p y 1 β 0 β 1 x 1,1 β 2 x 1,2 β p x 1,p y 2 β 0 β 1 x 2,1 β 2 x 2,2 β p x 2,p y n β 0 β 1 x n,1 β 2 x n,2 β p x n,p n = (Y i β 0 β 1 x i,1 β p x i,p ) 2 i=1 Minimizing the above RSS gives the usual least-squared estimate for β ˆβ OLS = argmin β (Y Xβ ) T ( ) Y Xβ = (X T X) 1 X T Y T