MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations
-
Upload
jacob-fitzgerald -
Category
Documents
-
view
229 -
download
0
description
Transcript of MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations
![Page 1: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/1.jpg)
MAT 2401Linear Algebra
2.5 Applications of Matrix Operations
http://myhome.spu.edu/lauw
![Page 2: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/2.jpg)
HW Written Homework
![Page 3: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/3.jpg)
Preview We will only focus on one
application – The Method of Least Squares.
![Page 4: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/4.jpg)
Linear RegressionSuppose that a scientist has reason to believe that 2 quantities x and y are related linearly, that is,
y=mx+b.The scientist performs an experiment and collect data points (x1,y1),…,(xn,yn).
![Page 5: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/5.jpg)
Linear Regressiony
x
,i ix y y mx b
ie
i i ie y mx b
![Page 6: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/6.jpg)
Goals Find a line y=mx+b that minimize
the sum of the squares of the errors ei.
Use y=mx+b to estimate the function values.
![Page 7: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/7.jpg)
Linear Regressiony
x
,i ix y y mx b
ie
i i ie y mx b
![Page 8: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/8.jpg)
Matrix Equation
i i ie y mx b
![Page 9: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/9.jpg)
Matrix Equation
1 11
2 22
11 Let , , ,
1 nn n
y exy ex b
Y X A Em
xy e
![Page 10: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/10.jpg)
Matrix Form of Linear RegressionFor the linear regression model , the coefficients of the least squares regression line are given by
A= (XTX)-1XTYand the sum of squared error is
ETE1 11
2 22
11 Let , , ,
1 nn n
y exy ex b
Y X A Em
xy e
![Page 11: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/11.jpg)
Plan… Computational Example HW Why the formula is correct? Very
Educational; Focus on the Ideas
![Page 12: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/12.jpg)
Example 1Find the least squares regression line for the points (1,1), (2,2), (3,4), and (5,6).
1 11
2 22
1
11 Let , , ,
1
Then,
nn n
T T
y exy ex b
Y X A Em
xy e
A X X X Y
![Page 13: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/13.jpg)
Example 1
![Page 14: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/14.jpg)
Example 1
9 27 7
y x
![Page 15: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/15.jpg)
Why? Give you some ideas why the
formula actually work.
![Page 16: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/16.jpg)
Recall Q: How to find the minimum of a
function f(x)? A:
![Page 17: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/17.jpg)
Recall Q: How to find the minimum of a
function f(x)? A: Q: How to find the minimum of a
function f(x,y)?
![Page 18: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/18.jpg)
Recall: Sigma Notation A “compact” notation for sums to
avoid “…”30
2 2 2 2 2
1
1 2 3 30k
k
![Page 19: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/19.jpg)
Recall: Sigma Notation
1 21
n
i ni
x x x x
Final value (upper limit)
Initial value (lower limit)Index
![Page 20: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/20.jpg)
Recall: Linear Property 1
1 2
1 2
1
1
5
5
5 5 5
5
n
ii
n
ii
n
n
x x x
x
x
xx x
![Page 21: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/21.jpg)
Recall: Linear Property 2
1 1 2 2
1 2 1
1
1 1
2
n n
n
n
i ii
n n
i ii i
n
x y x y x y
x x x y y y
x y
x y
![Page 22: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/22.jpg)
Why? Let g(b,m) be the function of the
sum of the squared errors. We can find the critical point by
solving the equations0 and 0g g
b m
![Page 23: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/23.jpg)
Why? Let g(b,m) be the function of the
sum of the squared error. We can find the critical point by
solving the equations
It can be shown that the critical point is a minimum (skip)
0 and 0g gb m
![Page 24: MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations](https://reader035.fdocuments.in/reader035/viewer/2022062317/5a4d1b2d7f8b9ab059999b00/html5/thumbnails/24.jpg)
Why?
0 and 0g gb m
2
1
2
1
2
1
( , )n
ii
n
i ii
n
i ii
g b m e
y mx b
y mx b