me 233 review...batch least squares solution the least squares parameter estimate which solves...
TRANSCRIPT
![Page 1: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/1.jpg)
1
ME 233 Advanced Control II
Lecture 19
Least Squares
Parameter Estimation
![Page 2: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/2.jpg)
2
Least Squares Estimation
Model
Where
• observed output
• known and measurable function
• unknown but constant parameter
![Page 3: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/3.jpg)
3
Least Squares Estimation
Model
Where
measured output
![Page 4: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/4.jpg)
4
Batch Least Squares Estimation
Assume that we have collected k data sets:
We want to find the parameter estimate at instant k:
that best fits all collected data in the least squares sense:
collected data
kept constant in the summation
![Page 5: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/5.jpg)
5
Batch Least Squares Estimation
Defining the cost functional
is obtained by solving
![Page 6: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/6.jpg)
6
Batch Least Squares Solution
The least squares parameter estimate
which solves
Satisfies the normal equation:
![Page 7: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/7.jpg)
7
Normal Equation Derivation
![Page 8: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/8.jpg)
8
Normal Equation Derivation
Taking the partial derivative with respect to
For optimality, we therefore need
![Page 9: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/9.jpg)
9
Normal Equation Derivation
For optimality, we need
Therefore, we need
![Page 10: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/10.jpg)
10
Batch Least Squares Estimation
The solution of the normal equation
Is given by:
Pseudoinverse
![Page 11: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/11.jpg)
Moore-Penrose pseudoinverse
• Let A have the singular value decomposition
• Then the Moore-Penrose pseudoinverse of A is
11
orthogonal matrices
In MATLAB: pinv(A)
![Page 12: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/12.jpg)
12
Moore-Penrose pseudoinverse
Let and be its Moore-
Penrose pseudoinverse
Then has the dimension of and satisfies:
•
•
•
In this case, since
and are Hermitian
![Page 13: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/13.jpg)
13
Batch Least Squares Estimation
Assume that we have collected sufficient data
and the data has sufficient richness so that
has full rank.
Then,
![Page 14: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/14.jpg)
14
Recursive Least Squares (RLS)
Assume that we have collected k-1 sets of data and have
computed using
Then, given a new set of data:
We want to find in a recursive fashion:
![Page 15: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/15.jpg)
15
Recursive Least Squares Algorithm
Define the a-priori output estimate:
and the a-priori output estimation error:
The RLS algorithm is given by:
where F(k) has the recursive relationship on the next slide
![Page 16: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/16.jpg)
16
Recursive Least Squares Gain
The RLS gain is defined by
Therefore,
Using the matrix inversion lemma, we obtain
![Page 17: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/17.jpg)
17
Recursive Least Squares Derivation
Define the least squares gain matrix
Therefore,
![Page 18: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/18.jpg)
18
Recursive Least Squares Derivation
Notice that
![Page 19: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/19.jpg)
19
Recursive Least Squares Derivation
Therefore plugging the previous two results,
And rearranging terms, we obtain
![Page 20: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/20.jpg)
20
Recursive Least Squares Estimation
Define the a-priori output estimate:
and the a-priori output estimation error:
The RLS algorithm is given by:
![Page 21: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/21.jpg)
21
Recursive Least Squares Estimation
Recursive computation of
Therefore,
Using the matrix inversion lemma, we obtain
![Page 22: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/22.jpg)
22
Recursive Least Squares Estimation
Matrix inversion lemma:
• Multiply by on the right and on the left:
• Multiply by on the right:
![Page 23: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/23.jpg)
23
Recursive Least Squares Estimation
Matrix inversion lemma:
• Rearranging terms,
• Solving for
![Page 24: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/24.jpg)
24
Recursive Least Squares Estimation
Matrix inversion lemma:
• Plug
into
to obtain
![Page 25: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/25.jpg)
25
RLS Estimation Algorithm
Initial conditions:
A-priori version:
![Page 26: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/26.jpg)
26
RLS Estimation Algorithm
A-posteriori version (used to prove that ):
![Page 27: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/27.jpg)
27
RLS Estimation Algorithm
Notice that, since
And the a-priori error is
We obtain,
Define the parameter estimation error:
![Page 28: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/28.jpg)
28
RLS Estimation Algorithm
Thus, the a-priori output estimation error can be written as
then,
Similarly, define the a-posteriori output and estimation error :
![Page 29: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/29.jpg)
29
RLS Estimation Algorithm
Derivation of the RLS A-posteriori version:
Remember that,
Thus,
![Page 30: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/30.jpg)
30
RLS Estimation Algorithm
Multiplying by to the left of
to obtain,
Thus,
![Page 31: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/31.jpg)
31
RLS Estimation Algorithm
Therefore, from
We obtain,
![Page 32: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/32.jpg)
32
RLS with forgetting factorThe inverse of the gain matrix in the RLS algorithm is given by:
Its trace is given by:
which always increases when
![Page 33: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/33.jpg)
33
RLS with forgetting factor
Similarly, the trace of the gain matrix is given by
always decreases when
Problem: RLS eventually stops updating
![Page 34: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/34.jpg)
34
RLS with forgetting factor
Key idea: Discount old data, e.g. the term
is small when k is large since
We can modify cost function to “forget” old data
![Page 35: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/35.jpg)
35
RLS with forgetting factor
A-priori version:
Same as RLS
without
forgetting
factor
![Page 36: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/36.jpg)
36
RLS with forgetting factor
A-posteriori version (used to prove that ):
![Page 37: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/37.jpg)
37
RLS with forgetting factor
The gain of the RLS with FF may blow up
if is not persistently exciting
![Page 38: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/38.jpg)
38
General PAA gain formula
• Constant adaptation gain:
• RLS:
• RLS with forgetting factor:
(We talked about this case in the previous lecture)
![Page 39: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/39.jpg)
39
General PAA gain formula
![Page 40: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/40.jpg)
40
General PAA
A-priori version:
When , the parameter estimate equation simplifies to
![Page 41: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/41.jpg)
41
General PAA
A-posteriori version (used to prove that ):
![Page 42: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/42.jpg)
Additional Material
(you are not responsible for this)
• The Matrix Inversion Lemma
• Relationships for the General PAA
42
(these will be included in the next version…)
![Page 43: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/43.jpg)
Matrix Inversion Lemma
(simplified version)
• Since , we
know that
• The matrix inversion lemma (simplified
version) states that
43
![Page 44: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/44.jpg)
Matrix Inversion Lemma
(simplified version)
44
Proof:
Define
We want to show that
![Page 45: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/45.jpg)
Matrix Inversion Lemma 45
Proof:
If A, C, and (A+UCV) are invertible, then
![Page 46: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/46.jpg)
Relationships for General PAA46
Proof: We know that
By the Matrix Inversion Lemma
This simplifies to the stated expression for F(k+1)
![Page 47: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/47.jpg)
Relationships for General PAA47
Proof:
![Page 48: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/48.jpg)
Relationships for General PAA48
Proof:
![Page 49: ME 233 Review...Batch Least Squares Solution The least squares parameter estimate which solves Satisfies the normal equation: 7 Normal Equation Derivation. 8 Normal Equation Derivation](https://reader034.vdocuments.mx/reader034/viewer/2022042022/5e793dcfff79e0075b23ea54/html5/thumbnails/49.jpg)
Relationships for General PAA49
Proof (continued):
From the previous slide,