Professional Documents
Culture Documents
Recursive Least Squares Parameter Estimation For Linear Steady State and Dynamic Models
Recursive Least Squares Parameter Estimation For Linear Steady State and Dynamic Models
Thomas F. Edgar
Department of Chemical Engineering
University of Texas
Austin, TX 78712
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 1
Outline
• Static model, sequential estimation
• Multivariate sequential estimation
• Example
• Dynamic discrete-time model
• Closed-loop estimation
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 2
Least Squares Parameter Estimation
∑ ( ax
ˆ −y )
k
* 2
min i i (1)
aˆ i =1
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 3
Simple Example
−1
k
k *
ˆak = ∑ xi 2 ∑ xi yi (2)
i
−1
i
−1
pk bk
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 4
Sequential or Recursive Form
To update aˆk based on a new data pt. (yi , xi), in Eq. (2) let
k
pk −1
= ∑ xi 2 = pk −1−1 + xk 2 (3)
i =1
and k
bk = ∑ xi y i * = bk −1 + xk y k * (4)
i =1
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 5
Recursive Form for Parameter Estimation
(
aˆk = aˆk −1 − K k xk aˆk −1 − y k *
) (5)
estimation error
where
( )
−1
K k = pk −1xk 1 + pk −1xk 2 (6)
( )
−1
pk = pk −1 − p k −1
2
xk 1 + pk −1xk
2 2
(7)
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 6
Estimating Multiple Parameters
(Steady State Model)
y = x a = a1x1 + a2 x2 + ⋯ + an xn (8)
T
( )
2
min k
∑ i − (non-sequential solution requires
T *
x ˆ
a y i
aˆ i =1 n x n inverse)
−1 −1
= P k −1 + x k x k
T
Pk (9)
B k = B k −1 + x k y k * (10)
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 7
Recursive Solution
( ) ( )
−1
a k = a k −1 − P k −1 x k 1 + x k P k −1 x k x k aˆ k −1 − y k * (11)
T T
ˆ ˆ
Kk estimation
error
−1
P k = P k −1 − P k −1 x k 1 + x k P k −1 x k x k P k −1
T T
(12)
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 8
Simple Example (Estimate Slope & Intercept)
Linear parametric model
input, u 0 1 2 3 4 10 12 18
output, y 5.71 9 15 19 20 45 55 78
y = a1 + a2 u
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 9
Sequential vs. Non-sequential Covariance Matrix vs. Number
Estimation of a2 Only (a1 = 0) of Samples Using Eq. (12)
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 10
Sequential Estimation of aˆ1 and aˆ2 Using Eq. (11)
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 11
Application to Digital Model and Feedback Control
y (t ) = a1y (t − 1) + a2 y (t − 2) + ⋯ + an y (t − n )
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 12
Recursive Least Squares Solution
y (t ) = Ψ T (t − 1)θ (t − 1) + ε (t ) (14)
where
Ψ T (t − 1) = [ y (t − 1), y (t − 2),. . . y(t − n ),
u(t − 1 − N ),. . . u(t − r − N ), 1]
θ T (t − 1) = [a1, a2 ,. . . an , b1, b2 , . . . br , d ].
min t 2
∑
Ψ (i − 1)θ (i ) − y (i )
T
(15)
θˆ i =1
"least squares"
(predicted value of y)
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 14
Recursive Least Squares Solution
Ψ T (t − 1)P (t − 1) (17)
P (t − 1)Ψ (t − 1)
K (t ) = (18)
1 +Ψ T (t − 1)P (t − 1)Ψ (t − 1)
P (t ) = [I − K (t )Ψ T (t − 1)]P (t − 1) (19)
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 15
Closed-Loop RLS Estimation
- covariance resetting
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 16
Enhance sensitivity of least squares estimation algorithms
with forgetting factor λ
t 2
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 17
Closed-Loop Estimation (RLS)
Perturbation signal is added to process input (via set point)
to excite process dynamics
large signal: good parameter estimates
but large errors in process output
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 18
3. use PRBS perturbation signal only when
estimation error is large and P is not small.
Vary PRBS amplitude with size of elements
proportional to tr (P).
4. P(0) = 104 I
Thomas F. Edgar (UT-Austin) RLS – Linear Models Virtual Control Book 12/06 19