Professional Documents
Culture Documents
linear regresion
1
1/27/17
Mathematical modeling
2
1/27/17
1/27/17
Regression models
5
1/27/17
1/27/17
1/27/17
1/27/17
10
1/27/17
11
1/27/17
12
1/27/17
13
1/27/17
14
1/27/17
15
1/27/17
Scatterplot analysis
16
17
squares regression
(b) Indication that a parabola may be more
suitable
1/27/17
18
1/27/17
http://sphweb.bumc.bu.edu/otlt/MPHModules/BS/BS704_Multivariable/BS704_Multivariable5.html
1/27/17
20
1/27/17
21
1/27/17
1/27/17
1/27/17
24
1/27/17
25
26
1/27/17
Linear regression
27
1/27/17
28
29
30
Sr e
i 1
2
i
( yi ,measured yi ,model ) 2
i 1
n
S r ( yi b axi ) 2
i 1
1/27/17
31
(1)
1/27/17
2
x
i
xi
a
n b
i
yx
32
i i
i
n xi yi xi yi
n x xi
2
i
b y ax , where y
,x
The example data in Table 1 are plotted in Figure 1. You can see that
there is a positive relationship between X and Y. If you were going to
predict Y from X, the higher the value of X, the higher your prediction
of Y.
1/27/17
Example (http://onlinestatbook.com/2/regression/intro.html)
33
1/27/17
34
1/27/17
35
1/27/17
36
1/27/17
37
n xi yi xi yi
n x xi
2
i
0.4250
b y ax 0.785, where y
,x
.
1/27/17
38
The error of prediction for a point is the value of the point minus
1/27/17
39
1/27/17
40
1/27/17
41
1/27/17
St
S r ( yi a0 a1 xi ) 2
i 1
1/27/17
43
1/27/17
Multiple regression
44
1/27/17
45
1/27/17
46
1/27/17
47
http://gerardnico.com/wiki/data_mining/multiple_regression
1/27/17
48
i 1
i 1
S r
2 ( yi ao a1 x1i a2 x2i ) 0
ao
S r
2 x1i ( yi ao a1 x1i a2 x2i ) 0
a1
x a x a x
S r
2 x2i ( yi ao a1 x1i a2 x2i ) 0
a2
x a x
n
x1i
x2 i
x
x
x x
1i
2
1i
1i
1i
2i
x
x x
x
2
1i
x a2 x1i yi
1i 2 i
x a1
1i 2 i
a0
a
1i 2 i
1
2 i a2
2i
2i
x a x
2
2i
2i
yi
y
x y
x y
i
1i
2i
1/27/17
y = 5 + 4x1 - 3x2
Use multiple linear regression to fit
this data.
16.5 14 a0 54
6
16.5 76.25 48 a 243.5
14
48
54 a2 100
This system can be solved using Gauss Elimination.
The result is: a0=5 a1=4 and a2= -3
y = 5 + 4x1 -3x2
1/27/17
1/27/17
51
1/27/17
52
1/27/17