Lec04.Matrix1

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

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

View Full Document Right Arrow Icon
Matrix Algebra KNNL Ch. 5
Background image of page 1

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

View Full Document Right Arrow Icon
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.
Background image of page 2
Initial Definitions 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 Scalar Vector Matrix
Background image of page 3

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

View Full Document Right Arrow Icon
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
Background image of page 4
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
Background image of page 5

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

View Full Document Right Arrow Icon
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
Background image of page 6
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
Background image of page 7

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

View Full Document Right Arrow Icon
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
Background image of page 8
Multiply a Scalar by a Matrix = = = 90
Background image of page 9

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

View Full Document Right Arrow Icon
Image of page 10
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 Right Arrow Icon
Ask a homework question - tutors are online