Académique Documents
Professionnel Documents
Culture Documents
Lecture 4
Derivation of recursive least squares Suppose we have all the data collected up to time n. Then consider the formation of the regression matrix (n) as
(n) =
T (1)
and output vector y(n) = [y(1), ..., y(n)]T . Thus the least squares solution is (n) = [(n)T (n)]1(n)T y(n) When a new data point comes, n is increased by 1, the least squares solution as above requires repetitive calculation including recalculating the inverse (expensive in computer time and storage) Lets look at the expression (n)T (n) and (n)T y(n) and dene P1(n) = (n)T (n)
2
T (2) . . . T (n)
Lecture 4
=
t=1 n1
(t)T (t)
=
t=1 n1
Lecture 4
P1(n) = P1(n 1) + (n)T (n) (1) (n)T y(n) = (n 1)T y(n 1) + (n)y(n) (2)
The least squares estimate at time n (n) = [(n)T (n)]1(n)T y(n) = P(n)(n)T y(n) = P(n) (n 1)T y(n 1) + (n)y(n) (3) Because the least squares estimate at time (n 1) is given by (n 1) = P(n 1)(n 1)T y(n 1), so P1(n 1)(n 1) = (n 1)T y(n 1) (4) Substitute (4) to (3)
4
Lecture 4
(n)
(5)
P(n) = (P1(n 1) + (n)T (n))1 (6) K(n) = P(n)(n) (7) (n) = (n 1) + K(n)(n) (8)
Yet we still require a matrix inverse to be calculated in (6). However this can be avoided through matrix inversion lemma (to be derived next week).
5
Lecture 4
Assignment http: //www. personal. reading. ac. uk/ sis01xh / teaching / CS3assignment.htm The assignment has three parts, all relating to recursive least squares system identication. Part A develops software to do recursive least squares identication. Part B provides some real data and allows you to identify a mechanical master robot of a master/slave tele-manipulator. Part C (worth 20% of the marks) extends the RLS algorithm to either include instrument variables or a PLS noise model based on the Moving Average Model, or both. You can treat part C as optional. It is recommended that you use Matlab for the assignment, although you will not be penalised for using other programming languages.
6
Lecture 4
Files: Matlab and data les are available at WWW address: http://www.personal.rdg.ac.uk/ sis01xh / teaching /Sysid /datales/Datasets.htm Here you will also nd the les loadass.m (will load the data into a suitable vector) crib.m (available as a skeleton for your program) dord2.m (a way of generating a test system) Copy the programs and the data set (as specied by your name) into an appropriate directory and run it under Matlab. Enter a le name and you will then have a variable y in the Matlab workspace containing the corresponding response data. Use the skeleton code for recursive least squares estimator (see crib.m)
7