- 11. Regression and Least Squares
- Prof. Tesler
Math 186 Winter 2019
- Prof. Tesler
- Ch. 11: Linear Regression
Math 186 / Winter 2019 1 / 24
11. Regression and Least Squares Prof. Tesler Math 186 Winter 2019 - - PowerPoint PPT Presentation
11. Regression and Least Squares Prof. Tesler Math 186 Winter 2019 Prof. Tesler Ch. 11: Linear Regression Math 186 / Winter 2019 1 / 24 Regression Given n points ( x 1 , y 1 ) , ( x 2 , y 2 ) , . . . , we want to determine a function y = f (
Math 186 / Winter 2019 1 / 24
−10 10 20 30 10 20 30 40 50
x y
Math 186 / Winter 2019 2 / 24
10 12 14 16 18 20 60 80 100
! ! ! ! ! ! ! ! !
5 10 15 20 25 −1000 500
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
5 10 15 20 25 30 1 2 3 4 5
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
5 10 15 20 2 4 6 8 10
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
Math 186 / Winter 2019 3 / 24
Math 186 / Winter 2019 4 / 24
! ! ! ! ! ! ! ! ! !
−20 −10 10 20 30 10 20 30 40 50 x y
Math 186 / Winter 2019 5 / 24
! ! ! ! ! ! ! ! ! !
−20 −10 10 20 30 10 20 30 40 50 x y
Math 186 / Winter 2019 6 / 24
! ! ! ! ! ! ! ! ! !
−20 −10 10 20 30 10 20 30 40 50 x y
Math 186 / Winter 2019 7 / 24
n
n
n
2
n
Math 186 / Winter 2019 8 / 24
−10 10 20 30 10 20 30 40 50
y = β0 + β1x + ε
x y slope = 0.6180 y = 24.9494 + 0.6180x
−10 10 20 30 10 20 30 40 50
x = α0 + α1y + ε
x y slope = 0.8695 x = −28.2067 + 1.1501y
Math 186 / Winter 2019 9 / 24
! ! ! ! ! ! ! ! ! !
−20 −10 10 20 30 10 20 30 40 50
y = !0 + !1x + "
x y slope = 0.6180 y = 24.9494 + 0.6180x
! ! ! ! ! ! ! ! ! !
−20 −10 10 20 30 10 20 30 40 50
x = #0 + #1y + "
x y slope = 0.8695 x = −28.2067 + 1.1501y
! ! ! ! ! ! ! ! ! !
−20 −10 10 20 30 10 20 30 40 50
First principal component
x y slope = 0.6934274
! ! ! ! ! ! ! ! ! !
−20 −10 10 20 30 10 20 30 40 50
All three
x y x = 1.685727 y = 25.99114
Math 186 / Winter 2019 10 / 24
5 10 15 20 25 50 100 150 y = !0 + !1x + " x y
! ! ! ! ! ! ! ! !
r2 = 0.7683551
!
true line sample data best fit line 95% prediction interval
Math 186 / Winter 2019 11 / 24
i xi2
i(xi−¯
i xi2
i(xi−¯
i(xi−¯
i(xi−¯
Math 186 / Winter 2019 12 / 24
Math 186 / Winter 2019 13 / 24
Math 186 / Winter 2019 14 / 24
Math 186 / Winter 2019 15 / 24
Math 186 / Winter 2019 16 / 24
Math 186 / Winter 2019 17 / 24
Math 186 / Winter 2019 18 / 24
Math 186 / Winter 2019 19 / 24
1 0.8 0.4
1 1 1
http://en.wikipedia.org/wiki/File:Correlation_examples2.svg http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient
Math 186 / Winter 2019 20 / 24
Math 186 / Winter 2019 21 / 24
1 0.8 0.4
1 1 1
http://en.wikipedia.org/wiki/File:Correlation_examples2.svg http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient
Math 186 / Winter 2019 22 / 24
http://www.tylervigen.com/view_correlation?id=1703 http://tylervigen.com/view_correlation?id=1759
Math 186 / Winter 2019 23 / 24
Math 186 / Winter 2019 24 / 24