• Non ci sono risultati.

Identification in Practice

N/A
N/A
Protected

Academic year: 2021

Condividi " Identification in Practice"

Copied!
25
0
0

Testo completo

(1)

Systems and Control Theory Lecture Notes

Laura Giarr´ e

(2)

Lesson 22: Identification in Practice, Model Validation

 Identification in Practice

 Model Validation

(3)

Identification in Practice

 What do we know?

 We know methods for identifying models inside a priori given model structures.

 How can we use this knowledge to provide a model for the plant, the process noise, with reasonable accuracy?

 Pretreatment of data: - Remove the bias (may not be due to inputs) - Filter the high frequency noise

 Introduce filtered errors. Emphasize certain frequency range.

(4)

The Identification Experiment

WƌŝŽƌŝ/ŶĨŽƌŵĂƚŝŽŶ

ůĂƐƐŽĨ

ŵŽĚĞůƐ

^ĞůĞĐƚŝŽŶ

^ĞůĞĐƚŝŽŶ

ƌŝƚĞƌŝĂ

ĞƐŝŐŶƚŚĞ

džƉĞƌŝŵĞŶƚ

ůŐŽƌŝƚŚŵƚŽĞƐƚŝŵĂƚĞ

ƚŚĞŵŽĚĞů

ŽůůĞĐƚĚĂƚĂ s;nj͕TͿ

D

sĂůŝĚĂƚŝŽŶ P;TͿ

EK

z^

΂nj΃

(5)

Parametric Estimate

 Constrained minimum

min θ V (θ) = min

θ∈Θ

1 N

 n k=1

ε 2 (k|θ) ˆθ = arg min

θ∈Θ V (θ)

 ARX:

ε(k|θ) = y(k) − φ T (k)θ



∂V

∂θ = −2 N

 n k=1

(y(k) − φ T (k)θ) 2

 2 V

∂θ 2 = −2 N

 n k=1

(φ(k)φ T (k)) ≥ 0

(6)

LS algorithm

 Solution: LS algorithm

 (φφ T )θ =  φy

 Then

ˆθ = ( 

φφ T ) −1  φy

 Notice that if we multiply by 1

N the two members, then we have the sample estimation of the expected value:

ˆθ = (E[φφ T ]) −1 E [φy]

 Moreover,

V (θ) = 1 N

 (ε(k|θ) 2 )

represents the sample mean value and it converges (for

N → ∞) to E[ε(k|θ) 2 ]

(7)

Identifiability

 Structural Identifiability: A class of models

M = {μ(θ) : θ ∈ Θ ⊂ R n } is structurally identifiable in θ 0 if {∀θ ∈ Θ : G(z, θ) = G(z, θ 0 ), H(z, θ) = H(z, θ 0 )} then θ = θ 0

 Theorem: A class of model M = {μ(θ) : θ ∈ Θ ⊂ R n } is

structurally identifiable in θ 0 if G (z, θ 0 ) and H(z, θ 0 ) do not

present pole/zero cancellation.

(8)

Identifiability

 Experimental Identifiability is guaranteed when R = E[φ(k)φ T (k)] is invertible (definite positive).

 Theorem: Considering a generic regressor, a white process as

input is guaranteeing experimental identifiability.

(9)

Persistent Excitation

 Definition:

A quasi-stationary input, u, is persistently exciting (p.e.) of order n if the matrix

¯R n =

 R u (0) . . . R u (n − 1) R u (n − 1) . . . R u (0)



is positive definite.

 Theorem:

Let u be a quasi-stationary input of dimension n u , with spectrum Φ u (ω). Assume that Φ u (ω) > 0 for at least n distinct frequencies. Then u is p.e. of order n.

 Theorem (Scalar):

If u is p.e of order n → Φ u (e ) = 0 for at least n-points.

(10)

Lemma

For an ARX system, and a regressor with past inputs and outputs φ(k) = [−y(k − 1) . . . − y(k − n a ) u(k − d) . . . u(k − d − n b + 1)]

then R > 0 if

1) A,B do not have common roots (no hidden modes)

2) u (k) is PE of order n a + n b = dim(φ) = dim(θ)

(11)

Identification toolbox (LJUNG)

 ARX(na,nb,nk):

where na is the number of parameters in A(z), nb is the number of parameters in B (z) and nk is the I/O delay (usually equals to 1)

 ARMAX(na,nb,nc,nk):

where nc is the number of parameters in C (z)

 OE(na,nf,nk)

 BJ(nb,nc,nd,nf,nk)

(12)

Input Signals

 Commonly used signals: Step function; Pseudorandom binary sequence (PRBS); Periodic signals: sum of sinusoids

 Notion of sufficient excitation Conditions !

 A Pseudorandom binary sequence: a periodic signal that switches between two levels in a certain fashion

Levels = ± on a period M

 The spectrum of PRBS approximate WN as distributions.

(13)

Model structure selection

Pick a model structure (or model structures):

 Which one is better?

 How can you decide which one reflects the real system?

 Is there any advantage from picking a model with a large number of parameters, if the input is exciting only a smaller number of frequency points?

 What are the important quantities that can be computed

directly from the data (inputs & outputs), that are important

to identification?

(14)

Model class selection problem

 Find the model class whose optimal model is the Best one for our purpose.

 Three steps:

1. A priori knowledge and data analysis

2. Comparing different model structures

3. Residual analysis

(15)

A priori knowledge

 Exploit physical knowledge on the system (Grey-Box modeling)

 Analyze R y N (τ) and R yu N (τ) to understand if we need to insert

the therms y (k − τ) or u(k − τ) in the model.

(16)

Comparing different model structures 1

 Simplest idea: use the BEST FIT as a measure of the quality of the model:

V (ˆθ, Z N ) = 1 N

 N t=1

(y(k) − ˆy(k|k − 1)) 2

 Although V (ˆθ, Z N ), with ˆθ ∈ R d is not monotonically

decreasing in d , the knee of the curve V vs. d suggests a good trade off between fit of the data (= predictive ability of the model) and the model complexity (= number of parameters)

 Recall that Parsimony is always a specification of the overall

design.

(17)

Comparing different model structures 2

(18)

Comparing different model structures 3

 A more Quantitative approach: Account for the bias-variance trade off by optimizing a functional:

J (ˆθ) = V (ˆθ, Z N )(1 + U(d))

 U (d) is a monotonically decreasing function of d.

 Possible choices of U (d);

1. Akaike Information criterion (AIC):

U (d) = 2d/N 2. Minimum Description Length (MDL):

U (d) = log (N) N d

 Use a longer prediction horizon and compute J l = N 1  N

k=1 (y(k) − y(k|k − l)) 2

 Compute the simulation error: if ˆy s (k) = G(z, ˆθ), then J s =

 N

(y(k) − ˆy s (k)) 2

(19)

Comparing different model structures 4

 Compare different model classes according to the following measure of FIT:

FIT = 100



1 J

N 1

 N

k=1 (y(k) − ¯y) 2



 where J is the functional used for the selection test, such as V , J s or J l

 ¯y = N 1  N

k=1 y (k) is the average value.

 Notice that for OE models J s = V

(20)

Simulation different than Validation tests

 The set of data used for validation need to be different than the set use for simulation :

 Suppose two data sets are available (if not divide the set in two parts):

Z 1 N = {u 1 (1), y 1 (1), . . . , u 1 (N), y 1 (N)}

Z 2 N = {u 2 (1), y 2 (1), . . . , u 2 (N), y 2 (N)}

 IDEA:



use Z 1 N for Identification



use Z 2 N for Validation

(21)

Residual Correlation Analysis 1

 Model class: y (k) = G(z)u(k) + H(z)e(k)

 Assumption: there exist G o (z) and H o (z) such that the data Z N = {u(k), y(k)} N k=1 satisfy:

y (k) = G o (z)u(k) + H o (k)e(k) with e ∼ WN (0, σ e 2 )

 Then:

(k) =y(k) − y(k|k − 1)

= 1

H o (z) y (k) − G o (z)

H o (z) u (k) (∗)

= 1

H o (z) (G o (z)u(k) + H o (z)e(k)) − G o (z)

H o (z) u (k) (assumption)

=e(k)

(*) If the identified model is equal to the true one:

(22)

Residual Correlation Analysis 2

 Then if the assumptions holds, the residuals is a white process with zero mean and variance σ e 2

 This means:

R  (τ) =

 σ e 2 (τ) τ = 0 0 τ = 0

 Similarly if u (k) is a deterministic input:

R u (τ) = E[ (k + τ)u(k)] = E[ (k + τ)]u(k) = 0 ∀τ

(23)

Residual Correlation Analysis 3

 Key idea: Compute the sample variance function ˆ R  N (τ) and ˆR u N (τ) and check if they are compatible with the theoretical properties.

 TEST:

For τ = 1, 2, . . . M check if ˆR  N (τ) ∈ [−2.58 σ N

e2

2 .58 σ N

e2

] where σ e 2 = V (ˆθ, Z N ) = N 1 

k=1 N 2 (k)

 A similar result holds for the cross-covariance ˆ R u N (τ).

(24)

Examples

 use two systems:

S1 :y(k) − 0.8y(k − 1) = u(k − 1) + e(k)

S2 :y(k) − 0.8y(k − 1) = u(k − 1) + e(k) − 0.8e(k − 1)

 Objective: Study the mechanics of system identification

 Introduce linear regressions to minimize prediction error

 Study the importance of selecting the correct model structure

 Study the importance of selecting the input

 Analysis: Is the theory consistent with the observations?

(25)

Thanks

DIEF- [email protected]

Tel: 059 2056322

Riferimenti

Documenti correlati

Solution proposed by Roberto Tauraso, Dipartimento di Matematica, Universit`a di Roma “Tor Vergata”, via della Ricerca Scientifica, 00133 Roma,

[r]

[r]

[r]

[r]

However, the number of studies directly focusing on reputation is very limited for these businesses, despite the opinion that there is a close relationship between the continuity

For questions requiring calculations, full credit is given only if necessary steps of the calculations are

This paper reports an experimental study of transient natural convection heat and mass transfer between two large cylindrical reservoirs connected through a short