Professional Documents
Culture Documents
Automation Lab
IIT Bombay
31-Mar-16
Regression
Automation Lab
IIT Bombay
Outline
Regression
31-03-2016
Automation Lab
IIT Bombay
Mathematical Models
Regression
Automation Lab
IIT Bombay
Elements of a Model
Independent inputs (x)
Output (y) (dependent variable)
Parameters ()
Transformation operator (T)
Algebraic
Differential
x1
xn
31-Mar-16
Mathematical Model
T ( x1 ,.. xn , 1 ,..,
Regression
y
4
31-03-2016
Mathematical Models
Automation Lab
IIT Bombay
Regression
Automation Lab
IIT Bombay
Empirical models based on data fitting: Typical examplepolynomials used to fit empirical data, thermodynamic
correlations, correlations based on dimensionless groups
used in heat, mass and momentum transfer, transfer
function models used in process control
31-Mar-16
Regression
31-03-2016
Automation Lab
IIT Bombay
Empirical Modeling
Exact expression relating the dependent and the
independent variable may not be known
Regression
Automation Lab
IIT Bombay
a bT
T
for
T
[T1
for
T2 ]
[T3
T4 ]
Temperature dependence of Cp
Cp
Cp
a bT
for
T2
[T1
for
T
[T3
T2 ]
T
T4 ]
a bn cn 2
n
n2
Regression
n3
8
31-03-2016
Automation Lab
IIT Bombay
[T1
T P
T2 ] for [ P1
Y a bT cP dT
for [T3 T T4 ] for
eP
[ P3
P
2
Pr
Re
- rA
k0e
x
1 (
1) x
fPT
P P4 ]
P2 ]
CA
31-Mar-16
Regression
.
9
Automation Lab
IIT Bombay
f (x )
x1
x2 .... xm
f ( x ) ...
1 1
2 2
1 1
2 2
f p (x)
f i ( x ), we can write
...
p p
Sources of error
Measurement Errors in dependent variable (y)
Modeling or Approximation Errors
1 1
2 2
...
Regression
p p
v
10
31-03-2016
Defining z
z1
1 1
....
...
2 2
z 2 ....
zp
zp
Automation Lab
IIT Bombay
T
p
zT v
x2 )
g ( x1 )
g (x 2 )
Sy
z( 1) , z( 2) ,...., z( n)
z( i )
v1 , v2 ,...., vn is minimized.
Regression
11
2 - norm :
v1 ,..., vn
vi
or
i 1
n
v1 ,..., vn
wi vi
where wi
0 for all i
i 1
v1 ,..., vn
vi
or
v1 ,..., vn
i 1
wi vi
i 1
31-Mar-16
Max
i
- Norm
v1 ,..., vn
based formulation is
analytical treatment
1 - Norm
n
Automation Lab
IIT Bombay
from viewpoint of
probability and statistics
vi
Regression
12
31-03-2016
Automation Lab
IIT Bombay
( a,b)
a bx v
z
from S y
f1 ( x )
az1 bz2
f2 ( x)
1 x
y1 , y2 ,........, yn and S Z
y1
a bx1 v1
...(1)
y2
a bx2
v2
...( 2)
vi
...(i )
yn
a bxi
......
a bxn vn
...( n )
31-Mar-16
z (1) , z( 2 ) ,...., z( n )
.....
yi
y1
y2
1
1
x1
x2
v1
v2
...
yi
...
yn
... ... a
1 xi b
...
vi
...
vn
... ...
1 xn
Regression
13
Automation Lab
IIT Bombay
Regression
14
31-03-2016
Automation Lab
IIT Bombay
az1 i
yi
J
b
and
( vi ) 2
J
i 1
wi ( vi ) 2 ( wi
0 for all i )
i 1
31-Mar-16
Regression
15
Automation Lab
IIT Bombay
V TV
vi
i 1
V TV
2 A T Y A
1
OLS AT A A T Y
By
( xT By )
y
BT x
16
31-03-2016
Geometric Interpretations
1
1
v1
v2
...
vi
...
1
y1
y2
...
yi
...
...
vn
1 x1
1 x2
... ... a
1 xi b
... ...
1 xn
yn
x1
x2
b
...
xn
31-Mar-16
Automation Lab
IIT Bombay
lies in the
Vector Y
column space of matrix A
Assumption : True behavior
Y
A *
* : True Parameters
A
Defining Y
V
we have Y
17
Geometric Interpretations
Automation Lab
IIT Bombay
Y A
AT V
TAT
V
V
H
A AT A
Y Y
I A AT A
AT Y
V
31-Mar-16
18
31-03-2016
Geometric Interpretations
31-Mar-16
Automation Lab
IIT Bombay
Regression
Ethanol-Water Example
19
Automation Lab
IIT Bombay
Experimental Data
Density and weight percent of ethanol in ethanol-water mixture
Regression
20
10
31-03-2016
Automation Lab
IIT Bombay
Ethanol-Water Example
Regression
21
Automation Lab
IIT Bombay
a bT
cP dT 2
eP 2
fPT
a bTi
cPi
dTi
Defining
z (i )
1 Ti
Yi
Pi
Ti 2
a b c d
T
Pi 2
e
PiTi
f
z ( i ) vi for i 1,2,....., n
31-Mar-16
ePi
fPiTi
vi for i 1,2,..., n
Y1
Y2
....
Yn
Y
n 1
A
n 6
Regression
T1
Tn
.... ....
P1T1
a
b
....
f
6 1
v1
v2
....
vn
V
n 1
22
11
31-03-2016
Automation Lab
IIT Bombay
Generalization of OLS
1 1
...
2 2
p p
y1 , y2 ,........, yn and S Z
v
z (1) , z ( 2 ) ,...., z ( n )
y1
z11
z21
.... ....
z p1
y2
z1 2
z22
.... ....
z p2
....
....
....
.... ....
....
....
yn
z1 n
z2 n
.... .... z pn
vn
p 1
V
n 1
Y
n 1
A
n p
31-Mar-16
v1
.
v2
....
Regression
23
Automation Lab
IIT Bombay
diag w1
wi
w2 .... wn
0 for all i
wi vi
V T WV
i 1
Subject to Y
A V
V T WV
2 A T W Y A
1
A T WA A T W Y
Selecting W
31-Mar-16
24
12
31-03-2016
Automation Lab
IIT Bombay
Laboratory experimental
data on Yield obtained from a
catalytic process at various
temperatures and pressures
Regression
31-Mar-16
Regression
25
Automation Lab
IIT Bombay
26
13
31-03-2016
Estimated Model
Automation Lab
IIT Bombay
31-Mar-16
Regression
27
Automation Lab
IIT Bombay
Regression
28
14
31-03-2016
Automation Lab
IIT Bombay
Candidate Models
Linear Model : T
a bn
Quadratic Model : T
n2
250
200
Linear Model
T = 39*n - 170
Quadratic Model
T = - 3*n2 + 67*n - 220
150
100
50
Data 1
Linear Model
Quadratic Model
0
-50
-100
-150
-200
-250
0
4
5
6
n, No. of Carbon Atoms
31-Mar-16
Regression
Unaddressed Issues
10
29
Automation Lab
IIT Bombay
Regression
30
15
31-03-2016
Automation Lab
IIT Bombay
Regression
31
Automation Lab
IIT Bombay
Notations
Consider n indepedndent random variables
Y1 , Y2 ,........, Yn
y1 , y2 ,........, yn
Model for RV Yi relating
Model Residuals V
Model for RV Yi
relating Random Error Vi
Yi
(i ) T
Vi
Model relating
realizations of RVs Yi and Vi
yi
(i ) T
* vi
Yi
Model relating
realizations of RVs Y , and V
i
31-Mar-16
T
z( i ) Vi
yi
Regression
( i) T
v
i
32
16
31-03-2016
Automation Lab
IIT Bombay
z1(1)
z2(1)
( 2)
1
(2)
2
.... ....
z (p1)
(2)
p
V1
V2
....
....
Vn
....
z1( n )
Y
(n 1)
.... .... z
( p 1) ( n 1)
A
(n p )
y1
z11
z21
y2
....
yn
2
2
z1
....
z1 n
Y
n 1
z
....
z2n
.... ....
Note :
Bold Y and bold V
represent Vectors
of Random Variables
z p1
v1
2
p
2
....
represent vectors
v2
....
vn
p 1
V
n 1
of Random Variables
.... .... z
.... .... ....
.... .... z pn
A
n p
31-Mar-16
Note :
Y and V
of " realizations"
Regression
33
Automation Lab
IIT Bombay
Notations
Note
z (1) , z ( 2) ,...., z ( n )
Regression
34
17
31-03-2016
Automation Lab
IIT Bombay
*
1 1
*
n
...
zp
EV
, i.e.
EY
where
*
1
,...,
*
p
*
p p
...
31-Mar-16
Regression
35
Automation Lab
IIT Bombay
Yi
* i
p p
...
Vi
* i
1 1
Yi
...
* i
p p
* i
1 1
...
* i
p p
Vi for i 1,2,....n
Regression
36
18
31-03-2016
Automation Lab
IIT Bombay
z11
z1 2
...
z1 p
Y
n 1
.... z p1
.... z p2
... ...
.... z pn
...
...
V1
V2
....
Vn
*
1
*
1
n p
p 1
V
n 1
or,
Y
31-Mar-16
A*
Regression
37
Automation Lab
IIT Bombay
0,
it implies that E V
0n 1
and
EY
E A *
Let R
A *
Cov( V )
E[ VV T ]
, it follows that
E[ VV T ]
In
Regression
A *
V
38
19
31-03-2016
Automation Lab
IIT Bombay
Y A
Y A
with respect to
Note : V T V
vi 2
i 1
AT A
AT Y
State Estimation
39
Automation Lab
IIT Bombay
AT A AT Y
A T A A T A* V
OLS
A T A A T A *
Regression
40
20
31-03-2016
Automation Lab
IIT Bombay
Defining matrix L
AT A
LY * LV
OLS
Cov OLS
E OLS
LRLT
Difficulty :
* OLS
2
LLT
1
n
LE VV T LT
AT A
Remedy : Estimate
AT
from samples
Y AOLS
TV
where V
2 AT A
Regression
41
Automation Lab
IIT Bombay
A *
R n and a model
V
0n 1 and Cov V
E * *
is as small as possible.
31-Mar-16
Regression
42
21
31-03-2016
Automation Lab
IIT Bombay
E * *
E LY * LY *
Minimum Variance
Parameter Estimation Problem :
Find Matrix L such that Cov is as small as possible.
3/31/2016
State Estimation
43
Automation Lab
IIT Bombay
Since E V
AV
J L
J Cov
J Cov LY
subject to LA
3/31/2016
State Estimation
I
44
22
31-03-2016
Automation Lab
IIT Bombay
T
1
tr E * *
2
Var 1 Var 2 .... Var p
J L
1
tr E LY * LY *
2
subject to LA
3/31/2016
State Estimation
45
Automation Lab
IIT Bombay
T
1
tr E * *
tr LA I
2
is minimized w.r.t. L, where
* *
State Estimation
46
23
31-03-2016
Automation Lab
IIT Bombay
LRLT
or E * *
LRLT
1
tr LRLT tr LA I
2
with respect to L
3/31/2016
State Estimation
47
Automation Lab
IIT Bombay
BT CT and
tr ABAT
A BT
B
A
A
the necessary conditions for optimality are
J
L
LR
J
AT
[0]
I LA [0]
Thus, we have
T
L
and I LA
3/31/2016
AT R
T
A T R 1A [0]
State Estimation
48
24
31-03-2016
Automation Lab
IIT Bombay
AT R 1A
AT R
A T R 1A A T R
A T R 1A AT R 1 Y
LY
*
A T R 1A AT R 1 V
MV
which implies
Cov
E MV
min
* MV
3/31/2016
AT R 1A
State Estimation
49
Automation Lab
IIT Bombay
LY
A T R 1A A T R 1 Y
A T WA A T W Y
Gauss-Markov theorem
The minimum variance unbiased linear estimator is
identical to the weighted least square estimator
when the weighting matrix is selected as inverse
of the measurement error covariance matrix.
31-Mar-16
Regression
50
25
31-03-2016
Automation Lab
IIT Bombay
L will have
tr Cov
tr Cov ~
MV
Cov( V )
I,
AT (
I) 1 A A T (
Cov( MV )
3/31/2016
I) 1 Y
AT A
AT A A T Y
1
OLS
Cov( OLS )
State Estimation
51
Automation Lab
IIT Bombay
Insights
Regression
52
26
31-03-2016
Automation Lab
IIT Bombay
Regression
53
Automation Lab
IIT Bombay
0.6
0.4
Y
Y
0.2
Model
Developed
using OLS
0
-0.2
-0.4
Data
Linear Model
Quadratic Model
-0.6
-0.8
1850
1900
1950
2000
Year
31-Mar-16
Regression
54
27
31-03-2016
Automation Lab
IIT Bombay
Statistics
Linear Model
OLS
8.187 4.168 10
2
15.56
AT A
1.8208 10
3 T
-8.074 10
-8.074 10
4.19 10
Quadratic Model
OLS
114.4
0.123 3.305 10
2
AT A
1.582 10
4.29 104
4.46 101
1.16 10
4.46 101
4.63 10 2
1.202 10
31-Mar-16
5 T
1.16 10 2
1.202 10
7
3.118 10
Regression
55
Automation Lab
IIT Bombay
Normalized residual : ~
vi
16
14
Histogram
of Quadratic model
residuals (normalized)
10
8
6
15
4
2
0
-3
-2
-1
0
1
Normalized Residual
Histogram
of Linear model
Residuals (normalized)
10
Frequency
Frequency
12
vi
0
-3
31-Mar-16
Regression
-2
-1
0
1
Normalized Residual
56
28
31-03-2016
Choice of Distribution
Automation Lab
IIT Bombay
Regression
57
Automation Lab
IIT Bombay
( i)
1 1
Yi
( i)
p p
...
for i 1,2,....n
or in other words
V ~ N 0n 1 ,
31-Mar-16
Regression
In
58
29
31-03-2016
Automation Lab
IIT Bombay
True
Regression
Line
Regression
59
Automation Lab
IIT Bombay
Consequences of Gaussianity
NV2 v2|
where
NVi vi|
vi
ln L
31-Mar-16
yi
1
2
exp
zi
...
1 1
n
ln 2
2
n
ln
2
Regression
vi2
2 2
i
p p
vi2
i 1
60
30
31-03-2016
Automation Lab
IIT Bombay
Alternatively
L
f V V |
n/ 2
exp
exp
1
n/ 2
ln L
n
ln 2
2
n
ln
2
1
1
V T 2I V
2
1
Y A T Y A
2 2
Y A
Y A
31-Mar-16
A T A Y
Regression
61
Automation Lab
IIT Bombay
OLS as ML Estimator
A T A A T Y
ML
OLS
~ N * ,
ML
AT A
Cov OLS
Regression
62
31
31-03-2016
Consequences of Gaussianity
Automation Lab
IIT Bombay
AT A A T Y * A T A AT V
MV
OLS
ML
A TA
~ N * , p
i
i
ii
31-Mar-16
Regression
63
Automation Lab
IIT Bombay
za / 2
i *i
pii 2
za / 2
Difficulty :
is unknown
Remedy : estimate
1
n
TV
Regression
64
32
31-03-2016
Automation Lab
IIT Bombay
Consider
T
V V
* T
vi2
V TV
i 1
2
n
1 T
V V
2
V TV
1
AT A
31-Mar-16
AT A
AT A
2
p
1 T
V V~
2
Regression
2
n p
65
Automation Lab
IIT Bombay
1
n
2
2
TV
i 1
1
p
i i
pii
Thus, (1
P t
i
31-Mar-16
/ 2, n p
2
n p
vi2
~
2
i 1
and
Y A
vi2 where V
/
pii
(/ )
i
n
~
p
2
n p
Z/
p
2
n p
~ Tn
Regression
/ 2, n p
ii
66
33
31-03-2016
Automation Lab
IIT Bombay
8.187 4.168 10
P
A A
2 2*
p22
3 T
; 2
15.56
-8.074 10
2
4.19 10
4.19 10
/ 2 ,140
2.763 10
4
2
t
P 3.622 10
31-Mar-16
4.168 10
~ T142
2.763 10
/ 2 ,140
0.95
1.977
/ 2 ,140
3
2 2*
2.763 10
1.8208 10 2
-8.074 10
*
2
1.8208 10
*
2
4.714 10
0.95
Regression
67
Automation Lab
IIT Bombay
Hypothesis Testing
*
1 1
31-Mar-16
...
*
i
*
p p
Null hypothesis
H0 :
*
i
Alternate hypothesis
H1 :
*
i
Regression
68
34
31-03-2016
Automation Lab
IIT Bombay
Hypothesis Testing
If H 0 is true then,
0
i
~ Tn
pii
pii
/ 2 ,n p
pii
Regression
69
Automation Lab
IIT Bombay
114.4
0.123 3.305 10
1.582 10
4.29 104
P
AT A
4.46 101
4.46 101
1.16 10
5 T
4.63 10
1.16 10
1.202 10
1.202 10
7
3.118 10
31-Mar-16
Null hypothesis
H0 :
*
3
Alternate hypothesis
H1 :
*
3
Regression
70
35
31-03-2016
Automation Lab
IIT Bombay
Hypothesis Testing
If H 0 is true then,
0
3
p33
3
1.582 3.118 10
3.305 10
p33
Since k
0.05
4.705 t0.025,139
4.705, p value
p33
~T142
1.582 3.118 10 11
we reject H 0
3
11
2 P T139
1.9772
4.705
Regression
71
Automation Lab
IIT Bombay
Mean Response
Consider model Y z i
Suppose we select z i
zi
Yi
* Vi
z0
v0, j
EY z0
z0
Y0
31-Mar-16
z0
Regression
72
36
31-03-2016
Automation Lab
IIT Bombay
Mean Response
E z0
z0
Y0
Y0
Thus we have
Y
Cov Y0
or
E z0
and E
Y0
Cov Y0
2
Y0
z0
z0
z0
T
AT A
zT0 *
T
z0
z0
Cov z 0
T
z0
Pz0
z0
Pz0
Regression
73
Automation Lab
IIT Bombay
Mean Response
Since, in practice, we rarely know true
2 z 0
where 2
Y
Y0
1
n
Y0
Thus, (1
P Y0
Pz0
TV
and V
V
z0
Pz0
( / )
Y A
Z/
2
n p
~ Tn
/ 2 ,n p
31-Mar-16
z0
Pz0
Y0
Regression
/ 2 ,n p
z0
Pz0
1
74
37
31-03-2016
Automation Lab
IIT Bombay
Future Response
Given the model at fixed z i
Y z0
z0
Y0
z0
* V0
Regression
75
Automation Lab
IIT Bombay
Future Response
Consider Y0 Y0
Since V~N( 0,
), it follows that
Y0 ~N zT0 * ,
and
Y0 ~N z 0
* ,
z0
Pz0
Regression
z0
Pz0
76
38
31-03-2016
Automation Lab
IIT Bombay
Future Response
1
z0
Y0
z0
Pz0
Y0
z0
/
z0
Pz0
Z
2
n p
n
Thus, for any 0
P
Y0
/ 2 ,n p
31-Mar-16
1 we have
T
z0
T
z0
~Tn
Pz0
/ 2 ,n p
Regression
77
Automation Lab
IIT Bombay
Prediction Interval
A 100 1
% prediction interval
Recall : 1
Y z 0 , then is :
/ 2 ,n p
z0
Pz0
31-Mar-16
/ 2 ,n p
z0
Regression
Y0
E Y0 ) is
Pz0
78
39
31-03-2016
Automation Lab
IIT Bombay
CI and PI
Regression
79
Automation Lab
IIT Bombay
c mx V
9.3941 ; P
A A
0.2219
-6.69 10
-6.69 10 4
2.347 10 6
Regression
80
40
31-03-2016
Automation Lab
IIT Bombay
35
y (gasoline mileage)
30
25
20
Note :
15
PI is narrowest
Mean Response CI
10
at x0
Prediction Interval
5
0
x and
increases as we
move away from x
100
150
31-Mar-16
450
500
Regression
81
Automation Lab
IIT Bombay
Variability Analysis
Given data set yi , z i : i 1,2,...., n
n
SSY
yi
i 1
n
y i
yi
y i
i 1
yi
y i
y i
2 yi
y i y i
i 1
SS E
SS R
Residuals
Regression
2 yi
i 1
31-Mar-16
yi yi
2 V i yi
i 1
Regression
82
41
31-03-2016
Automation Lab
IIT Bombay
Variability Analysis
T
Y A A
T
Y A A
0T
vi yi
i 1
Note
Models used in multilinea r regression
are typically of the form
Yi
i
2 2
i.e. z1 i
...
i
p p
Vi
1 for i 1,2,..., n
31-Mar-16
Regression
83
Automation Lab
IIT Bombay
Variability Analysis
1 1 ... 1 T
vi
i 1
n
vi y
i 1
SSY
Total Variability
vi
i 1
SS E
SS R
Regression
84
42
31-03-2016
Variability Analysis
Automation Lab
IIT Bombay
SS R
SYY
SS E
SYY
Regression
Variability Analysis
R2
SS R
SYY
85
Automation Lab
IIT Bombay
R2 1
Regression
86
43
31-03-2016
Automation Lab
IIT Bombay
Variability Analysis
An alternate measure of model fit
SS E /(n p )
2
Radj
1
SSY /( n 1)
SS E /( n
Regression
87
Automation Lab
IIT Bombay
1237.54,
R
SS R
955.72
0.77
6.6934,
0.6192,
SS R
2.5491
2
adj
0.6164
Quadratic Model
SSY
R
6.6934,
0.6715,
Note : 0
31-Mar-16
SS R
2
adj
R2
Regression
2.1989
0.6668
1
88
44
31-03-2016
Automation Lab
IIT Bombay
Regression
89
Automation Lab
IIT Bombay
Candidate Models
Linear Model : T
a bn
Quadratic Model : T
n2
250
200
Linear Model
T = 39*n - 170
Quadratic Model
T = - 3*n2 + 67*n - 220
150
100
50
Data 1
Linear Model
Quadratic Model
0
-50
-100
-150
-200
-250
0
31-Mar-16
4
5
6
n, No. of Carbon Atoms
Regression
10
90
45
31-03-2016
Automation Lab
IIT Bombay
6
4
6.3373
0
-2
-4
-6
-8
0
4
6
n, No. of Carbon Atoms
Quadratic Model : T
31-Mar-16
91
Automation Lab
IIT Bombay
Confidence Interval
1.9464
P
(A A)
Thus, 1
-0.9107
0.0893
*
i
2.5706
Regression
0
92
46
31-03-2016
Automation Lab
IIT Bombay
Hypothesis Testing
Null hypothesis
H0 :
*
3
Alternate hypothesis H1 :
0
3
3
If H 0 is true then,
~T
pii 0.4889 5
*
3
0.01, test of H 0 is to
Reject H 0 if
t
4.0321
0.4889 0.005, 5
Fail to reject H 0 Otherwise
3
-3.0238
Test Statistics : k
6.1845
0.4889 0.4889
Since k 4.0321, the null hypothesis is rejected
31-Mar-16
Regression
93
Automation Lab
IIT Bombay
Hypothesis Testing
p value
k
2 P T5
6.1845
0.0016
Linear Model
: R2
0.974
2
Radj
0.9698
Quadratic Model : R 2
0.997,
2
Radj
0.9958
31-Mar-16
Regression
94
47
31-03-2016
Analysis of Residuals
Automation Lab
IIT Bombay
Linear Model
Normalized
Residuals show
a pattern
2
1
0
-1
Quadratic Model
Normalized
Residuals are
Randomly spread
Between +/- 2
-2
-3
Linear Model
Quadratic Model
-4
-5
0
31-Mar-16
4
6
n, No. of Carbon Atoms
Regression
95
Automation Lab
IIT Bombay
Laboratory experimental
data on Yield obtained from a
catalytic process at various
temperatures and pressures
(n = 32)
Regression
96
48
31-03-2016
Automation Lab
IIT Bombay
75.8660
1.5
0.0757
0.5
3.2120
0
-0.5
-1
0.9415
-1.5
-2
-2.5
0
10
15
20
Sample No.
31-Mar-16
25
30
35
Regression
97
Automation Lab
IIT Bombay
Confidence Interval
P
(A A)
0.0
0.4000
*
i
2.0452
Regression
*
2
0
98
49
31-03-2016
Automation Lab
IIT Bombay
Hypothesis Testing
Null hypothesis
H0 :
*
2
Alternate hypothesis H1 :
0
2
2
If H 0 is true then,
~T
p22 0.0298 29
*
2
0.05, test of H 0 is to
t
2.0452
0.0298 0.025, 29
Fail to reject H 0 Otherwise
2
0.0757
Test Statistics : k
2.5439
0.0298 0.0298
Since k 2.0452, the null hypothesis is rejected
31-Mar-16
Regression
99
Automation Lab
IIT Bombay
Hypothesis Testing
p value
k
0.01, test of H 0 is to
t
0.0298 0.005, 29
Fail to reject H 0 Otherwise
Since k
Note : p value
31-Mar-16
2.7564
100
50
31-03-2016
k0e
E / RT
CA
Automation Lab
IIT Bombay
Pr
Re
Sh
Sc
Re
x
1 (
1) x
Thermodynamic correlations
RT
a
P
V b V T V b
RT
a
P
V b V2
B
ln Pv
A
T C
31-Mar-16
Regression
101
Nonlinear-in-Parameter Models
Automation Lab
IIT Bombay
x1
x2 .... xn
....
T
m
g ( x, * )
: Model residual,
* : True parameters
Parameter Estimation
Ordinary least square
OLS
Min
( i )2
i 1
Min
31-Mar-16
wi ( i ) 2
( wi
0 for all i )
i 1
Regression
102
51
31-03-2016
Automation Lab
IIT Bombay
Sy
Yi
for i 1,2,..., n
Yi
g x ,
~ N (0,
31-Mar-16
) for i 1,2,....n
Regression
103
Automation Lab
IIT Bombay
Consequences of Gaussianity
Under the assumption that
e2|
.... N
en|
where
1
2
N i ei|
ei
log L()
31-Mar-16
yi
exp
ei2
2 2
g x i ,
n
log(2 )
2
n
log(
2
Regression
1
2
ei2
i 1
104
52
31-03-2016
ln L
n
ln
2
g x i ,
yi
Automation Lab
IIT Bombay
i 1
ln L
Min
i 1
g x i ,
yi
Min
i 1
yi
g x i ,
OLS
Thus, under the Gaussian assumption, the OLS estimator turns out
to be identical to the Maximum Likelihood (ML) estimator.
31-Mar-16
Regression
105
Automation Lab
IIT Bombay
Gauss-Newton Method
Consider Taylor series based approximation
in the neighborhood of a guess solution,
g x i ,
g x i ,
g x i ,
g x ,
g x i ,
for i 1,2,...., n
Defining Yi( k )
Yi( k )
31-Mar-16
Yi
g x i ,
z( i ,k )
and z i ,k
Vi k
Regression
Vi
g x i ,
for i 1,2,..., n
106
53
31-03-2016
Automation Lab
IIT Bombay
Gauss-Newton Method
T
y1 k
.....
ynk
Y
z 1,k
........
T
z n ,k
k
Ak
Ak
v1k
.....
vnk
~ N 0,
2
k
estimate of
k
Ak
Ak
is
Ak
k 1
(tolerance) where
yi
g x i ,
i 1
31-Mar-16
Regression
107
Automation Lab
IIT Bombay
2
V
2
N
2 N
V
( N)
V
1
n
2
V
Regression
108
54
31-03-2016
Automation Lab
IIT Bombay
* .
Since
2 N
V
2
V
and
i
N
V
2
n p
/ 2,n p
N /
V
piiN
N
V
piiN
2
n p
*
i
Thus, 1
P i
, it follows that
2
n p
Z/
~Tn
piiN
*
i
31-Mar-16
/ 2, n p
*
i
piiN
Regression
109
Linearizing Transformations
Automation Lab
IIT Bombay
log Nu
log Pr
log Nu
log
rA
log Re
log Pr
log(k0 )
log
log Re
E 1
R T
1
1
x
n log(C A ) V
1/
Regression
110
55
31-03-2016
Automation Lab
IIT Bombay
Difficulty
The Original Model Residual ( ) cannot be transformed.
Min
i 1
Vi
2
i
i 1
Regression
111
Automation Lab
IIT Bombay
wiVi 2
WLS
wi
i 1
for i 1,2,..., n
g 0
g
i
i
Vi
g
i
i
1 2
Choose wi
g
i
31-Mar-16
Regression
112
56
31-03-2016
Automation Lab
IIT Bombay
WLS Example
Consider model
Y
f1 x
f2 x
Y
fp
...
ln
ln f1 x
....
ln f p
Min
i 1
T
Vi
ln
Yi
0,Vi 0
Min
i 1
31-Mar-16
1
Yi
ln yi
ln yi
....
ln Y
ln Yi
ln Yi
Vi
i
vi
ln Yi
Choose wi
yi2
Regression
113
Automation Lab
IIT Bombay
WLS Example
Thus, we solve for
T
Min
T
yi2 vi
Min
T
i 1
ln yi
yi2( ln yi
i 1
ln y1
YT
and A
y22 ....
ln y2
yn2 ,
.... ln yn
ln f1 x 1
.... ....
ln f1 x 2
.... .... ln f p 1 x 2
....
1
....
ln f1 x
ln f p 1 x 1
.... ....
n
....
.... .... ln f p 1 x
A T WA
Regression
AT W Y T
114
57
31-03-2016
Automation Lab
IIT Bombay
Regression
115
Automation Lab
IIT Bombay
0.0371,
0.777,
0.4553
OLS
OLS
OLS
0.0372,
0.7852,
0.4298
WLS
31-Mar-16
WLS
Regression
WLS
116
58
31-03-2016
Automation Lab
IIT Bombay
Parameter Estimation
Estimation using Gauss Newton Method
g x i ,
yi
Shi
Rei
Sci
for i 1,2,..., n
z
z
i ,k
Rei
g x i ,
i ,k
Sci
Initial Guess :
Generated using
the OLS solution
0.0371,
ln Rei
k
ln Sci
0.777,
0.4553
for i 1,2,..., n
31-Mar-16
Regression
117
Automation Lab
IIT Bombay
Parameter Estimation
0.0338,
0.7885,
0.4361
GN
Cov
GN
GN
95 % confidence intervals
Method
R2
: [1.06 10
5.70 10 2 ]
: [7.15 10
8.62 10 1 ]
: [3.07 10
5.65 10 1 ]
R2 (adjusted)
Linearized (OLS)
0.9795
0.9768
Linearized (WLS)
0.9797
0.9770
Gauss Newton
0.9798
0.9772
31-Mar-16
Regression
Note: R2
calculated
using the
original
model
118
59
31-03-2016
Automation Lab
IIT Bombay
Results of Regression
ln(Sh/Sc ) -ln(Sh/Sc0.44)
0.01
0.005
-0.005
-0.01
-0.015
7.5
31-Mar-16
8.5
ln(Re)
9.5
10
Regression
Results of Regression
119
Automation Lab
IIT Bombay
Regression
120
60
31-03-2016
Automation Lab
IIT Bombay
Michaelis-Menten Model
C
C
1
2
Regression
121
Automation Lab
IIT Bombay
Parameter Estimation
Linearizing Transformation :
1
r
C V
195.8 and
0.04841
1,OLS
1
ri
1
ri
1
i
Ci Vi
Vi
g( i )
Vi
i
2 ,OLS
1
i
ri
1
2
i
ri
1
r
Choose wi
ri4
208.67 and
0.05309
1,WLS
31-Mar-16
2 ,WLS
Regression
122
61
31-03-2016
Automation Lab
IIT Bombay
Parameter Estimation
212.68 and
0.06412
1,GN
Cov
10
48.26
0.044
2 ,GN
95 % confidence intervals
0.044
6.857 10
Method
R2
: [1.972 10 2 2.282 10 2 ]
: [4.567 10
R2 (adjusted)
Linearized (OLS)
0.9378
0.9315
Linearized (WLS)
0.9516
0.9468
Gauss Newton
0.9613
0.9574
8.257 10 2 ]
Note: R2
calculated
using the
original
model
The estimates obtained using the linearizing transformation and WLS are
relatively closer to the estimates obtained using Gauss Newton method.
31-Mar-16
Regression
123
Automation Lab
IIT Bombay
Michaelis-Menten Model
220
200
r, Reaction Rate
180
160
140
120
Experimental data
OLS using Linearized Model
Gauss-Newton using Nonlinear Model
WLS using Linearized Model
100
80
60
40
0
31-Mar-16
0.2
0.4
0.6
0.8
C, Concentration (ppm)
Regression
1.2
124
62
31-03-2016
Automation Lab
IIT Bombay
Summary
Regression
125
Automation Lab
IIT Bombay
Summary
The probabilistic viewpoint facilitates estimation of
Confidence intervals for the model parameters
Bounds on predicted outputs
31-Mar-16
Regression
126
63
31-03-2016
Automation Lab
IIT Bombay
Summary
Regression
127
Automation Lab
IIT Bombay
References
31-Mar-16
Regression
128
64
31-03-2016
Automation Lab
IIT Bombay
Thank You!
31-Mar-16
Regression
129
Automation Lab
IIT Bombay
31-Mar-16
Regression
130
65
31-03-2016
Automation Lab
IIT Bombay
Cramer-Rao Inequality
E W
W
*
* T
ln f Y Y |
ln f Y Y |
3/31/2016
or F
ln f Y Y |
T
State Estimation
131
Automation Lab
IIT Bombay
A*
Cov Y A
Cov V
This implies
f Y Y |
or f Y Y |
3/31/2016
exp
N A ,R
1
Y A
2
State Estimation
R 1Y A
132
66
31-03-2016
Automation Lab
IIT Bombay
ln f Y Y |
ln f Y Y |
T
AT R 1A
E W
AT R 1A
A T R 1A A T R 1 V
which implies
E MV
MV
3/31/2016
A T R 1A
State Estimation
133
Automation Lab
IIT Bombay
AT A AT V
MV
OLS
and R
E OLS
I, which implies
* OLS
AT A
OLS
State Estimation
134
67