1ME 233 Advanced Control II
Lecture 19
Least Squares
Parameter Estimation

2

Least Squares Estimation
ModelWhere•

observed output•

known and measurable function•unknown but constant parameter3

Least Squares Estimation
ModelWhere

measured output

4Batch Least Squares Estimation
Assume that we have collected k data sets:collected data

We want to find the parameter estimate at instant k:that best fits all collected data in the least squares sense:

kept constant in the summation

5

Batch Least Squares Estimation
Defining the cost functional

is obtained by solving6Batch Least Squares Solution
The least squares parameter estimate
which solves

Satisfies the normal equation:

7Normal Equation Derivation

8Normal Equation Derivation

Taking the partial derivative with respect toFor optimality, we therefore need

9Normal Equation Derivation

For optimality, we need

Therefore, we need

10Batch Least Squares Estimation
The solution of the normal equation

Is given by:

Pseudoinverse

11Moore-Penrose pseudoinverse• Let A have the singular value decomposition
orthogonal matrices• Then the Moore-Penrose pseudoinverse of A isIn MATLAB: pinv(A)12Moore-Penrose pseudoinverse
LetandPenrose pseudoinverse
Then

be its Moore-

has the dimension of•••andIn this case, sinceare Hermitianand satisfies:

13

Batch Least Squares Estimation
Assume that we have collected sufficient data
and the data has sufficient richness so thathas full rank.
Then,

14

Recursive Least Squares (RLS)
Assume that we have collected k-1 sets of data and havecomputedusingThen, given a new set of data:

We want to findin a recursive fashion:

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

16

Recursive Least Squares Gain
The RLS gainis defined by

Therefore,

Using the matrix inversion lemma, we obtain

17

Recursive Least Squares Derivation
Define the least squares gain matrix

Therefore,

18

Recursive Least Squares Derivation
Notice that

19

Recursive Least Squares Derivation
Therefore plugging the previous two results,

And rearranging terms, we obtain20

Recursive Least Squares Estimation
Define the a-priori output estimate:

and the a-priori output estimation error:

The RLS algorithm is given by:

21

Recursive Least Squares Estimation
Recursive computation ofTherefore,

Using the matrix inversion lemma, we obtain

22

Recursive Least Squares Estimation
Matrix inversion lemma:• Multiply byon the right and• Multiply byon the right:

on the left:

23

Recursive Least Squares Estimation
Matrix inversion lemma:• Rearranging terms,• Solving for24

Recursive Least Squares Estimation
Matrix inversion lemma:• Plugintoto obtain

25

RLS Estimation Algorithm
A-priori version:

Initial conditions:

26

RLS Estimation Algorithm
A-posteriori version (used to prove that):

27

RLS Estimation Algorithm
Define the parameter estimation error:
Notice that, since

And the a-priori error isWe obtain,

28

RLS Estimation Algorithm
Thus, the a-priori output estimation error can be written as

Similarly, define the a-posteriori output and estimation error :

then,

29

RLS Estimation Algorithm
Derivation of the RLS A-posteriori version:

Remember that,

Thus,

30

RLS Estimation Algorithm
Multiplying by

to obtain,Thus,

to the left of

31

RLS Estimation Algorithm
Therefore, fromWe obtain,

32

RLS with forgetting factor
The inverse of the gain matrix in the RLS algorithm is given by:

Its trace is given by:which always increases when

33

RLS with forgetting factor
Similarly, the trace of the gain matrix is given byalways decreases when
Problem: RLS eventually stops updating

34

RLS with forgetting factor
We can modify cost function to “forget” old data

Key idea: Discount old data, e.g. the term

is small when k is large since

35

RLS with forgetting factor
A-priori version:

Same as RLS
withoutforgettingfactor

36

RLS with forgetting factor
A-posteriori version (used to prove that):

37

RLS with forgetting factor
The gain of the RLS with FF may blow up

if
is not persistently exciting(more on this later)

38

General PAA gain formula• Constant adaptation gain:(We talked about this case in the previous lecture)• RLS:• RLS with forgetting factor:

39

General PAA gain formula40General PAA
A-priori version:

When, the parameter estimate equation simplifies to41

General PAA
A-posteriori version (used to prove that):

Additional Material(you are not responsible for this)• The Matrix Inversion Lemma• Relationships for the General PAA(these will be included in the next version…)

42

43

Matrix Inversion Lemma(simplified version)• Sinceknow that, we• The matrix inversion lemma (simplifiedversion) states that

Matrix Inversion Lemma(simplified version)
Proof:
DefineWe want to show that44

45

Matrix Inversion Lemma
If A, C, and (A+UCV) are invertible, then

Proof:

46

Relationships for General PAA

Proof:

We know that

By the Matrix Inversion Lemma

This simplifies to the stated expression for F(k+1)

47

Relationships for General PAA

Proof:

48

Relationships for General PAA

Proof:

49

Relationships for General PAA

Proof (continued):
From the previous slide,