Lec04.Matrix1

# Lec04.Matrix1 - Matrix Algebra KNNL Ch 5 Why use matrix...

This preview shows pages 1–10. Sign up to view the full content.

Matrix Algebra KNNL Ch. 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Why use matrix formulations? It will give us a more compact and efficient method of describing and remembering statistical relationships such as those used in linear regression. It will provide a shorthand notation for carrying out operations computationally.
Initial Definitions 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 Scalar Vector Matrix

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Matrix Notation Rectangular array of elements arranged in rows and columns = = 9 8 7 6 5 4 3 2 1 33 32 31 23 22 21 13 12 11 a a a a a a a a a A
Splus/R Matrix Notation = = 9 8 7 6 5 4 3 2 1 33 32 31 23 22 21 13 12 11 a a a a a a a a a A A = matrix(1:9,nrow=3,ncol=3,byrow=T) A [,1] [,2] [,3] [1,] 1 2 3 [2,] 4 5 6 [3,] 7 8 9 A[2,2] [1] 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Another way of forming a matrix: B1 = c(1, 2, 6, 3) B2 = c(5, 10, 3, 5) B = cbind(B1, B2) B B1 B2 [1,] 1 5 [2,] 2 10 [3,] 6 3 [4,] 3 5 B = rbind(B1, B2) B [,1] [,2] [,3] [,4] B1 1 2 6 3 B2 5 10 3 5
Element by Element Addition and Subtraction = + + + + + + = + 12 9 6 8 5 2 6 6 4 5 2 4 5 3 3 2 1 1 6 4 2 5 3 1 6 5 4 3 2 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Splus/R Element by Element Addition and Subtraction A = rbind(c(1, 2, 3), c(4, 5, 6)) B = rbind(c(1, 3, 5), c(2, 4, 6)) A [,1] [,2] [,3] [1,] 1 2 3 [2,] 4 5 6 B [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 A + B [,1] [,2] [,3] [1,] 2 5 8 [2,] 6 9 12
Multiply a Scalar by a Matrix = = = 90

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 35

Lec04.Matrix1 - Matrix Algebra KNNL Ch 5 Why use matrix...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online