• No results found

We stress how the basic idea is to focus on the estimation of the state-variable candidates { thek-step ahead output predictors

N/A
N/A
Protected

Academic year: 2021

Share "We stress how the basic idea is to focus on the estimation of the state-variable candidates { thek-step ahead output predictors"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

A Least Squares Interpretation of Sub-Space Methods for System Identication.1

Lennart Ljung and Tomas McKelvey

Dept. of Electrical Engineering, Linkoping University S-581 83 Linkoping, Sweden,

Email: ljung@isy.liu.se, tomas@isy.liu.se.

CDC 1996, Kobe Japan

Abstract

So called subspace methods for direct identication of linear models in state space form have drawn con- siderable interest recently. The algorithms consist of series of quite complex projections, and it is not so easy to intuitively understand how they work. They have also deed, so far, complete asymptotic analysis of their stochastic properties. This contribution de- scribes an interpretation of how they work. It specif- ically deals how consistent estimates of the dynamics can be achieved, even though correct predictors are not used. We stress how the basic idea is to focus on the estimation of the state-variable candidates { thek-step ahead output predictors.

1 Introduction

A linear system can always be represented in state space form as

x(t+ 1) =Ax(t) +Bu(t) +w(t)

y(t) =Cx(t) +Du(t) +(t) (1) We shall generally letndenote the dimension ofxand let p be the number of outputs. To estimate such a model, the matrices can be parameterized either from physical grounds or as black boxes in canonical forms.

Then these parameters can be estimated using predic- tion error/maximum likelihood (ML) techniques. See, e.g. 5].

However, there are also other possibilities: So called subspace methods, 9], 10], 2], 12], 13] form an inter- esting alternative to the ML approach. The idea behind these methods can be explained as rst estimating the state vectorx(t), and then nding the state space ma- trices by a linear least squares procedure. These meth-

1

ThisworkwassupportedinpartbytheSwedish Research

Council for Engineering Sciences (TFR), which is gratefully

acknowledged.

ods are most often described in a geometric framework, which gives nice projection interpretations.

We shall in this contribution describe the subspace approach in a conventional least squares estimation framework. This give some complementary insight, which could be useful for development of alternative algorithms and for the asymptotic analysis.

2 The Basic Idea

Let us for a moment assume that not only areu and y measured, but also the sequence of state vectorsx. This would, by the way, x the state-space realization coordinate basis. Now, with known uy and x, the model (1) becomes a linear regression: the unknown parameters, all of the matrix entries in all the matrices, mix with measured signals in linear combinations. To see this clearly, let

Y(t) = x(t+ 1) y(t)



  = A B

C D



(t) = x(t) u(t)



 E(t) = w(t)

(t)



Then, (1) can be rewritten as

Y(t) = (t) +E(t) (2) From this all the matrix elements in  can be esti- mated by the simple least squares method. The covari- ance matrix forE(t) can also be estimated easily as the sample sum of the squared model residuals. That will give the covariance matrices forwand, as well as the cross covariance matrix. These matrices will, among other things, allow us to compute the Kalman lter for (1). Note that all of the above holds without changes for multivariable systems, i.e., when the output and input signals are vectors.

The problem is where to get the state vector sequence xfrom. For that we turn to basic realization theory, as

(2)

developed by 3], 1] and 7]. (See Appendix 4.A in 5]

for an account). The basic results are as follows (see Lemmas 4A.1 and 4A.2 in 5] and their proofs):

Let a system be given by the impulse response repre- sentation

y(t) =X1

j=0

(hu(j)u(t;j) +he(j)e(t;j)) (3) where u is the input and e the innovations. Let the k-step ahead predictors be dened by

y^(tjt;k) =X1

j=k

(hu(j)u(t;j) +he(j)e(t;j)) (4) Notice, and this is important, that the input between timet;kandtare ignored: no attempt to predict its values from past data is made. Dene

Y^r(t) =

0

B

@

y^(tjt;1)

^ ...

y(t+r;1jt;1)

1

C

A (5)

Then the following is true:

1. The system (3) admits an n-th order state space description if and only if the rank of ^Yr(t) is n for allr.

2. If rank ^Yn+1=nthennis the order of a minimal realization.

3. The state vector of any such minimal realization can be chosen as linear combinations of ^Yn that form a basis for ^Yrrn, i.e.,

x(t) =LY^n(t) (6) such thatx(t) spans also ^Yn+1(t).

Remark: "Rank", "basis" and "span" refer to the matrix obtained by the sequence of vectors YN = ^Yn(1)Y^n(2):::Y^n(N)]

Note that the common canonical state space represen- tations correspond toLmatrices that just pick out cer- tain rows of ^Yn. In general, we are not conned to such choices, but may pick L so that x(t) becomes a well conditioned basis.

It is clear that the facts above will allow us to nd a suitable state vector from data. The only remaining problem is to estimate thek-step ahead predictors. The true predictor ^y(t+kjt) is given by (4) and is a linear function ofu(i)y(i) it. For practical reasons the predictor is approximated so that it only depends ons past data,t;s+ 1it. It can then eciently be

determined by another linear least squares projection directly on the input output data. That is, set up the model

y(t+k) = (k `s)T's(t+1)+(k `s)T'~`(t+1)+(t+k) where (7)

's(t+1) = y(t)u(t):::y(t;s+1)u(t;s+1)]T (8) '~`(t+ 1) = u(t+ 1):::u(t+`)]T (9) Estimateandin (7) using least squares giving ^k `sN and ^Nk `s. Thek-step ahead predictor is then

y^s`(t+kjt) = (^Nk `s)T's(t+ 1) (10) For large enough s this will give a good approxima- tion of the true predictors. Let us also introduce the predictor that includes futureu:

ys`(t+kjt) = (^k `sN )T's(t+1)+(^Nk `s)T'~`(t+1) (11)

Remark: The complication with the term  has the following reason: The values of u(t+ 1):::u(t+k) a ecty(t+k), but should not be included in the predic- tor as demanded by (4). Ifuis not white noise, future inputs can be predicted from past ones. Without the term in (7) the rst term would attempt to include the (predicted) e ects from ~'(t+ 1) ony(t+k), thus giving the wrong result.

The method thus consists of the following steps:

Basic Subspace Algorithm (12)

1. Estimate ^ys`(t+kjt)k= 1:::rusing (10).

2. Form ^Yr(t) in (5)

3. Estimate its rank and determineLin (6)

4. EstimateABCD and the noise covariance ma- trices using (2)

What we have described now is the subspace projection approach to estimating the matrices of the state-space model (1), including the basis for the representation and the noise covariance matrices. There are a num- ber of variants of this approach. See among several references, e.g. 10], 2].

The approach gives very useful algorithms for model es- timation, and is particularly well suited for multivari- able systems. The algorithms also allow numerically very reliable implementations. They contain a number of choices and options, like how to choose `s and r,

(3)

and also how to carry out step number 3. There are also several "tricks" to do step 4 so as to achieve consis- tent estimates even for nite values ofs. Accordingly, several variants of this method exist. In the following sections we shall give more algorithmic details around this approach.

3 Ecient calculation of Y^r(t)

Let us now consider in somewhat more detail the sub- space algorithm (12). In fact, there are many variants of these algorithms and for a comprehensive treatment, we refer to 11]. Here we shall only point to the essen- tial features, and what elements account for the consis- tency. Recall the basic estimates (7){(11). The corre- sponding vectors of stacked predictors will be denoted by

Y^rs`(t+ 1) =

0

B

@

y^s`(t+ 1jt)

^ ...

ys`(t+rjt)

1

C

A (13)

and Yrs`(t+ 1) analogously Clearly, we can treat all predictors simultaneously: Let

Yr(t+ 1) =

0

B

@

y(t+ 1) y(t...+r)

1

C

A (14)

and stackrequations like (7) on top of each other:

Yr(t+ 1) = r`s's(t+ 1) + ;r`s'~`(t+ 1) +E(t+ 1) Estimate theprs(p+m) matrix  (together with ;)(15) by least squares and then form

Y^rs`(t+ 1) = ^r`sN 's(t+ 1) (16) Yrs`(t+ 1) = ^r`sN 's(t+ 1) + ^;r`sN '~`(t+ 1) (17) In fact, these quantities can be eciently calculated by projections using the data vectors, without explicitly forming the matrices ^ and ^;.

4 Choice of order and basis

We now have the (pr-dimensional) vector ^Yr(t) for t = 1:::N. If the system is of order n, this vec- tor sequence has rank n, and we should select a basis for it by forming linear combinations

x(t) =LY^r(t) (18) so that x becomes well conditioned. To nd the rank of fY^r(t)t = 1:::Ng we would form the (prN) matrix

Y

N = ^Yr(1):::Y^r(N)] (19)

We could then perform an SVD onYN:

Y

N=USVT (20)

For added "exibility and options, the SVD could be carried out on a weighted version ofYN:

W1YNW2=USVT (21) (HereW1is aprprmatrix, whileW2 isNN.) In the sequel, we will not use these weighting matrices, though. We would now examine the singular values in Sand put those below a certain threshold to zero. De- note the number of singular values above the threshold byn. LetS1be the uppernnpart ofS. The corre- spondingncolumns ofU will be denoted by U1 (thus aprn matrix), and the corresponding columns ofV areV1 so that

USVT U1S1V1T (22) There are now several candidates for matricesLin (18).

The most common choice seems to be

L= (U1S11=2)y (23)

5 Relationships for the true predictors

Suppose the true system can be described as (3), with itsk-step ahead predictor given by (4). An immediate consequence is that

y^(t+kjt) = ^y(t+kjt;1)+hu(k)u(t)+he(k)e(t) (24) Suppose now that the true system can be written as a di erence equation

A0(q)y(t) =B0(q)u(t) +C0(q)e(t) (25) where the polynomials in the shift operator are all of degree at mostn:

A0(q) =I+A1q;1+:::Anq;n (26) Then

y^(t+rjt)+A1y^(t+r;1jt)+:::Any^(t+r;njt) = 0 (27) for anyr > n. The proof is immediate: Take equation (25) witht=t+rand project it onto the space spanned byfe(s)u(s)stg(ignoring that future umight be predicted from past). The left hand side equals the left hand side of (27), while the right hand side is zero if r > n.

Let is now conne the discussion to the single output case. (It can be exactly transferred to the multi-output case, at the expense of somewhat more complex expres- sion.)

(4)

Now, look at ^Yr(t) made up of the true predictors.

Equation (27) means that any rowk > ncan be writ- ten as a linear combination of the rows above it. The rank of ^Yr(t) is thus at mostn, and a possible basis is formed by the n rst rows. Let us rst choose an L that picks these rows:

x(t) =LY^r(t) = ^Yn(t) (28) For componentk of this state vector we thus have

xk(t+ 1) = ^y(t+kjt)

= ^y(t+kjt;1) +hu(k)u(t) +he(k)e(t)

=xk +1(t) +hu(k)u(t) +he(k)e(t) xn(t+ 1) = ^y(t+njt)

= ^y(t+njt;1) +hu(n)u(t) +he(n)e(t)

=;a1y^(t+n;1jt;1);:::;any^(tjt;1) +hu(n)u(t) +he(n)e(t)

=;a1xn(t);:::;anx1(t) +hu(n)u(t) +he(n)e(t)

using (24) and (27). In matrix notation we have x(t+ 1) =Acx(t) +

0

B

B

@

hu(1) hu(2) hu...(n)

1

C

C

Au(t) +

0

B

B

@

he(1) he(2) he(...n)

1

C

C

Ae(t) y(t) =Ccx(t) +hu(0)u(t) +he(0)e(t)

where

Ac=

0

B

B

B

B

@

0 1 0 ::: 0

0 0 1 ::: 0

... ... ... ...

0 0 0 ::: 1

;an ;an;1 ;an;2 ::: ;a1

1

C

C

C

C

A

Cc = (1 0 0 ::: 0)

This is of course the standard observability canonical form. See 4].

Suppose now that we pick another L in (28). Let us

rst note that, since the rst nrows form a basis, we can always write

Y^r(t) =FY^n(t) =Fx(t)

for someprnmatrixF. Choosing an arbitrary matrix Lto choose the basis gives

x~(t) =LY^r(t) = (LF)x(t) (29) This shows that the new state vector will be a linear map of (28), so carrying out the update equations for ~x will give us the same system, in a coordinate basis that corresponds to the similarity transformation (LF).

6 Consistency as the model order tends to innity

To investigate consistency { somewhat heuristically { we shall assume that the number of dataN, is so large that all estimates are e ectively equal to their limiting values. In this section we shall also assume that the model ordersused in (7) is so large that the in"uence ony(t+k) from input-output data older than t;s is negligible. Alternatively, we may assume that the true system can be described by an ARX-model of orders. We shall also assume that the future input horizon` in (7) is chosen so that `  r, so that all e ects of inputs for t+ 1  i  k on y(t+k) for k up to r are properly accounted for. All this means that (7) is a model structure that is capable of describing the k-step ahead predictors correctly. The estimates (10) will thus be the correct predictors.

For large N and large s, the vector ^Yr(t) will conse- quently have all the properties (24) { (29). The algo- rithm will therefore give the correct system description under these conditions. Note that this is true for all choices ofLthat determine a basis for ^Yr(t).

This approach can be seen as a variant of the two-stage methods described in Section 10.4 of 5]: First use a high order ARX-model to pick up the correct system dynamics (including noise dynamics), then reduce the model order by forcing the higher order model to t a lower order one. In the Mayne-Firoozan method, 6] the innovations are used explicitly for this. In the subspace method, the predictions are used in a related way.

7 Estimating onlyA and C

We can make the discussion in the previous section more focussed on the essential matters by concentrat- ing on estimating A and C. Once these matrices are

xed, estimating B and D in (1) is a linear regression problem, even for unknownx. (See (53), below.) We then lump the dependencies of future inputs into a term ~'and set up a regression like

x(t+ 1) y(t)



= A

C



x(t) + '~`+1(t) (30) If we use thek-step ahead predictors ^y(t+kjt) for the statesx as in (28), we then nd { exactly as above { thatAandCwill be consistently estimated if only the following three relationships hold:

y^(t+kjt) = ^y(t+kjt;1) + 1'~`+1(t)

+(t) (31)

y^(t+n+ 1jt) =;a1y^(t+njt):::;any^(t+ 1jt) + + 2'~`+1(t) (32)

(5)

rankfY^n(t+ 1)g=n (33) for some i and a sequence (t) that is uncorrelated with ~'`+1(t) and 's(t). These relationships clearly hold for the true k-step ahead predictors as veried by (24),(27) and (6).

8 Modications to achieve consistency even for nite model orders

The subspace methods can go one step further, and achieve consistent estimates of the ABC, and D- matrices, even without letting the model order stend to innity. This is technically more involved. The basic idea is to establish that the key relations (31) and (32) will hold also for the approximate predictors ^ys`(t+kjt) and ys`(t+kjt) (dened by (10) and (11)), if only we play carefully with the "subscript orders"sand`. We start by establishing two lemmas for these quanti- ties, which show properties analogous to Levinson type recursions.

Lemma 1 Suppose that the true system can be de- scribed by (25) withnas the maximal order of the poly- nomials, and that the system operates in open loop, so that e and u are independent. Let ^ys`(t+kjt) and ys` (t+kjt) be the limits of (10) and (11) asN !1. Then for anys, any r > nand any`r

y^s` (t+rjt)+A1y^s`(t+r;1jt)+:::+Any^s` (t+r;njt) = 0 and (34)

ys` (t+rjt)+A1ys`(t+r;1jt)+:::+Anys`(t+r;n)

=B0u(t+r)+B1u(t+r;1)+:::+Bnu(t+r;n) (35)

Proof:Consider the equation (7). Suppress the indices

`andsand let

(t+ 1) = ~'`(t+ 1) 's(t+ 1)



(36) Let (t+ 1) be any vector of the same dimension as (t+ 1) such that

E (t+ 1)C0(q)e(t+r) = 0 (37) Suppose that k and k are estimated from (7) using the IV-method with instruments (t+ 1). Then the limiting estimate are given by

k

k



T = Ey(t+k) T(t+1) E (t+1) T(t+1)];1 (38) Note also that we can write, for some 0

B0(q)u(t+r) = 0T'~`(t+ 1) (39)

ifr > nand`r, Hence

r

r



T +A1 r;1

r;1



T +:::+An r;n

r;n



T =

= E (A0(q)y(t+r)) T(t+ 1)] E (t+ 1) T(t+ 1)];1

= E (B0(q)u(t+r) +C0(q)e(t+r)) T(t+ 1)]

 E (t+ 1) T(t+ 1)];1

= 0T E~'(t+ 1) T(t+ 1)] E~'(t+ 1) T(t+ 1)

E'(t+ 1) T(t+ 1)



;1

= 0T(I 0) = ( 0T 0)

Here we used (39) and (37) in the third last step, and the denition of a matrix inverse in the second last step.

Since

ys`(t+kjt) = k

k



T (t+ 1) y^s`(t+kjt) = k

k



T 0

'(t+ 1)



we just need to multiply the above expression with (t+ 1) to obtain the stated result.

It now only remains to show that (t+ 1) = (t+ 1) obeys (37), so that the result holds for the least squares estimates. The vector (t+ 1) contains a number of inputs, which are uncorrelated with the noise, under open loop operation. It also contains y(t) and older values ofy, which are uncorrelated with C0(q)e(t+r) if r > n, since the order of C0 is at most n. This concludes the proof.

Corollary: Suppose that the true system is given by A0(q)y(t) =B0(q)u(t) +v(t) (40) and that the parameters of the predictors are estimated from (7) using an instrumental variable method with instruments (t+1) that are uncorrelated withv(t+r).

Then the result of the lemma still holds.

Notice that the Lemma holds for anys, which could be smaller thann.

Lemma 2 Let y and ^y be dened as above. (These thus depend on N, but this subscript is suppressed.) Then for anyNskand any`

y(t) = ys`+1(tjt;1) +(t) (41) ys+1`(t+kjt) = ys`+1(t+kjt;1) + ~hs+1`k N (t) (42) y^s+1`(t+kjt) = ^ys`+1(t+kjt;1) +bs+1`k N u(t) +

+ k Ns`T '~`(t+ 1) + ~hs+1`k N (t) (43) where (t) (same in the three expressions) is uncorre- lated with's(t)u(t) and ~'`(t+1)t= 1:::N. If the input sequencefu(t)gis white, then

bs+1`k N !hu(k) and k Ns`!0 asN !1 (44)

(6)

wherehu(k) is the true impulse response coecient.

Proof: Let

1(t+ 1) = '~`(t+ 1) 's+1(t+ 1)



and

2(t+ 1) = ~'`+1(t) 's(t)



The vector 2(t+ 1) contains the values u(i)i=t+

`:::t;s and y(i)i = t;1:::t;s. The vector 1(t + 1) contains the same values, and in addition y(t). Deneas the residuals from the least squares t

y(t) =L2 2(t+ 1) +(t)

so that(t)? 2(t+ 1). With this we mean that

N

X

t=1

(t) 2(t+ 1) = 0

Note that (t) will depend on ` and s, but not on k. Moreover, by denition we nd that

L2 2(t+ 1) = ys`+1(tjt;1) (45) so the rst result of the lemma has been proved.

Let

3(t+ 1) = 2(t+ 1)

(t)



It is clear that 1 and 3span the same space, so that for some matrixR(built up using L2) we can write

1(t+ 1) =R 3(t+ 1) Now write

y(t+k) = ^K1 1(t+ 1) +"(t+k) (46) where ^K1 is the LS-estimate, so that

"(t+k)? 1(t+ 1)

Let K^1R= (K2 K3) (47)

Clearly, by denition

ys+1`(t+kjt) = ^K1 1(t+ 1) = ^K1R 3(t+ 1)

=K2 2(t+ 1) +K3(t) (48) Now rewrite (46) as

y(t+k) = ^K1 1(t+ 1) +"(t+k)

= ^K1R 3(t+ 1) +"(t+k)

=K2 2(t+ 1) +K3(t) +"(t+k)

Both(t) and "(t+k) are orthogonal to 2(t+ 1), so K2must be the least squares t ofy(t+k) to 2(t+1), which means that

ys`+1(t+kjt;1) =K2 2(t+ 1) (49) Comparing (48) with (49) we have shown (42),with

~hs+1`k N =K3). Moreover,

ys+1`(t+kjt) = ^ys+1`(t+kjt) + 1'~`(t+ 1) ys`+1(t+kjt;1) = ^ys`+1(t+kjt;1) + 2'~`+1(t)

= ^ys`+1(t+kjt;1) +bku(t) + 3'~`(t+ 1)

(withbk being the rst column of 2). Applying (42) to the two left hand sides of these expressions, we have also proved (43) (with k Ns`T = 2; 3 andbs+1`k N = bk. The proof of (44) is straightforward and omitted here, since we will not need this result for the ensuing discussion. This concludes the proof of Lemma 2.

9 A consistent nite order Subspace Method

Based on Lemmas 1 and 2, several di erent subspace methods can be derived that consistently estimate the ABC and D- matrices of a state-space model, even without letting the underlying model order tend to in-

nity. We here give just one such algorithm, which is a slight variant of the N4SID-method of 8]. It has the same rst steps as the basic algorithm (12) of Section 7.5.

Algorithm SUBSP

1. Estimate Yrs+1`(t), Yrs`+1(t) and ^Yrs`+1(t) using (16) and (17) with`r >nwhere nis an upper bound of the system order.

2. Estimate the rank of ^Yrs`+1 and determine L in (6), e.g. as in (19){(23)

3. Introduce

x(t+ 1) =LYrs+1`(t+ 1) (50) x(t) =LYrs`+1(t) (51) 4. EstimateAC and in

x(t+ 1) y(t)



= A

C



x(t) + '~`+1(t) (52) using the least squares method. (Notice the di er- ence with (30). We here use "pseudostates"xand

xto make use of the subscript di erences required to apply Lemma 2.)

References

Related documents

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

Generally, a transition from primary raw materials to recycled materials, along with a change to renewable energy, are the most important actions to reduce greenhouse gas emissions

För att uppskatta den totala effekten av reformerna måste dock hänsyn tas till såväl samt- liga priseffekter som sammansättningseffekter, till följd av ökad försäljningsandel

Coad (2007) presenterar resultat som indikerar att små företag inom tillverkningsindustrin i Frankrike generellt kännetecknas av att tillväxten är negativt korrelerad över

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Av tabellen framgår att det behövs utförlig information om de projekt som genomförs vid instituten. Då Tillväxtanalys ska föreslå en metod som kan visa hur institutens verksamhet

Regioner med en omfattande varuproduktion hade också en tydlig tendens att ha den starkaste nedgången i bruttoregionproduktionen (BRP) under krisåret 2009. De

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större