5. Matrix Algebra A Prelude to Multiple Regression

Size: px
Start display at page:

Download "5. Matrix Algebra A Prelude to Multiple Regression"

Transcription

1 5 Matrix Algebra A Prelude to Multiple Regression Matrices are arrays of numbers and are denoted by boldface (capital) symbols Example: a 2 2 matrix (always #rows #columns) A = Example: a 4 2 matrix B, and a 2 3 matrix C B = , C =

2 In general, an r c matrix is given by A r c = a 11 a 12 a 1j a 1c a 21 a 22 a 2j a 2c a i1 a i2 a ij a ic a r1 a r2 a rj a rc or in abbreviated form A r c = a ij, i = 1, 2,, r, j = 1, 2,, c 1st subscript gives row#, 2nd subscript gives column# Where is a 79 or a 44? 2

3 A matrix A is called square, if it has the same # of rows and columns (r = c) Example: A 2 2 = Matrices having either 1 row (r = 1) or 1 column (c = 1) are called vectors Example: column vector A (c = 1) and row vector C (r = 1) A = , C = c 1 c 2 c 3 c 4 Row vectors always have the prime! 3

4 Transpose: A is the transpose of A where A = , A = A is obtained by interchanging columns & rows of A a ij is the typical element of A a ij is the typical element of A a ij = a ji (a 12 = a 21) 4

5 Equality of Matrices: Two matrices A and B are said to be equal if they are of the same dimension and all corresponding elements are equal A r c = B r c means a ij = b ij, i = 1,, r, j = 1,, c Addition and Subtraction: To add or subtract matrices they must be of the same dimension The result is another matrix of this dimension If A 3 2 = , B 3 2 = , then its sum and its difference is calculated elementwise C = A + B = =

6 D = A B = =

7 Regression Analysis Remember, we had (X 1, Y 1 ), (X 2, Y 2 ),, (X n, Y n ) and wrote the SLR as Y i = E(Y i ) + ɛ i, i = 1, 2,, n Now we are able to write the above model as Y n 1 = E(Y n 1 ) + ɛ n 1 with the n 1 column vectors Y = Y 1 Y 2 Y n, E(Y) = E(Y 1 ) E(Y 2 ) E(Y n ), ɛ = ɛ 1 ɛ 2 ɛ n 7

8 Matrix Multiplication: (1) by a scalar, which is a (1 1) matrix Let A = If the scalar is 3, then 3 A = A + A + A or 3 A = =

9 Generally, if λ denotes the scalar, we get λ A = 5λ 3λ λ 2λ 4λ 7λ = A λ We can also factor out a common factor, eg = (2) by a matrix: we write the product of two matrices A and B as AB For AB to exist, the #col s of A must be the same as the #rows of B A 3 2 = , B 2 3 =

10 Let C = AB You get c ij by taking the inner product of the ith row of A and the jth column of B, that is c ij = #col s in A k=1 a ik b kj Since i = 1,, #rows in A, j = 1,, #col s in B the resulting matrix C has dimension: (#rows in A) (#col s in B) For C to exist, (#col s in A)=(#rows in B) 10

11 Hence, for A 3 2 B 2 3 we get the 3 3 matrix C = ( 1) ( 1) ( 1) = Note, this is different to D 2 2 = B 2 3 A 3 2 which gives the 2 2 matrix D = = For AB we say, B is premultiplied by A or A is postmultiplied by B 11

12 Regression Analysis Remember our SLR with all means on the straight line E(Y i ) = β 0 + β 1 X i, i = 1, 2,, n With we get X n 2 = E(Y) = Xβ = Thus we rewrite the SLR as 1 X 1 1 X 2 1 X n 1 X 1 1 X 2 1 X n, β 2 1 = β0 β 1 Y = Xβ + ɛ = β0 β 1 β 0 + β 1 X 1 β 0 + β 1 X 2 β 0 + β 1 X n 12

13 Important Matrices in Regression: Y Y = Y 1 Y 2 Y n X X = X Y = Y 1 Y 2 Y n X 1 X 2 X n X 1 X 2 X n = 1 X 1 1 X 2 1 X n Y 1 Y 2 Y n n i=1 Y 2 i = n i X i = i Y i i X iy i i X i i X2 i 13

14 Special Types of Matrices: Symmetric Matrix, if A = A, A is said to be symmetric, eg A = , A = A symmetric matrix necessarily is square! Any product like Z Z is symmetric 14

15 Diagonal Matrix is a square matrix whose off-diagonal elements are all zeros A = , B = b b b b 44 Identity Matrix I is a diagonal matrix whose elements are all 1s, eg B above with b ii = 1, i = 1, 2, 3, 4 Pre- and postmultiplying by I does not change a matrix, A = IA = AI 15

16 Vector and matrix with all elements Unity A column vector with all elements 1 is denoted by 1, a square matrix with all elements 1 is denoted by J, 1 = 1 1, J = Note that for an n 1 vector 1 we obtain 1 1 = = n 16

17 and 11 = = = J n n Zero vector A column vector with all elements 0 0 =

18 Linear Dependence and Rank of Matrix Consider the following matrix A = Think of A as being made up of 4 column vectors A =

19 Notice that the third column is 5 times the first = We say the columns of A are linearly dependent (or A is singular) When no such relationships exist, A s columns are said to be linearly independent The rank of a matrix is the number of linearly independent columns (in the example, its rank is 3) 19

20 Inverse of a Matrix Q: What s the inverse of a number (6)? A: Its reciprocal (1/6)! A number multiplied by its inverse always equals 1 Generally, for the inverse 1/x of a scalar x x 1 x = 1 x x = x 1 x = xx 1 = 1 In matrix algebra, the inverse of A is the matrix A 1, for which A 1 A = AA 1 = I In order for A to have an inverse: A must be square, col s of A must be linearly independent 20

21 Example: Inverse of a matrix A 2 2 = , A = AA 1 = = A 1 A = =

22 Example: Inverse of a diagonal matrix D = d d d 3, D 1 = 1/d /d /d 3 eg, D = DD 1 = , D 1 = 1/ /4 1/ /4 =

23 Finding the Inverse: The 2 2 case A = a b c d, A 1 = 1 D d c b a where D = ad bc denotes the determinant of A If A is singular then D = 0 and no inverse would exist AA 1 a b 1 d b = c d D c a = 1 ad bc ab + ba D cd dc cb + da 1 0 = = I 0 1 = 1 D D 0 0 D 23

24 Example: A = Determinant D = ad bc = = 10 A 1 = =

25 Regression Analysis Principal inverse matrix in regression is the inverse of X X = n i X i i X i i X2 i = a b c d Its determinant is D = n ( ) ( ) 2 Xi 2 X i = n Xi 2 1 ( ) 2 nx n i i i ( ) ( ) = n Xi 2 nx 2 = n (X i X) 2 = ns XX 0 i 25 i

26 Thus (X X) 1 = 1 ns XX i X2 i i X i i X i n = 1 S XX 1 n i X2 i X X 1 Uses of Inverse Matrix In ordinary algebra, we solve an equation of the type 5y = 20 by multiplying both sides by the inverse of 5 and obtain y = (5y) =

27 System of equations: 2y 1 + 4y 2 = 20 3y 1 + y 2 = 10 With matrix algebra we rewrite this system as y1 y 2 = Thus, we have to solve AY = C Premultiplying with the inverse A 1 gives A 1 AY = A 1 C Y = A 1 C 27

28 The solution of these equations then is y1 y 2 = = =

29 Some Basic Matrix Facts 1 (AB)C = A(BC) 2 C(A + B) = CA + CB 3 (A ) = A 4 (A + B) = A + B 5 (AB) = B A 6 (AB) 1 = B 1 A 1 7 (A 1 ) 1 = A 8 (A ) 1 = (A 1 ) 9 (ABC) = C B A 29

30 Random Vectors and Matrices A random vector is a vector of random variables, eg Y = Y 1, Y 2,, Y n The expected value of Y is the vector E(Y) = E(Y 1 ), E(Y 2 ),, E(Y n ) Regression Example: ɛ = ɛ 1 ɛ 2 ɛ n ; E(ɛ) = E(ɛ 1 ) E(ɛ 2 ) E(ɛ n ) = 0 n 1 30

31 The usual rules for expectation still work: Suppose V and W are random vectors and A, B, and C are matrices of constants Then E(AV + BW + C) = AE(V) + BE(W) + C Regression Example: Find E(Y) = E(Xβ + ɛ) E(Xβ + ɛ) = E(Xβ) + E(ɛ) = Xβ + 0 = Xβ 31

32 Variance-Covariance Matrix of a Random Vector For a random vector Z n 1 define var(z) = var(z 1 ) cov(z 1, Z 2 ) cov(z 1, Z n ) cov(z 2, Z 1 ) var(z 2 ) cov(z 2, Z n ) cov(z n, Z 1 ) cov(z n, Z 2 ) var(z n ) where cov(z i, Z j ) = E (Z i E(Z i ))(Z j E(Z j )) (n n) matrix If Z i and Z j are independent, then cov(z i, Z j ) = 0 = cov(z j, Z i ) It is a symmetric 32

33 Regression Example: because we assumed n independent random errors ɛ i, each with the same variance σ 2, we have var(ɛ) = σ σ σ 2 = σ2 I n n 33

34 Rules for a Variance-Covariance Matrix Remember: if V is a rv and a, b are constant terms, then var(av + b) = var(av ) = a 2 var(v ) Suppose now that V is a random vector and A, B are matrices of constants Then var(av + B) = var(av) = Avar(V)A Regression Analysis: Find var(y) = var(xβ + ɛ) var(xβ + ɛ) = var(ɛ) = σ 2 I n n Off-diagonal elements are zero because the ɛ i s, and hence the Y i s, are independent 34

35 SLR in Matrix Terms Now we can write the SLR in matrix terms compactly as and we assume that ɛ N(0, σ 2 I) β and σ 2 are unknown parameters X is a constant matrix Y = Xβ + ɛ Consequences: E(Y) = Xβ and var(y) = σ 2 I In the next step we define the Least Squares (LS) estimators (b 0, b 1 ) using matrix notation 35

36 Normal Equations: Remember the LS criterion Q = n (Y i (β 0 + β 1 X i )) 2 = (Y Xβ) (Y Xβ) i=1 Recall that when we take derivatives of Q wrt β 0 and β 1 and set the resulting equations equal to zero, we get the normal equations nb 0 + nxb 1 = ny nxb 0 + i X 2 i b 1 = i X i Y i Let s write these equations in matrix form n nx nx i X2 i b0 b 1 = ny i X iy i 36

37 But with b 2 1 = (b 0 b 1 ), this is exactly equivalent to (X X)b = (X Y) Premultiplying with the inverse (X X) 1 gives (X X) 1 (X X)b = (X X) 1 (X Y) b = (X X) 1 X Y 37

38 Fitted Values and Residuals Remember Ŷi = b 0 + b 1 X i Because Ŷ 1 Ŷ n = 1 X 1 1 X n b0 b 1 = b 0 + b 1 X 1 b 0 + b 1 X n we write the vector of fitted values as Ŷ = Xb With b = (X X) 1 X Y we get Ŷ = Xb = X(X X) 1 X Y 38

39 We can express this by using the (n n) Hat Matrix H = X(X X) 1 X (it puts the hat on Y) as Ŷ = HY H is symmetric (H = H ) & idempotent (HH = H) Symmetric: ( H = X(X X) 1 X ) ( 9 = X (X X) 1) X ( 8 = X (X X) ) 1 ( X 5 1X = X X X) = H 39

40 Idempotent: because (X X) 1 X X = I we have HH = (X(X X) 1 X )( X(X X) 1 X ) = XI(X X) 1 X = H With these results we get (HX = X) (HIH = H) E(Ŷ) = E(HY) = HXβ = Xβ var(ŷ) = var(hy) = H σ2 I H = σ 2 H Residuals: e = Y Ŷ = IY HY = (I H)Y Like H, also I H is symmetric and idempotent E(e) = (I H)E(Y) = 0 var(e) = var((i H)Y) = σ 2 (I H) 40

41 Inferences in Regression Analysis Distribution of LS Estimates b = (X X) 1 X Y = CY = c11 c 1n Y 1 c 21 c 2n Y n with C = (X X) 1 X a 2 n matrix of constants Thus, each element of b is a linear combination of independent normals, Y i s, and therefore a normal rv ( ) E(b) = E (X X) 1 X Y = (X X) 1 X E(Y) = (X X) 1 X Xβ = Iβ = β 41

42 ( ) var(b) = var (X X) 1 X Y = (X X) 1 X var(y) ((X X) 1 X ) = (X X) 1 X σ 2 I X(X X) 1 = σ 2 (X X) 1 X X(X X) 1 = σ 2 I(X X) 1 = σ 2 (X X) 1 With the previous result we have var(b) = σ 2 (X X) 1 = σ2 S XX 1 n i X2 i X X 1 Its estimator is var(b) = MSE S XX 1 n i X2 i X X 1 42

43 As covariance/correlation between b 0 and b 1 we get cov(b 0, b 1 ) = σ2 S XX X cor(b 0, b 1 ) = cov(b 0, b 1 ) var(b0 )var(b 1 ) = 1 n X i X2 i b 0, b 1 are not independent! Together we have b N (β, σ 2 (X X) 1) This is used to construct CI s and tests regarding β as before 43

44 Estimate the Mean of the Response at X h Recall our estimate for E(Y h ) = β 0 + β 1 X h is Ŷ h = b 0 + b 1 X h = X hb, where X h = (1, X h) The fitted value is a normal rv with mean and variance E(Ŷh) = E(X hb) = X he(b) = X hβ var(ŷh) = var(x hb) = X hvar(b)x h = X hσ 2 (X X) 1 X h = σ 2 X h(x X) 1 X h Thus, Ŷ h X h β σ2 X h (X X) 1 X h N(0, 1) Ŷ h X h β MSE X h (X X) 1 X h t(n 2) 44

45 What is X h (X X) 1 X h? = X n i X2 i X 1 h S XX X 1 Xh 1 = 1 S n i X2 i XX 1 h X + X h XX X h ( ) 1 1 = Xi 2 XX h XX h + Xh 2 S XX n i ( 1 1 ( = S XX + nx 2) ) 2XX h + Xh 2 n S XX = 1 n + 1 S XX (X h X) 2 by applying S XX = i X2 i nx2 45

46 Matrix Algebra with R: Whiskey Example > one <- rep(1,10); age <- c(0,5,1,2,3,4,5,6,7,8) > y <- c(1046, 1041, 1044, 1050, 1060, , 1077, 1087, 1106, 1121) > X <- matrix(c(one, age), ncol=2) > XtX <- t(x) %*% X; XtX,1,2 1, , > solve(xtx),1,2 1, , > b <- solve(xtx) %*% t(x)%*%y; b,1 1, , > H <- X %*% solve(xtx) %*% t(x) 46

47 > e <- y - H %*% y; SSE <- t(e) %*% e; SSE,1 1, > asnumeric(sse/8) * solve(xtx),1,2 1, , > summary(lm(y ~ age)) Coefficients: Estimate StdError t value Pr(> t ) (Intercept) < 2e-16 *** age e-06 *** 47

1 Introduction to Matrices

1 Introduction to Matrices 1 Introduction to Matrices In this section, important definitions and results from matrix algebra that are useful in regression analysis are introduced. While all statements below regarding the columns

More information

Lecture 2 Matrix Operations

Lecture 2 Matrix Operations Lecture 2 Matrix Operations transpose, sum & difference, scalar multiplication matrix multiplication, matrix-vector product matrix inverse 2 1 Matrix transpose transpose of m n matrix A, denoted A T or

More information

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS 1. SYSTEMS OF EQUATIONS AND MATRICES 1.1. Representation of a linear system. The general system of m equations in n unknowns can be written a 11 x 1 + a 12 x 2 +

More information

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS Systems of Equations and Matrices Representation of a linear system The general system of m equations in n unknowns can be written a x + a 2 x 2 + + a n x n b a

More information

Introduction to Matrix Algebra

Introduction to Matrix Algebra Psychology 7291: Multivariate Statistics (Carey) 8/27/98 Matrix Algebra - 1 Introduction to Matrix Algebra Definitions: A matrix is a collection of numbers ordered by rows and columns. It is customary

More information

3.1 Least squares in matrix form

3.1 Least squares in matrix form 118 3 Multiple Regression 3.1 Least squares in matrix form E Uses Appendix A.2 A.4, A.6, A.7. 3.1.1 Introduction More than one explanatory variable In the foregoing chapter we considered the simple regression

More information

13 MATH FACTS 101. 2 a = 1. 7. The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions.

13 MATH FACTS 101. 2 a = 1. 7. The elements of a vector have a graphical interpretation, which is particularly easy to see in two or three dimensions. 3 MATH FACTS 0 3 MATH FACTS 3. Vectors 3.. Definition We use the overhead arrow to denote a column vector, i.e., a linear segment with a direction. For example, in three-space, we write a vector in terms

More information

15.062 Data Mining: Algorithms and Applications Matrix Math Review

15.062 Data Mining: Algorithms and Applications Matrix Math Review .6 Data Mining: Algorithms and Applications Matrix Math Review The purpose of this document is to give a brief review of selected linear algebra concepts that will be useful for the course and to develop

More information

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2. Chapter 1 LINEAR EQUATIONS 1.1 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,..., a n, b are given

More information

Eigenvalues, Eigenvectors, Matrix Factoring, and Principal Components

Eigenvalues, Eigenvectors, Matrix Factoring, and Principal Components Eigenvalues, Eigenvectors, Matrix Factoring, and Principal Components The eigenvalues and eigenvectors of a square matrix play a key role in some important operations in statistics. In particular, they

More information

Quadratic forms Cochran s theorem, degrees of freedom, and all that

Quadratic forms Cochran s theorem, degrees of freedom, and all that Quadratic forms Cochran s theorem, degrees of freedom, and all that Dr. Frank Wood Frank Wood, fwood@stat.columbia.edu Linear Regression Models Lecture 1, Slide 1 Why We Care Cochran s theorem tells us

More information

Linear Algebra Notes for Marsden and Tromba Vector Calculus

Linear Algebra Notes for Marsden and Tromba Vector Calculus Linear Algebra Notes for Marsden and Tromba Vector Calculus n-dimensional Euclidean Space and Matrices Definition of n space As was learned in Math b, a point in Euclidean three space can be thought of

More information

Notes on Applied Linear Regression

Notes on Applied Linear Regression Notes on Applied Linear Regression Jamie DeCoster Department of Social Psychology Free University Amsterdam Van der Boechorststraat 1 1081 BT Amsterdam The Netherlands phone: +31 (0)20 444-8935 email:

More information

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison

SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89. by Joseph Collison SYSTEMS OF EQUATIONS AND MATRICES WITH THE TI-89 by Joseph Collison Copyright 2000 by Joseph Collison All rights reserved Reproduction or translation of any part of this work beyond that permitted by Sections

More information

Solution to Homework 2

Solution to Homework 2 Solution to Homework 2 Olena Bormashenko September 23, 2011 Section 1.4: 1(a)(b)(i)(k), 4, 5, 14; Section 1.5: 1(a)(b)(c)(d)(e)(n), 2(a)(c), 13, 16, 17, 18, 27 Section 1.4 1. Compute the following, if

More information

MAT188H1S Lec0101 Burbulla

MAT188H1S Lec0101 Burbulla Winter 206 Linear Transformations A linear transformation T : R m R n is a function that takes vectors in R m to vectors in R n such that and T (u + v) T (u) + T (v) T (k v) k T (v), for all vectors u

More information

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws. Matrix Algebra A. Doerr Before reading the text or the following notes glance at the following list of basic matrix algebra laws. Some Basic Matrix Laws Assume the orders of the matrices are such that

More information

Introduction to Matrices for Engineers

Introduction to Matrices for Engineers Introduction to Matrices for Engineers C.T.J. Dodson, School of Mathematics, Manchester Universit 1 What is a Matrix? A matrix is a rectangular arra of elements, usuall numbers, e.g. 1 0-8 4 0-1 1 0 11

More information

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS

December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B. KITCHENS December 4, 2013 MATH 171 BASIC LINEAR ALGEBRA B KITCHENS The equation 1 Lines in two-dimensional space (1) 2x y = 3 describes a line in two-dimensional space The coefficients of x and y in the equation

More information

Introduction to General and Generalized Linear Models

Introduction to General and Generalized Linear Models Introduction to General and Generalized Linear Models General Linear Models - part I Henrik Madsen Poul Thyregod Informatics and Mathematical Modelling Technical University of Denmark DK-2800 Kgs. Lyngby

More information

Matrix Differentiation

Matrix Differentiation 1 Introduction Matrix Differentiation ( and some other stuff ) Randal J. Barnes Department of Civil Engineering, University of Minnesota Minneapolis, Minnesota, USA Throughout this presentation I have

More information

Linear Algebra Review. Vectors

Linear Algebra Review. Vectors Linear Algebra Review By Tim K. Marks UCSD Borrows heavily from: Jana Kosecka kosecka@cs.gmu.edu http://cs.gmu.edu/~kosecka/cs682.html Virginia de Sa Cogsci 8F Linear Algebra review UCSD Vectors The length

More information

Chapter 7. Matrices. Definition. An m n matrix is an array of numbers set out in m rows and n columns. Examples. ( 1 1 5 2 0 6

Chapter 7. Matrices. Definition. An m n matrix is an array of numbers set out in m rows and n columns. Examples. ( 1 1 5 2 0 6 Chapter 7 Matrices Definition An m n matrix is an array of numbers set out in m rows and n columns Examples (i ( 1 1 5 2 0 6 has 2 rows and 3 columns and so it is a 2 3 matrix (ii 1 0 7 1 2 3 3 1 is a

More information

Using row reduction to calculate the inverse and the determinant of a square matrix

Using row reduction to calculate the inverse and the determinant of a square matrix Using row reduction to calculate the inverse and the determinant of a square matrix Notes for MATH 0290 Honors by Prof. Anna Vainchtein 1 Inverse of a square matrix An n n square matrix A is called invertible

More information

Introduction to Matrix Algebra

Introduction to Matrix Algebra 4 Introduction to Matrix Algebra In the previous chapter, we learned the algebraic results that form the foundation for the study of factor analysis and structural equation modeling. These results, powerful

More information

Topic 3. Chapter 5: Linear Regression in Matrix Form

Topic 3. Chapter 5: Linear Regression in Matrix Form Topic Overview Statistics 512: Applied Linear Models Topic 3 This topic will cover thinking in terms of matrices regression on multiple predictor variables case study: CS majors Text Example (NKNW 241)

More information

Systems of Linear Equations

Systems of Linear Equations Systems of Linear Equations Beifang Chen Systems of linear equations Linear systems A linear equation in variables x, x,, x n is an equation of the form a x + a x + + a n x n = b, where a, a,, a n and

More information

NOTES ON LINEAR TRANSFORMATIONS

NOTES ON LINEAR TRANSFORMATIONS NOTES ON LINEAR TRANSFORMATIONS Definition 1. Let V and W be vector spaces. A function T : V W is a linear transformation from V to W if the following two properties hold. i T v + v = T v + T v for all

More information

Notes on Determinant

Notes on Determinant ENGG2012B Advanced Engineering Mathematics Notes on Determinant Lecturer: Kenneth Shum Lecture 9-18/02/2013 The determinant of a system of linear equations determines whether the solution is unique, without

More information

9 MATRICES AND TRANSFORMATIONS

9 MATRICES AND TRANSFORMATIONS 9 MATRICES AND TRANSFORMATIONS Chapter 9 Matrices and Transformations Objectives After studying this chapter you should be able to handle matrix (and vector) algebra with confidence, and understand the

More information

Lecture Notes 2: Matrices as Systems of Linear Equations

Lecture Notes 2: Matrices as Systems of Linear Equations 2: Matrices as Systems of Linear Equations 33A Linear Algebra, Puck Rombach Last updated: April 13, 2016 Systems of Linear Equations Systems of linear equations can represent many things You have probably

More information

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2

MATHEMATICS FOR ENGINEERS BASIC MATRIX THEORY TUTORIAL 2 MATHEMATICS FO ENGINEES BASIC MATIX THEOY TUTOIAL This is the second of two tutorials on matrix theory. On completion you should be able to do the following. Explain the general method for solving simultaneous

More information

SF2940: Probability theory Lecture 8: Multivariate Normal Distribution

SF2940: Probability theory Lecture 8: Multivariate Normal Distribution SF2940: Probability theory Lecture 8: Multivariate Normal Distribution Timo Koski 24.09.2014 Timo Koski () Mathematisk statistik 24.09.2014 1 / 75 Learning outcomes Random vectors, mean vector, covariance

More information

SF2940: Probability theory Lecture 8: Multivariate Normal Distribution

SF2940: Probability theory Lecture 8: Multivariate Normal Distribution SF2940: Probability theory Lecture 8: Multivariate Normal Distribution Timo Koski 24.09.2015 Timo Koski Matematisk statistik 24.09.2015 1 / 1 Learning outcomes Random vectors, mean vector, covariance matrix,

More information

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1. MATH10212 Linear Algebra Textbook: D. Poole, Linear Algebra: A Modern Introduction. Thompson, 2006. ISBN 0-534-40596-7. Systems of Linear Equations Definition. An n-dimensional vector is a row or a column

More information

Chapter 19. General Matrices. An n m matrix is an array. a 11 a 12 a 1m a 21 a 22 a 2m A = a n1 a n2 a nm. The matrix A has n row vectors

Chapter 19. General Matrices. An n m matrix is an array. a 11 a 12 a 1m a 21 a 22 a 2m A = a n1 a n2 a nm. The matrix A has n row vectors Chapter 9. General Matrices An n m matrix is an array a a a m a a a m... = [a ij]. a n a n a nm The matrix A has n row vectors and m column vectors row i (A) = [a i, a i,..., a im ] R m a j a j a nj col

More information

Review Jeopardy. Blue vs. Orange. Review Jeopardy

Review Jeopardy. Blue vs. Orange. Review Jeopardy Review Jeopardy Blue vs. Orange Review Jeopardy Jeopardy Round Lectures 0-3 Jeopardy Round $200 How could I measure how far apart (i.e. how different) two observations, y 1 and y 2, are from each other?

More information

Similarity and Diagonalization. Similar Matrices

Similarity and Diagonalization. Similar Matrices MATH022 Linear Algebra Brief lecture notes 48 Similarity and Diagonalization Similar Matrices Let A and B be n n matrices. We say that A is similar to B if there is an invertible n n matrix P such that

More information

Lecture L3 - Vectors, Matrices and Coordinate Transformations

Lecture L3 - Vectors, Matrices and Coordinate Transformations S. Widnall 16.07 Dynamics Fall 2009 Lecture notes based on J. Peraire Version 2.0 Lecture L3 - Vectors, Matrices and Coordinate Transformations By using vectors and defining appropriate operations between

More information

by the matrix A results in a vector which is a reflection of the given

by the matrix A results in a vector which is a reflection of the given Eigenvalues & Eigenvectors Example Suppose Then So, geometrically, multiplying a vector in by the matrix A results in a vector which is a reflection of the given vector about the y-axis We observe that

More information

Typical Linear Equation Set and Corresponding Matrices

Typical Linear Equation Set and Corresponding Matrices EWE: Engineering With Excel Larsen Page 1 4. Matrix Operations in Excel. Matrix Manipulations: Vectors, Matrices, and Arrays. How Excel Handles Matrix Math. Basic Matrix Operations. Solving Systems of

More information

1 Determinants and the Solvability of Linear Systems

1 Determinants and the Solvability of Linear Systems 1 Determinants and the Solvability of Linear Systems In the last section we learned how to use Gaussian elimination to solve linear systems of n equations in n unknowns The section completely side-stepped

More information

Brief Introduction to Vectors and Matrices

Brief Introduction to Vectors and Matrices CHAPTER 1 Brief Introduction to Vectors and Matrices In this chapter, we will discuss some needed concepts found in introductory course in linear algebra. We will introduce matrix, vector, vector-valued

More information

Matrices 2. Solving Square Systems of Linear Equations; Inverse Matrices

Matrices 2. Solving Square Systems of Linear Equations; Inverse Matrices Matrices 2. Solving Square Systems of Linear Equations; Inverse Matrices Solving square systems of linear equations; inverse matrices. Linear algebra is essentially about solving systems of linear equations,

More information

Orthogonal Diagonalization of Symmetric Matrices

Orthogonal Diagonalization of Symmetric Matrices MATH10212 Linear Algebra Brief lecture notes 57 Gram Schmidt Process enables us to find an orthogonal basis of a subspace. Let u 1,..., u k be a basis of a subspace V of R n. We begin the process of finding

More information

LS.6 Solution Matrices

LS.6 Solution Matrices LS.6 Solution Matrices In the literature, solutions to linear systems often are expressed using square matrices rather than vectors. You need to get used to the terminology. As before, we state the definitions

More information

Matrix Algebra in R A Minimal Introduction

Matrix Algebra in R A Minimal Introduction A Minimal Introduction James H. Steiger Department of Psychology and Human Development Vanderbilt University Regression Modeling, 2009 1 Defining a Matrix in R Entering by Columns Entering by Rows Entering

More information

Math 312 Homework 1 Solutions

Math 312 Homework 1 Solutions Math 31 Homework 1 Solutions Last modified: July 15, 01 This homework is due on Thursday, July 1th, 01 at 1:10pm Please turn it in during class, or in my mailbox in the main math office (next to 4W1) Please

More information

Overview of Violations of the Basic Assumptions in the Classical Normal Linear Regression Model

Overview of Violations of the Basic Assumptions in the Classical Normal Linear Regression Model Overview of Violations of the Basic Assumptions in the Classical Normal Linear Regression Model 1 September 004 A. Introduction and assumptions The classical normal linear regression model can be written

More information

MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix.

MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix. MATH 304 Linear Algebra Lecture 18: Rank and nullity of a matrix. Nullspace Let A = (a ij ) be an m n matrix. Definition. The nullspace of the matrix A, denoted N(A), is the set of all n-dimensional column

More information

Elementary Matrices and The LU Factorization

Elementary Matrices and The LU Factorization lementary Matrices and The LU Factorization Definition: ny matrix obtained by performing a single elementary row operation (RO) on the identity (unit) matrix is called an elementary matrix. There are three

More information

STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. Clarificationof zonationprocedure described onpp. 238-239

STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. Clarificationof zonationprocedure described onpp. 238-239 STATISTICS AND DATA ANALYSIS IN GEOLOGY, 3rd ed. by John C. Davis Clarificationof zonationprocedure described onpp. 38-39 Because the notation used in this section (Eqs. 4.8 through 4.84) is inconsistent

More information

Week 5: Multiple Linear Regression

Week 5: Multiple Linear Regression BUS41100 Applied Regression Analysis Week 5: Multiple Linear Regression Parameter estimation and inference, forecasting, diagnostics, dummy variables Robert B. Gramacy The University of Chicago Booth School

More information

Chapter Two: Matrix Algebra and its Applications 1 CHAPTER TWO. Matrix Algebra and its applications

Chapter Two: Matrix Algebra and its Applications 1 CHAPTER TWO. Matrix Algebra and its applications Chapter Two: Matrix Algebra and its Applications 1 CHAPTER TWO Matrix Algebra and its applications Algebra - is a part of mathematics that deals with operations (+, -, x ). Matrix is A RECTANGULAR ARRAY

More information

Recall that two vectors in are perpendicular or orthogonal provided that their dot

Recall that two vectors in are perpendicular or orthogonal provided that their dot Orthogonal Complements and Projections Recall that two vectors in are perpendicular or orthogonal provided that their dot product vanishes That is, if and only if Example 1 The vectors in are orthogonal

More information

Torgerson s Classical MDS derivation: 1: Determining Coordinates from Euclidean Distances

Torgerson s Classical MDS derivation: 1: Determining Coordinates from Euclidean Distances Torgerson s Classical MDS derivation: 1: Determining Coordinates from Euclidean Distances It is possible to construct a matrix X of Cartesian coordinates of points in Euclidean space when we know the Euclidean

More information

Section 6.1 - Inner Products and Norms

Section 6.1 - Inner Products and Norms Section 6.1 - Inner Products and Norms Definition. Let V be a vector space over F {R, C}. An inner product on V is a function that assigns, to every ordered pair of vectors x and y in V, a scalar in F,

More information

A Primer on Index Notation

A Primer on Index Notation A Primer on John Crimaldi August 28, 2006 1. Index versus Index notation (a.k.a. Cartesian notation) is a powerful tool for manipulating multidimensional equations. However, there are times when the more

More information

The Singular Value Decomposition in Symmetric (Löwdin) Orthogonalization and Data Compression

The Singular Value Decomposition in Symmetric (Löwdin) Orthogonalization and Data Compression The Singular Value Decomposition in Symmetric (Löwdin) Orthogonalization and Data Compression The SVD is the most generally applicable of the orthogonal-diagonal-orthogonal type matrix decompositions Every

More information

8. Linear least-squares

8. Linear least-squares 8. Linear least-squares EE13 (Fall 211-12) definition examples and applications solution of a least-squares problem, normal equations 8-1 Definition overdetermined linear equations if b range(a), cannot

More information

Sections 2.11 and 5.8

Sections 2.11 and 5.8 Sections 211 and 58 Timothy Hanson Department of Statistics, University of South Carolina Stat 704: Data Analysis I 1/25 Gesell data Let X be the age in in months a child speaks his/her first word and

More information

T ( a i x i ) = a i T (x i ).

T ( a i x i ) = a i T (x i ). Chapter 2 Defn 1. (p. 65) Let V and W be vector spaces (over F ). We call a function T : V W a linear transformation form V to W if, for all x, y V and c F, we have (a) T (x + y) = T (x) + T (y) and (b)

More information

Regression Analysis. Regression Analysis MIT 18.S096. Dr. Kempthorne. Fall 2013

Regression Analysis. Regression Analysis MIT 18.S096. Dr. Kempthorne. Fall 2013 Lecture 6: Regression Analysis MIT 18.S096 Dr. Kempthorne Fall 2013 MIT 18.S096 Regression Analysis 1 Outline Regression Analysis 1 Regression Analysis MIT 18.S096 Regression Analysis 2 Multiple Linear

More information

Solving Linear Systems, Continued and The Inverse of a Matrix

Solving Linear Systems, Continued and The Inverse of a Matrix , Continued and The of a Matrix Calculus III Summer 2013, Session II Monday, July 15, 2013 Agenda 1. The rank of a matrix 2. The inverse of a square matrix Gaussian Gaussian solves a linear system by reducing

More information

MATH 551 - APPLIED MATRIX THEORY

MATH 551 - APPLIED MATRIX THEORY MATH 55 - APPLIED MATRIX THEORY FINAL TEST: SAMPLE with SOLUTIONS (25 points NAME: PROBLEM (3 points A web of 5 pages is described by a directed graph whose matrix is given by A Do the following ( points

More information

Least Squares Estimation

Least Squares Estimation Least Squares Estimation SARA A VAN DE GEER Volume 2, pp 1041 1045 in Encyclopedia of Statistics in Behavioral Science ISBN-13: 978-0-470-86080-9 ISBN-10: 0-470-86080-4 Editors Brian S Everitt & David

More information

Outline. Topic 4 - Analysis of Variance Approach to Regression. Partitioning Sums of Squares. Total Sum of Squares. Partitioning sums of squares

Outline. Topic 4 - Analysis of Variance Approach to Regression. Partitioning Sums of Squares. Total Sum of Squares. Partitioning sums of squares Topic 4 - Analysis of Variance Approach to Regression Outline Partitioning sums of squares Degrees of freedom Expected mean squares General linear test - Fall 2013 R 2 and the coefficient of correlation

More information

1 0 5 3 3 A = 0 0 0 1 3 0 0 0 0 0 0 0 0 0 0

1 0 5 3 3 A = 0 0 0 1 3 0 0 0 0 0 0 0 0 0 0 Solutions: Assignment 4.. Find the redundant column vectors of the given matrix A by inspection. Then find a basis of the image of A and a basis of the kernel of A. 5 A The second and third columns are

More information

5.5. Solving linear systems by the elimination method

5.5. Solving linear systems by the elimination method 55 Solving linear systems by the elimination method Equivalent systems The major technique of solving systems of equations is changing the original problem into another one which is of an easier to solve

More information

CITY UNIVERSITY LONDON. BEng Degree in Computer Systems Engineering Part II BSc Degree in Computer Systems Engineering Part III PART 2 EXAMINATION

CITY UNIVERSITY LONDON. BEng Degree in Computer Systems Engineering Part II BSc Degree in Computer Systems Engineering Part III PART 2 EXAMINATION No: CITY UNIVERSITY LONDON BEng Degree in Computer Systems Engineering Part II BSc Degree in Computer Systems Engineering Part III PART 2 EXAMINATION ENGINEERING MATHEMATICS 2 (resit) EX2005 Date: August

More information

Question 2: How do you solve a matrix equation using the matrix inverse?

Question 2: How do you solve a matrix equation using the matrix inverse? Question : How do you solve a matrix equation using the matrix inverse? In the previous question, we wrote systems of equations as a matrix equation AX B. In this format, the matrix A contains the coefficients

More information

[1] Diagonal factorization

[1] Diagonal factorization 8.03 LA.6: Diagonalization and Orthogonal Matrices [ Diagonal factorization [2 Solving systems of first order differential equations [3 Symmetric and Orthonormal Matrices [ Diagonal factorization Recall:

More information

A linear combination is a sum of scalars times quantities. Such expressions arise quite frequently and have the form

A linear combination is a sum of scalars times quantities. Such expressions arise quite frequently and have the form Section 1.3 Matrix Products A linear combination is a sum of scalars times quantities. Such expressions arise quite frequently and have the form (scalar #1)(quantity #1) + (scalar #2)(quantity #2) +...

More information

Part II. Multiple Linear Regression

Part II. Multiple Linear Regression Part II Multiple Linear Regression 86 Chapter 7 Multiple Regression A multiple linear regression model is a linear model that describes how a y-variable relates to two or more xvariables (or transformations

More information

Inner products on R n, and more

Inner products on R n, and more Inner products on R n, and more Peyam Ryan Tabrizian Friday, April 12th, 2013 1 Introduction You might be wondering: Are there inner products on R n that are not the usual dot product x y = x 1 y 1 + +

More information

Linear Algebra Notes

Linear Algebra Notes Linear Algebra Notes Chapter 19 KERNEL AND IMAGE OF A MATRIX Take an n m matrix a 11 a 12 a 1m a 21 a 22 a 2m a n1 a n2 a nm and think of it as a function A : R m R n The kernel of A is defined as Note

More information

Abstract: We describe the beautiful LU factorization of a square matrix (or how to write Gaussian elimination in terms of matrix multiplication).

Abstract: We describe the beautiful LU factorization of a square matrix (or how to write Gaussian elimination in terms of matrix multiplication). MAT 2 (Badger, Spring 202) LU Factorization Selected Notes September 2, 202 Abstract: We describe the beautiful LU factorization of a square matrix (or how to write Gaussian elimination in terms of matrix

More information

Linearly Independent Sets and Linearly Dependent Sets

Linearly Independent Sets and Linearly Dependent Sets These notes closely follow the presentation of the material given in David C. Lay s textbook Linear Algebra and its Applications (3rd edition). These notes are intended primarily for in-class presentation

More information

Lecture notes on linear algebra

Lecture notes on linear algebra Lecture notes on linear algebra David Lerner Department of Mathematics University of Kansas These are notes of a course given in Fall, 2007 and 2008 to the Honors sections of our elementary linear algebra

More information

Section 5.3. Section 5.3. u m ] l jj. = l jj u j + + l mj u m. v j = [ u 1 u j. l mj

Section 5.3. Section 5.3. u m ] l jj. = l jj u j + + l mj u m. v j = [ u 1 u j. l mj Section 5. l j v j = [ u u j u m ] l jj = l jj u j + + l mj u m. l mj Section 5. 5.. Not orthogonal, the column vectors fail to be perpendicular to each other. 5..2 his matrix is orthogonal. Check that

More information

160 CHAPTER 4. VECTOR SPACES

160 CHAPTER 4. VECTOR SPACES 160 CHAPTER 4. VECTOR SPACES 4. Rank and Nullity In this section, we look at relationships between the row space, column space, null space of a matrix and its transpose. We will derive fundamental results

More information

Linear Algebra: Determinants, Inverses, Rank

Linear Algebra: Determinants, Inverses, Rank D Linear Algebra: Determinants, Inverses, Rank D 1 Appendix D: LINEAR ALGEBRA: DETERMINANTS, INVERSES, RANK TABLE OF CONTENTS Page D.1. Introduction D 3 D.2. Determinants D 3 D.2.1. Some Properties of

More information

Unified Lecture # 4 Vectors

Unified Lecture # 4 Vectors Fall 2005 Unified Lecture # 4 Vectors These notes were written by J. Peraire as a review of vectors for Dynamics 16.07. They have been adapted for Unified Engineering by R. Radovitzky. References [1] Feynmann,

More information

Linear Algebra: Vectors

Linear Algebra: Vectors A Linear Algebra: Vectors A Appendix A: LINEAR ALGEBRA: VECTORS TABLE OF CONTENTS Page A Motivation A 3 A2 Vectors A 3 A2 Notational Conventions A 4 A22 Visualization A 5 A23 Special Vectors A 5 A3 Vector

More information

Linear Maps. Isaiah Lankham, Bruno Nachtergaele, Anne Schilling (February 5, 2007)

Linear Maps. Isaiah Lankham, Bruno Nachtergaele, Anne Schilling (February 5, 2007) MAT067 University of California, Davis Winter 2007 Linear Maps Isaiah Lankham, Bruno Nachtergaele, Anne Schilling (February 5, 2007) As we have discussed in the lecture on What is Linear Algebra? one of

More information

Vector and Matrix Norms

Vector and Matrix Norms Chapter 1 Vector and Matrix Norms 11 Vector Spaces Let F be a field (such as the real numbers, R, or complex numbers, C) with elements called scalars A Vector Space, V, over the field F is a non-empty

More information

1 2 3 1 1 2 x = + x 2 + x 4 1 0 1

1 2 3 1 1 2 x = + x 2 + x 4 1 0 1 (d) If the vector b is the sum of the four columns of A, write down the complete solution to Ax = b. 1 2 3 1 1 2 x = + x 2 + x 4 1 0 0 1 0 1 2. (11 points) This problem finds the curve y = C + D 2 t which

More information

Solving Systems of Linear Equations

Solving Systems of Linear Equations LECTURE 5 Solving Systems of Linear Equations Recall that we introduced the notion of matrices as a way of standardizing the expression of systems of linear equations In today s lecture I shall show how

More information

Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

More information

1 Teaching notes on GMM 1.

1 Teaching notes on GMM 1. Bent E. Sørensen January 23, 2007 1 Teaching notes on GMM 1. Generalized Method of Moment (GMM) estimation is one of two developments in econometrics in the 80ies that revolutionized empirical work in

More information

Simple Regression Theory II 2010 Samuel L. Baker

Simple Regression Theory II 2010 Samuel L. Baker SIMPLE REGRESSION THEORY II 1 Simple Regression Theory II 2010 Samuel L. Baker Assessing how good the regression equation is likely to be Assignment 1A gets into drawing inferences about how close the

More information

Name: Section Registered In:

Name: Section Registered In: Name: Section Registered In: Math 125 Exam 3 Version 1 April 24, 2006 60 total points possible 1. (5pts) Use Cramer s Rule to solve 3x + 4y = 30 x 2y = 8. Be sure to show enough detail that shows you are

More information

Au = = = 3u. Aw = = = 2w. so the action of A on u and w is very easy to picture: it simply amounts to a stretching by 3 and 2, respectively.

Au = = = 3u. Aw = = = 2w. so the action of A on u and w is very easy to picture: it simply amounts to a stretching by 3 and 2, respectively. Chapter 7 Eigenvalues and Eigenvectors In this last chapter of our exploration of Linear Algebra we will revisit eigenvalues and eigenvectors of matrices, concepts that were already introduced in Geometry

More information

1.5. Factorisation. Introduction. Prerequisites. Learning Outcomes. Learning Style

1.5. Factorisation. Introduction. Prerequisites. Learning Outcomes. Learning Style Factorisation 1.5 Introduction In Block 4 we showed the way in which brackets were removed from algebraic expressions. Factorisation, which can be considered as the reverse of this process, is dealt with

More information

5. Orthogonal matrices

5. Orthogonal matrices L Vandenberghe EE133A (Spring 2016) 5 Orthogonal matrices matrices with orthonormal columns orthogonal matrices tall matrices with orthonormal columns complex matrices with orthonormal columns 5-1 Orthonormal

More information

DATA ANALYSIS II. Matrix Algorithms

DATA ANALYSIS II. Matrix Algorithms DATA ANALYSIS II Matrix Algorithms Similarity Matrix Given a dataset D = {x i }, i=1,..,n consisting of n points in R d, let A denote the n n symmetric similarity matrix between the points, given as where

More information

Linear Programming in Matrix Form

Linear Programming in Matrix Form Linear Programming in Matrix Form Appendix B We first introduce matrix concepts in linear programming by developing a variation of the simplex method called the revised simplex method. This algorithm,

More information

Finite dimensional C -algebras

Finite dimensional C -algebras Finite dimensional C -algebras S. Sundar September 14, 2012 Throughout H, K stand for finite dimensional Hilbert spaces. 1 Spectral theorem for self-adjoint opertors Let A B(H) and let {ξ 1, ξ 2,, ξ n

More information

The Determinant: a Means to Calculate Volume

The Determinant: a Means to Calculate Volume The Determinant: a Means to Calculate Volume Bo Peng August 20, 2007 Abstract This paper gives a definition of the determinant and lists many of its well-known properties Volumes of parallelepipeds are

More information

University of Lille I PC first year list of exercises n 7. Review

University of Lille I PC first year list of exercises n 7. Review University of Lille I PC first year list of exercises n 7 Review Exercise Solve the following systems in 4 different ways (by substitution, by the Gauss method, by inverting the matrix of coefficients

More information