A brief motivation to study Subspace System...
Transcript of A brief motivation to study Subspace System...
A brief motivation to studySubspace System Identification
Henri P. Gavin
Department of Civil & Environmental EngineeringDuke Univ.
2017-08-30
What is System Identification?
What is System Identification?
I the practice of extracting models from measurementsI a sub-set of parameter estimation specific to
dynamical systemsI modern methods (1990’s to today) (e.g., ERA and SSID)
• linear systems theory• geometric perpsective of projections
. . . as opposed to least sqaures• leverages bases of linear vector spaces computed from
matrix decompositions e.g., QR (LQ) and SVD• a projection of matrices of data onto space of models• characterized by direct matrix operations
. . . no iterative guess-and-check• multi-input, multi-output (MIMO) systems• the order of the system is contained in the data
. . . high order models (a dozen or more states)
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 1 / 44
Find a dynamic model from within the measurementsMeasurementssequence of inputs u(k)
sequence of outputs y(k)
Models
I MIMO FIR filters
y(k) =∑
i
H(i)u(k − i)
I state-space models
x(k + 1) = A x(k) + B u(k) + w(k)
y(k) = C x(k) + D u(k) + v(k)
I transfer functions
y(z) = H(z) u(z)
I nonlinearities . . . restricted to . . .u(k) = f(u(k))y(k) = g(y(k))
. . . x(k + 1) is linear in x(k)
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 2 / 44
dynamical systems
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 3 / 44
Geometric interpretation of ordinary least squares— fit a two-term polynomial to three data pointsI model equation ymodel = a1x + a2x2 ,I using values of the independent variable (error free, by assumption)
xT = [0.6,−0.7, 0.9] ... (and (x2)T = [0.36, 0.49, 0.81])I and using values of the dependent variable (measured, with some error)
yTdata = [0.2, 0.3, 1.2]
I model basis ... ymodel = [x, x2]a = Xa ,where the columns of X form a basis of the model.
I what are the OLS estimates for model parameters, a1, a2?I ordinary least squares parameter estimates ... a = [XT X ]−1(XT ydata)
I ordinary least squares model ...ymodel = Xa = (X [XT X ]−1XT )ydata = P⊥X ydata
where P⊥X is the orthogonal projection matrix onto the basis spanned by thecolumns of X . (It’s idempotent.)• The orthogonal projection of the data onto the space of models
minimizes the Euclidean length of ydata − ymodel .• The shortest distance from a point to a plane.
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 4 / 44
Geometric interpretation of ordinary least squares— fit a two-term polynomial to three data points
-0.5
0
0.5
1
1.5
-1 -0.5 0 0.5 1
y
x
data
modela1=0.223, a2=1.030
-0.4 -0.2 0 0.2 0.4 0.6 0.8 1-0.6-0.4-0.200.20.40
0.2
0.4
0.6
0.8
1
1.2
3
1
23
b1
b2
ydataymodel
err
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 5 / 44
projections and the identification of LTI system dynamics
I The outputs y are linear in the states x and the inputs u. y = Cx + DuI But the states are not measured!I This is the fundamental problem in LTI system ID.I How do we compute a state sequence corresponding to measured u and y?
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 6 / 44
oblique projection of data onto space of models
f
f
p
p
�������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
YU
UY
Xf
msmnterror
Y f
Yf
span U
Yp
p
span U f
D Uk f
P Xfk
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 7 / 44
Requirements
I persistent measured input . . .or an (assumed) persistent (unmeasured) noise disturbance
I the system responds persistently to persistent inputs
I the outputs do not feed back to inputs(there’s a way around this)
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 8 / 44
What could possibly go wrong?
. . . these problems are cousins . . .
I excessive measurement noise and/or process noise
I nearly linearly-dependent bases (ill-conditioning)
I over-parameterization
I non-linearity . . . Hammerstein systems
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 9 / 44
What to do about it.
. . . we will start the term examining some of these methods . . .
I pre-conditioning data (filtering, detrending) . . . but be careful!
I `2 regularization . . . bias and covariance
I `1 regularization (as a QP)
I rank reduction and total least squares
I structured rank reduction . . . a lot of opportunity here, I think.
I . . . nonlinearity . . . ??
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 10 / 44
What good is an identified LTI system. . . in an arbitrary basis?
I What is x? . . . It’s a good question!I If you don’t know what the identified state sequence x physically
corresponds to, can you do anything with the model? . . . e.g.,control?
I Maybe prediction is enough.I Maybe you know the mechanisms at play within the system
. . . physics-based modeling.I estimate (a few) physical parameters, e.g., L ,C ,R, K ,M,C,
from the identified LTI system dynamics, e.g., pj = −ζjωnj + iωd j
I usually a non-linear least squares problemLevenberg-Marquardt, etc.but with vastly reduced spaces of parameters and data!
Subspace System ID What is System Identification? CEE 629 H.P. Gavin 2017-08-30 11 / 44
System ID seems so essential! Why did ittake until now to figure out how to do itright?
Lineage
I Jacopo Riccati (1676 - 1754)I Alexandre-Theophile Vandermonde (1735 - 1796)I Carl Friedrich Gauss (1777 - 1855)I Camille Jordan (1838 - 1922)I Hermann Hankel (1839 - 1873)I Ferdinand Georg Frobenius (1849 - 1917)I Andrey Markov (1856 - 1922)I Aleksandr Lyapunov (1857 - 1918)I Issai Schur (1875 - 1941)I Otto Toeplitz (1881 - 1940)I Norbert Wiener (1894 - 1964)I Alston Scott Householder (1904 - 1993)I Rudolf E. Kalman (1930 - 2016)I Gene H. Golub (1932 - 2007)
Subspace System ID CEE 629 H.P. Gavin 2017-08-30 12 / 44
Subspace System Identification
Deterministic Subspace System Identificationdiscrete-time LTI in state-space
x(k + 1) = A x(k) + B u(k) + w(k) , x ∈ Rn , u ∈ Rr
y(k) = C x(k) + D u(k) + v(k) , y ∈ Rm
disturbance - noise covariance
E
( w(p)v(p)
)T (w(q)T v(q)T
) =
[Q SST R
]δpq
apply to sequences[
x(i + 1) · · · x(i + j)y(i) · · · y(i + j − 1)
]=
[A BC D
] [x(i) · · · x(i + j − 1)u(i) · · · u(i + j − 1)
]+
[w(i) · · ·w(i + j − 1)v(i) · · · v(i + j − 1)
][
Xi+1,jYi,j
]=
[A BC D
] [Xi,jUi,j
]+
[Wi,jVi,j
]
So, a realization A ,B ,C ,D may be obtained from input / output sequences with adirect matrix decomposition,if a state vector sequence [x(i) · · · x(i + j)] is known.
Subspace System ID Subspace System Identification CEE 629 H.P. Gavin 2017-08-30 13 / 44
Subspace ID : notation and data matricesSubstitute state equation into output equation, recursively, to obtain
y(i) · · · y(i + j − 1)y(i + 1) · · · y(i + j)...
.
.
.y(i + k − 1) · · · y(i + j + k − 2)
=
C
CA...
CAk−1
[
x(i) · · · x(i + j − 1)]
+
D 0 0 · · · 0CB D 0 · · · 0
CAB CB D · · · 0...
.
.
....
. . . 0CAk−2 CAk−3B CA k−4B · · · D
·
u(i) · · · u(i + j − 1)...
.
.
.u(i + k − 1) · · · u(i + j + k − 2)
+
Yi,j,k = Pk Xi,j +Dk Ui,j,k + Vi,j,k
Yp ≡ Y1,j,k Up ≡ U1,j,k Xp ≡ X1,j past I/O data and statesYf ≡ Yk+1,j,k Uf ≡ Uk+1,j,k Xf ≡ Xk+1,j future I/O data and states
Yp = Pk Xp +Dk Up + Vp
Yf = Pk Xf +Dk Uf + Vf
Subspace System ID Subspace System Identification CEE 629 H.P. Gavin 2017-08-30 14 / 44
Subspace ID : three necessary assumptions
1. The input is persistent Ui,j,k has full row rank
2. The states respond persistently Xi,j has full row rank
3. There is no feedback u=⇒⇐=\ y span(Xi,j) ∩ span(Ui,j,k ) ∈ {Ø}
(there are ways around this)
So,
rank[
Up
Yp
]= kr + n
and any input / output sequence
[u(i) · · · u(i + j − 1)] , [y(i) · · · y(i + j − 1)]
is in the basis of [Up
Yp
]
Subspace System ID Subspace System Identification CEE 629 H.P. Gavin 2017-08-30 15 / 44
Subspace ID : main lemma
span [Xf ] = span[
Up
Yp
]∩ span
[Uf
Yf
]
f
f
p
p
�������������������������������������������������������������������������������������������������������������������������
�������������������������������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
���������������������������������������������������������������������������������������������������
YU
UY
Xf
Xf lies in the span of[
Up
Yp
]Yf = Pk Xf +Dk Uf
Pk Xf lies in span[
Up
Yp
], and span
[Uf
Yf
],
Pk Xf is the oblique projectction of Yf into[
Up
Yp
]parallel to Uf .
msmnterror
Y f
Yf
span U
Yp
p
span U f
D Uk f
P Xfk
Subspace System ID Subspace System Identification CEE 629 H.P. Gavin 2017-08-30 16 / 44
Subspace ID : computation
Compute the oblique projectcion via LQ decompositionUf[Up
Yp
]Yf
=
L11 0 0L21 L22 0L31 L32 L33
Q1
Q2
Q3
Pk Xf = L32 L−1
22
[Up
Yp
]Compute the state sequence via SVD
Pk Xf = UΣVT = UΣ1/2T · T−1Σ1/2VT
Pk = UnΣ1/2n T
Xf = T−1Σ1/2n VT
n =[
x(k + 1) · · · x(k + j)]
The state sequence is thus obtained, but in an arbitrary basis. . . . n4sid
Subspace System ID Subspace System Identification CEE 629 H.P. Gavin 2017-08-30 17 / 44
primary reference texts for this course
I Katayama, Tohru, Subspace Methods for System Identification, Springer,2005.
I Van Overschee, Peter, and De Moore, Bart, Subspace Identification forLinear Systems, Kluwer, 1996.
I Juang, Jer-Nan, Applied System Identification, Prentice Hall, 1994.
Subspace System ID texts CEE 629 H.P. Gavin 2017-08-30 18 / 44
Some of the other topics in this course
Total Least Squares
I solve the over-determined noisy system
y ≈ Xa
I errors in y only . . . o.l.s.y + y = Xa
I errors in y and X . . . t.l.s.
y + y =[X + X
]a
I the t.l.s. problem
min∣∣∣∣∣∣∣∣[X y
]∣∣∣∣∣∣∣∣2F
such that y + y =[X + X
]a
I Eckart-Young thm.
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 19 / 44
OLS, `1, and `2 regularization
y(x; a1, a2) = a1x + a2x2 y = y + η ση = 0.5
OLS criterion mina ||y − Xa ||22`1 regularization criterion mina ||y − Xa ||22 + α||a ||1`2 regularization criterion mina ||y − Xa ||22 + β||a ||2
0
2
4
6
8
10
2 3 4 5 6 7 8 9
a2
a1
OLSL1L1L2L2
α = 20.0
α = 70.0
β = 1.0
β = 70.0
-5
0
5
10
15
0 0.2 0.4 0.6 0.8 1
true
msmnt
OLSL2L1
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 20 / 44
Nonlinear Least Squares - Levenberg Marquardt
0
50
100
150
200
-4 -2 0 2 4
|H(f
)|
f
Example 5(b)
0
50
100
150
200
-4 -2 0 2 4
|H(f
)|Example 5(a)
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 21 / 44
Singular Spectrum Analysis
I rank reduction of a Hankel matrix of a time series
Y =
y1 y2 · · · · · · yj−1 yj
y2 y3 · · · · · · yj yj+1...
......
...yk−1 yk · · · · · · yk+j−3 yk+j−2
yk yk+1 · · · · · · yk+j−2 yk+j−1
I truncated SVD expansion
Yn = UnΣnVTn
I reconstruct a Hankel form . . .average cross-diagonals (??) . . . or structured low-rank approximation
I extract a reduced basis from a very noisy measurement
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 22 / 44
Singular Spectrum Analysis
10-1
100
100
101
102
σ i / σ1
i
n=10
s.v. ratio = 0.500
10-12
10-10
10-8
10-6
10-4
10-2
100
10-1
100
101
PSD
frequency, Hz
true
noisy
filtered
-1.5
-1
-0.5
0
0.5
1
1.5
10 12 14 16 18 20
signals
time, s
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 23 / 44
MIMO Wiener Filtering
I Estimate the (matrix-valued) Wiener coefficients (Markov parameters) H(i)
y(k) =∑
i
H(i) u(k − i)
I filter a noisy measurement from broad-band input-output dataI recover a reduced basis from a very noisy measurementI identify the impuse response of a MIMO system from noisy I/O data
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 24 / 44
Wiener filtering
-10
-5
0
5
10
0 10 20 30 40 50 60 70 80
mo
de
l p
red
ictio
n a
nd
tru
e s
ign
al
y+noisey
^y
10-8
10-7
10-6
10-5
10-4
10-3
10-2
10-1
100
0.2 0.5 1 2 5 10 20 50p
ow
er
sp
ectr
al d
en
sity
frequency, Hz
N = 8000 SNR = 2.00 K = 20
Puu
Pyy
Pyy hat
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 25 / 44
MIMO Wiener Filter ID
-20
-15
-10
-5
0
5
10
15
20
0 1 2 3 4 5
outputs,
y
-40
-30
-20
-10
0
10
20
30
40
0 1 2 3 4 5
inputs, u
-20
-15
-10
-5
0
5
10
15
20
0 1 2 3 4 5
model p
rediction
(-) and t
rue outp
ut (o)
-15
-10
-5
0
5
10
15
20
0 0.2 0.4 0.6 0.8 1 1.2
unit imp
ulse res
ponses
input # 2 -> output # 1
FFTtrue
identified
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 26 / 44
preliminaries needed for subspace identification
I linear vector spaces; decompositions; truncation; projections;ordinary least squares
I total least squares; SSA and Wiener filters
I nonlinear least squares; SQP; and `1 regularization
I linear time invariant systems, Kalman filter; controllability andobservability; Lyapunov equations; balanced realizations andmodel reduction;
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 27 / 44
Total Least Squares
I solve the over-determined noisy system
y ≈ Xa
I errors in y only . . . o.l.s.y + y = Xa
I errors in y and X . . . t.l.s.
y + y =[X + X
]a
I the t.l.s. problem
min∣∣∣∣∣∣∣∣[X y
]∣∣∣∣∣∣∣∣2F
such that y + y =[X + X
]a
I Eckart-Young thm.
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 28 / 44
OLS, `1, and `2 regularization
y(x; a1, a2) = a1x + a2x2 y = y + η ση = 0.5
OLS criterion mina ||y − Xa ||22`1 regularization criterion mina ||y − Xa ||22 + α||a ||1`2 regularization criterion mina ||y − Xa ||22 + β||a ||2
0
2
4
6
8
10
2 3 4 5 6 7 8 9
a2
a1
OLSL1L1L2L2
α = 20.0
α = 70.0
β = 1.0
β = 70.0
-5
0
5
10
15
0 0.2 0.4 0.6 0.8 1
true
msmnt
OLSL2L1
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 29 / 44
Nonlinear Least Squares - Levenberg Marquardt
0
50
100
150
200
-4 -2 0 2 4
|H(f
)|
f
Example 5(b)
0
50
100
150
200
-4 -2 0 2 4
|H(f
)|Example 5(a)
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 30 / 44
Singular Spectrum Analysis
I rank reduction of a Hankel matrix of a time series
Y =
y1 y2 · · · · · · yj−1 yj
y2 y3 · · · · · · yj yj+1...
......
...yk−1 yk · · · · · · yk+j−3 yk+j−2
yk yk+1 · · · · · · yk+j−2 yk+j−1
I truncated SVD expansion
Yn = UnΣnVTn
I reconstruct a Hankel form . . .average cross-diagonals (??) . . . or structured low-rank approximation
I extract a reduced basis from a very noisy measurement
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 31 / 44
Singular Spectrum Analysis
10-1
100
100
101
102
σ i / σ1
i
n=10
s.v. ratio = 0.500
10-12
10-10
10-8
10-6
10-4
10-2
100
10-1
100
101
PSD
frequency, Hz
true
noisy
filtered
-1.5
-1
-0.5
0
0.5
1
1.5
10 12 14 16 18 20
signals
time, s
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 32 / 44
MIMO Wiener Filtering
I Estimate the (matrix-valued) Wiener coefficients (Markov parameters) H(i)
y(k) =∑
i
H(i) u(k − i)
I filter a noisy measurement from broad-band input-output dataI recover a reduced basis from a very noisy measurementI identify the impuse response of a MIMO system from noisy I/O data
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 33 / 44
Wiener filtering
-10
-5
0
5
10
0 10 20 30 40 50 60 70 80
mo
de
l p
red
ictio
n a
nd
tru
e s
ign
al
y+noisey
^y
10-8
10-7
10-6
10-5
10-4
10-3
10-2
10-1
100
0.2 0.5 1 2 5 10 20 50p
ow
er
sp
ectr
al d
en
sity
frequency, Hz
N = 8000 SNR = 2.00 K = 20
Puu
Pyy
Pyy hat
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 34 / 44
MIMO Wiener Filter ID
-20
-15
-10
-5
0
5
10
15
20
0 1 2 3 4 5
outputs,
y
-40
-30
-20
-10
0
10
20
30
40
0 1 2 3 4 5
inputs, u
-20
-15
-10
-5
0
5
10
15
20
0 1 2 3 4 5
model p
rediction
(-) and t
rue outp
ut (o)
-15
-10
-5
0
5
10
15
20
0 0.2 0.4 0.6 0.8 1 1.2
unit imp
ulse res
ponses
input # 2 -> output # 1
FFTtrue
identified
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 35 / 44
preliminaries needed for subspace identification
I linear vector spaces; decompositions; truncation; projections;ordinary least squares
I total least squares; SSA and Wiener filters
I nonlinear least squares; SQP; and `1 regularization
I linear time invariant systems, Kalman filter; controllability andobservability; Lyapunov equations; balanced realizations andmodel reduction;
Subspace System ID other topics CEE 629 H.P. Gavin 2017-08-30 36 / 44
Modeling Field Data
System Identification - Natural Periods
10-1
100
10-1
100
101
102
ide
ntifie
d n
atu
ral p
erio
ds,
s
peak foundation velocity, mm/sSubspace System ID Modeling Field Data CEE 629 H.P. Gavin 2017-08-30 37 / 44
System Identification - Damping Ratios
2
4
6
8
10
10-1
100
101
102
ide
ntifie
d d
am
pin
g r
atio
s,
\%
peak foundation velocity, mm/sSubspace System ID Modeling Field Data CEE 629 H.P. Gavin 2017-08-30 38 / 44
System Identification - Frequency Responses
101
102
100
101
sin
gu
lar
va
lue
sp
ectr
um
of
ide
ntifie
d t
ran
sfe
r fu
nctio
n
frequency (Hertz)Subspace System ID Modeling Field Data CEE 629 H.P. Gavin 2017-08-30 39 / 44
System Identification - modeling low-amplitude behavior
-15
-10
-5
0
5
10
30 32 34 36 38 40 42 44
top
, m
m/s
22011-11-18 23:11:14 UTC nMax=160, order=16, err=0.312
msmntsssid model
-15
-10
-5
0
5
10
30 32 34 36 38 40 42 44
ab
ove
iso
, m
m/s
2
msmntsssid model
Subspace System ID Modeling Field Data CEE 629 H.P. Gavin 2017-08-30 40 / 44
System Identification - modeling high-amplitude behavior
-1000
-500
0
500
1000
1500
20 25 30 35 40 45 50 55
top
, m
m/s
2
2011-12-23 02:17:47 - M 6.00 nMax=160, order=16, err=0.424
msmntsssid model
-1000
-500
0
500
1000
20 25 30 35 40 45 50 55
ab
ove
iso
, m
m/s
2
msmntsssid model
Subspace System ID Modeling Field Data CEE 629 H.P. Gavin 2017-08-30 41 / 44
System Identification - Response PredictionRecord #114 Parameters Modeling Record #103 Output
15 20 25 30 35 40 45 50 55−2000
0
2000
acc, m
m/s
2
15 20 25 30 35 40 45 50 55−2000
0
2000
acc, m
m/s
2
15 20 25 30 35 40 45 50 55−2000
0
2000
acc, m
m/s
2
15 20 25 30 35 40 45 50 55−2000
0
2000
acc, m
m/s
2
Subspace System ID Modeling Field Data CEE 629 H.P. Gavin 2017-08-30 42 / 44
System Identification - Response PredictionRecord #132 Parameters Modeling Record #114 Output
15 20 25 30 35 40 45 50 55 60−5000
0
5000
acc, m
m/s
2
15 20 25 30 35 40 45 50 55 60−5000
0
5000
acc, m
m/s
2
15 20 25 30 35 40 45 50 55 60−4000
−2000
0
2000
acc, m
m/s
2
15 20 25 30 35 40 45 50 55 60−2000
0
2000
4000
acc, m
m/s
2
Subspace System ID Modeling Field Data CEE 629 H.P. Gavin 2017-08-30 43 / 44
System Identification and Response Predictionpre
dic
tion p
eak foundation v
elo
city, lo
g1
0(m
m/s
)
model peak foundation velocity, log10(mm/s)
1.2
1.4
1.6
1.8
2
2.2
1.2 1.4 1.6 1.8 2 2.2
Subspace System ID Modeling Field Data CEE 629 H.P. Gavin 2017-08-30 44 / 44