State Space Models - Portland State University

Overview of State Space Models
Standard State Space Model
• Standard state space model
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
• Straight-forward extensions
• Properties
n≥0
where
• Solving the normal equations
• Covariance matrices
• Wide-sense Markov processes
Fn ∈ C×
Gn ∈ C×m
Hn ∈ Cp×
xn ∈ C×1
un ∈ Cm×1
yn ∈ Cp×1
vn ∈ Cp×1
• un and vn are multivariate white noise processes
• Designing state space models
– Common choices for the state dynamics
• In many cases vn is interpreted as an output disturbance or
measurement noise
• Continuous-time to discrete-time conversion
– Coarse estimates
– Exact conversions
• un is usually called process noise
• This is a more general form than is used in many texts
• Nonlinear state space models
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
1
J. McNames
Standard State Space Model Matrices
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
State Space Model With Known Input
n≥0
xn+1 = Fn xn + Gn (un + un )
n≥0
yn = Hn xn + vn
• Conceptually, yn usually contains all the signals that are
observable
– May come from multiple sensors
• The state space model can be extended when there are known
input signals (collected in the vector un ∈ Cm×1 ) that affect the
state of the system
• xn contains all of the parameters of the process that you are
interested in estimating
• This changes little in the development of the Kalman filter
algorithm
• Note that the process is nonstationary in general since all of the
matrices are allowed to change with time
• The apparent constraint that both un and un are multiplied by
Gn does not really impair the flexibility of the model
J. McNames
Portland State University
ECE 539/639
2
State Space Models
Ver. 1.03
3
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
4
State Space Model With Known Input Continued
xn+1 = Fn xn + Gn (un + un )
State Space Model With Known Input Continued
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
n≥0
yn = Hn xn + vn
• An additional known input signal could be added to the output
equation in a similar fashion
• We can specify the covariance matrix of un to be anything we like
such that the additive noise term has whatever covariance matrix
we like
yn = Hn xn + wn + vn
• Suppose we wish for the scaled state noise Gn un to have a
covariance matrix Tn
• This is most easily handled by defining a different observed signal
as
−∗
Qn G−1
n T n Gn
zn yn − wn
un , un = Qn
zn = Hn xn + vn
Gn un , Gn un = Gn Qn G∗n = Tn
• Thus, it easily reduces to the form of our standard state space
model output equation
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
5
Covariance Matrices
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
⎡ ⎤
⎡ x ⎤ x0 ⎡Π
0
0
0
0
⎢ ⎥
⎣un ⎦ , ⎢uk ⎥ = ⎣ 0 Qn δnk Sn δnk
⎣ vk ⎦
vn
0 Sn∗ δnk Rn δnk
1
⎤
0
0⎦
0
State Space Models
State Space Models
0
Qn δnk
Sn∗ δnk
Ver. 1.03
0
Sn δnk
Rn δnk
6
⎤
0
0⎦
0
• By definition, the matrices Qn and Rn must be Hermitian and
non-negative definite
• The matrix Sn doesn’t have to be Hermitian, but it must be such
that the joint covariance matrix is non-negative definite
Q S
≥0
S∗ R
• This characterization ensures the process is wide-sense Markov (to
be discussed later)
• Clever use of the inner product notation has been used here to
indicate these RVs have zero mean
ECE 539/639
ECE 539/639
• The matrices Π0 , Qn , Rn , and Sn are assumed to be known
• The model is causal in that xn and yn are completely determined
by x0 and past and present values of vn and un
Portland State University
Portland State University
Covariance Matrices
⎡ ⎤
⎡ x ⎤ x0 ⎡
Π0
0
xn+1 = Fn xn + Gn un
⎢ ⎥
⎣un ⎦ , ⎢uk ⎥ = ⎣ 0
⎣ vk ⎦
yn = Hn xn + vn
vn
0
1
• The random variable x0 and the two white noise processes drive
the state space model
– This means that un , uk = 0 for n = k
– Does not mean Qn or Rn are diagonal matrices
J. McNames
J. McNames
Ver. 1.03
7
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
8
Correlation of Process and Measurement Noise
⎡ ⎤
⎡ ⎤ x0 ⎡
x0 ⎢ ⎥
0
0
Π0
xn+1 = Fn xn + Gn un
⎣un ⎦ , ⎢uk ⎥ = ⎣ 0 Qn δnk Sn δnk
⎣ vk ⎦
yn = Hn xn + vn
vn
0 Sn∗ δnk Rn δnk
1
Orthogonality Properties
⎤
0
0⎦
0
You should be able to show that the following properties are true:
• It is common to assume the process and measurement noise
processes are completely uncorrelated, Sn = 0 for all n
un , xk = 0
vn , xk = 0
for n ≥ k
un , yk = 0
vn , yk = 0
for n > k
un , yk = Sn
vn , yk = Rn
for n = k
un , x0 = 0
• Due to domain knowledge that they have different origins
iff un , xn = 0
for n ≥ 0
• The key idea is to leverage the orthogonality of the initial state
and the noise covariance matrices
• When feedback is used and the output modifies the state
equation, the noises may become correlated, Sn = 0 for some n
• There are many forms, but the most useful is to assume that they
are correlated only at the same time instant
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
9
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
10
Relationship to Ry
Example 1: Orthogonality Properties
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
x̂n|n = xn , yy−2 y
y col{y0 , . . . , yn }
• We know that the optimal causal estimator of xn is given by the
normal equations
Prove some of the orthogonality properties on the previous slide.
• Requires knowledge of two terms
• The first is easy to solve for
xn , y = xn , Hn xn + vn = xn , xn Hn∗
• In order to solve the normal equations, we need to know how
Ry = y2 is related to all of the state space model parameters
and covariance matrices
• However, we need to solve for xn , xk in order to obtain
expressions for both xn , y and Ry
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
11
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
12
Solving for the State Covariance Matrix
Solving for the State Covariance Matrix Continued
Given the state space model,
Now let us define the state transition matrix
Fn−1 Fn−2 . . . Fk n > k
Φ(n, k) I
n=k
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
Then
we can easily show that
xn = Φ(n, k)xk + A col{uk , uk+1 , . . . , un−1 }, n ≥ k
Πn+1 xn , xn = Fn xn + Gn un , Fn xn + Gn un for some matrix A. In other words, xn consists of Φ(n, k)xk plus
some linear combination of {uk , uk+1 , . . . , un−1 }, which is
uncorrelated with xk . Thus
= Fn xn , xn Fn∗ + Gn un , un G∗n
= Fn Πn Fn∗ + Gn Qn G∗n
xn , xk = Φ(n, k)xk + A col{uk , uk+1 , . . . , un−1 }, xk = Φ(n, k)xk , xk + 0
= Φ(n, k)Πk for n ≥ k
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
13
J. McNames
Portland State University
xn , xk = Φ(n, k)Πk for n ≥ k
Ver. 1.03
14
Given the state space model,
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
For since x, y = y, x∗ for any random vectors x and y, it follows
immediately that
xn , xk = xk , xn ∗
The output covariance matrix is given by
∗
yn , yk = Hn xn + vn , Hk xk + vk = (Φ(k, n)Πn )
= Hn xn , xk Hk∗ + Hn xn , vk + vn , xk Hk∗ + vn , vk = Πn Φ∗ (k, n) for n ≤ k
The cross-terms xn , vk and vn , xk don’t necessarily cancel in this
case sense un and vn are correlated.
These results can be summarized as
⎧
⎪
n≥k
⎨Φ(n, k)Πk
xn , xk = Πn
n=k
⎪
⎩
Πn Φ∗ (k, n) n ≤ k
However they do if n = k since then xn is only a function of past
values of un
If
then
Portland State University
State Space Models
Solving for the Output Covariance Matrix Ry
Solving for the State Covariance Matrix Continued
J. McNames
ECE 539/639
ECE 539/639
State Space Models
Ver. 1.03
15
J. McNames
vn , xk = 0
yn , yn =
Portland State University
Hn Πn Hn∗
ECE 539/639
xn , vk = 0
+ Rn
State Space Models
Ver. 1.03
16
Solving for the Output Covariance Matrix Ry Continued
Solving for the Output Covariance Matrix Ry Finished
Again we x, y = y, x∗ for any random vectors x and y, to
complete the solution
⎧
⎪
n>k
⎨Hn Φ(n, k + 1)Nk
∗
yn , yk = Hn Πn Hn + Rn
n=k
⎪
⎩ ∗ ∗
∗
Nn Φ (k, n + 1)Hk n < k
yn , yk = Hn xn , xk Hk∗ + Hn xn , vk + vn , xk Hk∗ + vn , vk Now if n > k,
vn , xk = 0
vn , vk = 0
For n > k,
yn , yk = Hn xn , xk Hk∗ + Hn xn , vk where
= Hn Φ(n, k)Πk Hk∗ + Hn Φ(n, k + 1) (Fk xk + Gk uk ) , vk =
Hn Φ(n, k)Πk Hk∗
Nn Fn Πn Hn∗ + Gn Sn
+ Hn Φ(n, k + 1)Gk uk , vk It may not be apparent, but this has introduced exactly the type of
symmetry in Ry that we needed
= Hn Φ(n, k + 1)Fk Πk Hk∗ + Hn Φ(n, k + 1)Gk Sk
= Hn Φ(n, k + 1) (Fk Πk Hk∗ + Gk Sk )
= Hn Φ(n, k + 1)Nk
where
Nk Fk Πk Hk∗ + Gk Sk
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
17
J. McNames
Symmetry in Ry
ECE 539/639
State Space Models
Ver. 1.03
18
Wide Sense Markov (WSM) Processes
Consider three observation vectors {y0 , y1 , y2 } produced by the
standard state space model
⎡
R0 + H0 Πo H0∗
H1 N 0
Ry = ⎣
H2 F1 N0
Portland State University
N0∗ H1∗
R1 + H1 Π1 H1∗
H2 N 1
• Markov stochastic processes have the following relationship for
their conditional probability density functions (pdfs)
⎤
N0∗ F1∗ H2∗
⎦
N1∗ H2∗
R2 + H2 Π2 H2∗
fyn |yj ,yk (yn |yj , yk ) = fyn |yj (yn |yj ) if n > j > k
• For linear MMSE estimation we only use first- and second-order
statistics
• However, it is not yet clear how we might be able to invert Ry
efficiently
• A random process is Wide-sense Markov (WSM) if the linear
MMSE estimator of xn given L{xn−1 , . . . , x0 } equals the linear
MMSE estimator of xn given L{xn−1 }.
• Would be much easier to invert if was block diagonal
• The correlation matrix of the innovations is block diagonal
• But then we need a way of obtaining the innovations and it’s
covariance matrix
• Stay tuned . . .
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
19
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
20
State Space Models are WSM Processes
WSM Processes have State Space Models
Suppose we have a wide-sense Markov process xn . Consider its
innovations process
xn+1 = Fn xn + Gn uN
x0
x
Π0
0
, 0
=
un
uk
0 Qn δnk
e0 = x0
Now define
Since xn ∈ L{x0 , u0 , . . . , un−1 } we know that
un ⊥xk ,
un en+1
n≥k≥0
un , uk = en+1 , ek+1 = 0 for n = k
un 2 = en+1 2 = Πn+1 − Fn Πn Fn∗ Qn
= Fn xn + 0
= Fn x̂n|xn
Since en+1 ⊥e0 , un = en+1 , and e0 = x0 , we have
= x̂n+1|xn
ECE 539/639
xn 2 Πn
Now since the innovations are orthogonal
x̂n+1|{x0 ,...,xn } = Fn x̂n|{x0 ,...,xn } + Gn ûn|{x0 ,...,xn }
Portland State University
Fn Ko,n
xn+1 = Fn xn + un
Thus the orthogonal projection of xn+1 onto L{x0 , . . . , xn } is given
by
J. McNames
en+1 = xn+1 − Ko,n xn
un ⊥x0
State Space Models
Ver. 1.03
21
WSM Processes have State Space Model Representations
Continued
Thus, given a wide-sense Markov process xn , we can define a state
space model
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
22
Ver. 1.03
24
Examples of State Space Models
• Autoregressive (AR) processes
• ARMA processes
• AR processes revisited
xn+1 = Fn xn + Gn uN
x0
x
Π0
0
, 0
=
un
uk
0 Qn δnk
• Physical models
• Nonlinear models
Thus a process {xn , n ≥ 0} is WSM if and only if it has a forwards
Markovian state space representation of the form above.
• However, it turns out that yn is not WSM
• In general a sum of WSM processes is generally not WSM
• Processes such as yn = Hn xn + vn are called projections of
Markov processes
• However the aggregate process obtained by considering
col{xn , yn } is WSM
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
23
J. McNames
Portland State University
ECE 539/639
State Space Models
Autoregressive Processes
yn+1 = un +
−1
AR Process State Space Model
Let us define
xn col{yn , yn−1 , . . . , yn−+1 }
ak yn−k
k=0
⎡
Note that this differs from the usual model of AR processes
x(n) = w(n) +
p
yn+1
yn
yn−1
..
.
⎤
⎡
a0
⎥ ⎢1
⎥ ⎢
⎥ ⎢0
⎥=⎢
⎥ ⎢ ..
⎦ ⎣.
⎢
⎢
⎢
⎢
⎢
⎣
yn−+2
xn+1
ak x(n − k)
k=1
in several ways
• The white noise process is denoted as un
• The AR process is denoted as yn
• yn+1 is a function of un , instead of un+1 (non-minimum phase)
a1
0
1
..
.
. . . a−2
...
0
...
0
..
..
.
.
0 0 ...
1
= F xn + Gun
⎤ ⎡ ⎤
⎤⎡
a−1
1
yn
⎢ yn−1 ⎥ ⎢0⎥
0 ⎥
⎥ ⎢ ⎥
⎥⎢
⎥ ⎢ ⎥
⎢
0 ⎥
⎥ ⎢ yn−2 ⎥ + ⎢0⎥ u(n)
.. ⎥ ⎢ .. ⎥ ⎢ .. ⎥
. ⎦ ⎣ . ⎦ ⎣.⎦
yn−+1
0
0
Note that in the vector case, yn ∈ Cp×1 , F and G are block matrices.
• The order of the model is denoted as • yn can be a vector-valued process, though I will still denote the
coefficients with lower-case letters ak
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
25
J. McNames
Autoregressive Processes Continued
⎡
yn = 1
0
yn
yn−1
yn−2
..
.
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
26
Autoregressive Processes Continued
⎤
Thus with the definition of a state vector
⎢
⎥
⎥
⎢
⎢
⎥
0 ... 0 ⎢
⎥
⎢
⎥
⎣
⎦
yn−+1
xn col{yn , yn−1 , . . . , yn−+1 }
we can write an autoregressive process in state space form
xn+1 = F xn + Gun
yn = Hxn
yn = Hxn
• The companion matrix F is stable if and only if all its eigenvalues
are less than one in magnitude
• This is equivalent to requiring that
a(z) z − a0 z −1 − · · · − a−1
has all of its roots inside the unit circle
• Note that this could easily be generalized to the case where any of
the model parameters are time-varying
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
27
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
28
ARMA Processes
ARMA In State Space Form
⎡
a0
⎢1
⎢
⎢
=⎢0
⎢ ..
⎣.
yn+1 = a0 yn + · · · + a−1 yn−+1 + b0 un + · · · + b−1 un−+1
. . . a−2
...
0
.
.
.
0
xn+1
..
..
.
.
0 0 ...
1
yn = b0 . . . b−1 xn
xn+1 a0 xn + · · · + a−1 xn−+1 + un
yn+1 = b0 xn + · · · + b−1 xn−+1
xn+1 = F xn + Gun
yn = Hxn
• An ARMA process can be expressed as white noise filtered by a
cascade of an AP system followed by an AZ system
a1
0
1
..
.
xn+1 = F xn + Gun
• We already have an expression for the output of the AP system
yn = Hxn
• The output of the AZ system is then just a linear combination of
outputs of the AP system
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
⎡ ⎤
⎤
1
a−1
⎢0⎥
0 ⎥
⎢ ⎥
⎥
⎢ ⎥
0 ⎥
⎥ xn + ⎢0⎥ u(n)
⎢ .. ⎥
.. ⎥
⎣.⎦
. ⎦
0
0
29
AR Processes Revisited
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
30
AR Process Alternative Formulation
Let us define the state as the parameters,
T
xn a1 a2 . . . a
xn col{yn , yn−1 , . . . , yn−+1 }
• The AR model we set up earlier is of little practical utility
• Just like the earlier case, all of the model parameters must be
known
Then the output of the AR process is given by
• The state of the system is trivial to estimate once observations
of the output process have been made
yn =
ak yn−k + vn = Hn xn + vn
k=1
• Recall that the state of the system is usually consists of the
parameters that you want (or have) to estimate
where
Hn yn−1
• For AR processes, the parameters we’re interested in estimating
are the model coefficients {a0 , . . . , a−1 }
yn−2
. . . yn−
• Now the state represents the parameters we’re interested in
estimating
• This is a time-varying model
• But how do we write an expression for the state update equation?
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
31
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
32
Designing State Space Models
Constant Parameter Models
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
xn+1 = xn
yn = Hn xn + vn
• Fn = I, Gn = 0 or Qn = 0
• In many signal processing applications you can write a
mathematical expression that relates the observed signal to the
parameters of interest
• The state at time xn+1 is the same as xn
• The estimate will be time varying because we can improve the
estimate of x as we gain more observations yn
• However, there is often no obvious state space model that can be
obtained from first-principles or domain knowledge of the problem
• Example: Suppose we are trying to estimate the mean of a WN
process
• The Kalman filter approach to linear estimation is still often useful
in these circumstances
• Note that there will be a transition from the a priori estimate
x0|−1 (provided by user) to the unbiased estimate x as n → ∞
• There are several models for the state space equations that are
frequently used in these cases
• In this sense, the KF can be expressed as a type of linear Bayesean
estimation
• Could be used for a quasi-stationary AR parameter estimate
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
33
J. McNames
Random Walk Models
xn+1 = Fn xn + Gn un
yn = Hn xn + vn
xn+1 = xn + un
yn = Hn xn + vn
xn+1 = Fn xn + Gn un
34
• Often, Qn = αI where the scalar α is chosen by the user
• The scalar measurement noise in this case is set Rn = 1
• The model is unstable, but the estimates may (usually) still
converge!
• It turns out that if Rn = αI for any scalar, positive parameter α,
the same solution is obtained! (prove this)
• Perhaps the most widely used model
Ver. 1.03
yn = Hn xn + vn
• The user-specified scalar parameter λ controls the bias-variance
tradeoff
– λ = 1: Equivalent to regularized least squares
– 0 < λ < 1: Equivalent to recursive least squares
– λ = 0: ?
• The degree of the drift is controlled by the process noise
covariance Qn
State Space Models
Ver. 1.03
• Oddly, the adaptive filter algorithm recursive least squares is
equivalent to using the Kalman filter with an unstable state space
model
• This is a good model of processes in which the model parameters
slowly drift over time
ECE 539/639
State Space Models
xn+1 = λ−1/2 xn
yn = Hn xn + vn
• The state at time (n + 1) is the same as xn plus a random
perturbation
Portland State University
ECE 539/639
Unstable Deterministic Models
• Fn = I, as for constant parameter models
J. McNames
Portland State University
35
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
36
White Noise Models
xn+1 = Fn xn + Gn un
Continuous-Time State Space Models
The continuous time state space model is given by
xn+1 = Gn un
yn = Hn xn + vn
ẋ(t) = F (t)x(t) + G(t)u(t)
yn = Hn xn + vn
y(t) = H(t)x(t) + v(t)
⎡
⎤
⎤
⎡
⎤
x(0) ⎡
x(0)
0
0
0
Π0
⎢u(τ )⎥
⎥
⎣ u(t) ⎦ , ⎢
⎣
Q(t)δ(t − τ ) S(t)δ(t − τ ) 0⎦
⎣ v(τ ) ⎦ = 0
0 S(t)∗ δ(t − τ ) R(t)δ(t − τ ) 0
v(t)
1
• The state is just a white noise process
• In this case the state space model contains no dynamics or
memory that can be used to help estimate xn
• No advantage over the more general linear estimation problem:
Given
yn = Hn xn + vn
• ẋ(t) is the derivative with respect to time of each element of x(t)
• As before, all RVs have zero mean
Find the best linear estimate of xn :
x̂n = xn , yn yn −2 yn
• Treatment of the noise processes is tricky (they have infinite
power and bandwidth)
xn , yn = Πn Hn∗
x̂n = Πn Hn∗ (Hn Πn Hn∗ + Rn )−1 yn
yn 2 = Hn Πn Hn∗ + Rn
• Will not discuss here
• Our only interest is to determine how the model terms relate to
the discrete-time model
• Not used in practice
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
37
J. McNames
Continuous-Time to Discrete-Time
Portland State University
x(t + Ts ) = x(t) +
ẋ(t) = F (t)x(t) + G(t)u(t)
t+Ts
ẋ(τ ) dτ
x(t + Ts ) = x(t) +
t
= x(t) +
t
= x(t) +
t+Ts
t+Ts
t
F (τ )x(τ ) dτ +
t
t+Ts
t+Ts
t
x(τ ) ≈ xn
G(τ )u(τ ) dτ
ECE 539/639
State Space Models
38
t+Ts
t
G(τ )u(τ ) dτ
G(τ ) ≈ Gn
for
t = nTs ≤ τ < t + Ts = (n + 1)Ts
un Portland State University
F (τ )x(τ ) dτ +
F (τ ) ≈ Fn
Let us also define
J. McNames
Ver. 1.03
Now if Ts is small enough, a coarse approximation of the CT state
space equations can be obtained by assuming x(τ ), F (τ ), and G(τ )
are constant over short intervals of t ≤ τ < t + Ts
F (τ )x(τ ) + G(τ )u(τ ) dτ
State Space Models
Continuous-Time to Discrete-Time Coarse Approximations
Suppose our sample interval is given by Ts = 1/fs . Then
ECE 539/639
Ver. 1.03
39
J. McNames
Portland State University
t
t+Ts
u(τ ) dτ
ECE 539/639
State Space Models
Ver. 1.03
40
CT to DT Coarse Approximations: State Updates
CT to DT Coarse Approximations: Measurement Equation
Our approximations for nTs ≤ t < (n + 1)Ts are
F (t) ≈ F (nTs )
x(t) ≈ x(nTs )
y(t) = H(t)x(t) + v(t)
G(t) ≈ G(nTs )
yn = Hn xn + vn
Then we have
Let us define
xn+1 x ((n + 1)Ts )
(n+1)Ts
F (τ )x(τ ) dτ +
= x(nTs ) +
nTs
Hn H(nTs )
(n+1)Ts
nTs
vn v(nTs )
G(τ )u(τ ) dτ
≈ x(nTs ) + F (nTs )x(nTs ) + G(nTs )un
= (I + F (nTs )) x(nTs ) + G(nTs )un
= Fn xn + Gn un
where we have defined
Fn I + F (nTs )
J. McNames
Portland State University
Gn G(nTs )
ECE 539/639
State Space Models
Ver. 1.03
41
CT to DT Coarse Approximations: Measurement Noise
J. McNames
x0 = x(0)
for any integers n, k
This is a reasonable model if
=
1. The signal component (H(t)x(t)) of y(t) is bandlimited
2. An anti-aliasing filter (AAF) is applied to y(t) prior to sampling
=
As usual, the AAF should eliminate high-frequency components of v(t)
without causing aliasing of the signal component.
ECE 539/639
State Space Models
Ver. 1.03
Ver. 1.03
42
= Π0
The process noise is a little more tricky
(n+1)Ts
u(t) dt,
un , uk =
such that
Portland State University
State Space Models
vn , vk = v(nTs ), v(kTs ) = Rn δnk
v(t)2 = R(t) < ∞
J. McNames
ECE 539/639
CT to DT Coarse Approximations: Noise Covariance Matrices
Let us relax the requirement that v(t), v(τ ) = R(t)δ(t − τ ) so that
v(t) is bandlimited white noise with finite power,
v(nTs ), v(kTs ) = R(nTs )δnk = Rn δnk
Portland State University
nTs
(n+1)Ts
nTs
(n+1)Ts
nTs
= δn,j
43
J. McNames
kTs
(k+1)Ts
kTs
(j+1)Ts
jTs
(n+1)Ts
nTs
Portland State University
(k+1)Ts
u(τ ) dτ
u(t), u(τ ) dτ dt
Q(t)δ(t − τ ) dτ dt
Q(t) dt
ECE 539/639
State Space Models
Ver. 1.03
44
CT to DT Coarse Approximations: Process Noise
CT to DT Coarse Approximations: Measurement Equation
Now if we make the approximation
Q(τ ) = Q(t)
ẋ(t) = F (t)x(t) + G(t)u(t)
for t ≤ τ < t + Ts
we have
un , uk = δn,j
(n+1)Ts
nTs
Q(t) dt
≈ Ts Q(nTs ) δn,j
= Qn δn,j
xn+1 = Fn xn + Gn un
y(t) = H(t)x(t) + v(t)
yn = Hn xn + vn
xn x(nTs )
yn y(nTs )
Fn I + F (nTs )
Hn H(nTs )
Gn G(nTs )
t+Ts
un u(τ ) dτ
vn v(nTs )
Qn Ts Q(nTs )
Rn R(nTs )
t
where we defined
Qn Ts Q(nTs )
• This DT approximation of CT state space systems is only accurate
if the noise covariance matrices, model matrices, and state change
very little over the period of a sampling interval Ts
Notice that the covariance of Qn scales linearly with the sampling
interval Ts
• May require large sample rates and excessive computation
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
45
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
CT to DT Better Approximations
Matrix Exponentials
ẋ(t) = F (t)x(t) + G(t)u(t)
Consider the power series approximation of an exponential, generalized
to a matrix exponential
y(t) = H(t)x(t) + v(t)
eAt I + At +
• A better approximation can be obtained using a more exact model
of how the state evolves over a sampling interval Ts
=
• Requires knowledge of matrix exponentials
∞
Ak t k
k=0
• This material is from [1]
46
1 2 2
1
A t + · · · + Ak t k + . . .
2!
k!
k!
If the series converges, we can differentiate it term by term to give
1
1
d At
e = A + A2 t + A3 t2 + · · · +
Ak tk−1 + . . .
dt
2!
(k − 1)!
1 k k
1 2 2
= AeAt
= A I + At + A t + · · · + A t + . . .
2!
k!
1
1
= I + At + A2 t2 + · · · + Ak tk + . . . A
= eAt A
2!
k!
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
47
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
48
Matrix Exponential Properties
CT State Space Approximations
Let us assume F (t) and G(t) are constant over the interval
nTs ≤ t < (n + 1)Ts , as before
d At
e = AeAt = eAt A
dt
Now consider
eAt eAτ =
=
∞
Ak t k
k=0
∞
Ak
k=0
k!
∞
Ak τ k
k=0
k!
(t + τ )k
k!
=
∞
k=0
G(t) ≈ G(nTs )
F (t) ≈ F (nTs )
k
ti τ k−1
k
A
i!(k − i)!
i=0
ẋ(t) = F (t)x(t) + G(t)u(t)
ẋ(t) − F (t)x(t) = G(t)u(t)
= eA(t+τ )
−F (t)t
e
[ẋ(t) − F (t)x(t)] = e−F (t)t G(t)u(t)
Now over the interval nTs ≤ t < (n + 1)Ts we have the approximation
Thus, if τ = −t we have
e−F (nTs )t [ẋ(t) − F (nTs )x(t)] ≈ e−F (nTs )t G(nTs )u(t)
eAt e−At = e−At eAt = eA(t−t) = I
Note, however, that
e(A+B)t = eAt eBt if and only if AB = BA
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
49
J. McNames
CT State Space Approximations Continued
Portland State University
ECE 539/639
If we evaluate
F (nTs )Ts
x(t+Ts ) = e
F (nTs )(t+Ts )
50
t+Ts
t
e−F (nTs )τ G(nTs )u(τ ) dτ
at t = nTs and use the definition xn x(nTs ), we get
(n+1)Ts
xn+1 = eF (nTs )Ts xn +eF (nTs )(n+1)Ts
e−F (nTs )τ G(nTs )u(τ ) dτ
nTs
Suppose for a moment that we define
Solving for x(t + Ts ) then gives us
e−F (nTs )(t+Ts ) x(t + Ts ) = e−F (nTs )t x(t) +
Portland State University
x(t)+e
t
J. McNames
Ver. 1.03
CT State Space Approximations Continued
e−F (nTs )t [ẋ(t) − F (nTs )x(t)] ≈ e−F (nTs )t G(nTs )u(t)
d −F (nTs )t
e
x(t) = e−F (nTs )t G(nTs )u(t)
dt
t+Ts
t+Ts
d −F (nTs )τ
e
x(τ ) dτ =
e−F (nTs )τ G(nTs )u(τ ) dτ
dτ
t
t
t+Ts
e−F (nTs )τ G(nTs )u(τ ) dτ
e−F (nTs )(t+Ts ) x(t + Ts ) − e−F (nTs )t x(t) =
x(t + Ts ) = eF (nTs )Ts x(t) + eF (nTs )(t+Ts )
State Space Models
ECE 539/639
t
t+Ts
t
t+Ts
Gn I
e−F (nTs )τ G(nTs )u(τ ) dτ
e−F (nTs )τ G(nTs )u(τ ) dτ
State Space Models
Ver. 1.03
51
un eF (nTs )(n+1)Ts
(n+1)Ts
nTs
e−F (nTs )τ G(nTs )u(τ ) dτ
What is the covariance of un ?
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
52
CT State Space Approximations: Process Noise Covariance
un , uk =
eF (nTs )(n+1)Ts
e
=e
F (nTs )(n+1)Ts
nTs
F (kTs )(k+1)Ts
(n+1)Ts
nTs
(n+1)Ts
kTs
(n+1)Ts
e−F (nTs )s G(nTs )
S(τ )δ(t − s)G(kTs )∗ e−F (nTs )s
J. McNames
Portland State University
∗
ds dτ
ECE 539/639
eF (nTs )(n+1)Ts
State Space Models
∗
• However, even if the process noise is continuous-time white noise,
the discrete-time noise has finite variance!
• Not clear how to partition G(t)u(t) into Gn un
∗
Ver. 1.03
53
J. McNames
Portland State University
CT State Space Approximations Continued
Then we have
xn+1 ≈ eF (nTs )Ts xn + eF (nTs )(n+1)Ts
=e
F (nTs )Ts
∗
× eF (nTs )(n+1)Ts Qn δnk
• Unlike the measurement noise, we cannot filter the process noise
∗
nTs
nTs
e−F (kTs )s G(kTs )u(s) ds u(τ ), u(s)G(kTs )∗ e−F (nTs )s ds dτ eF (nTs )(n+1)Ts
(n+1)Ts (n+1)Ts
F (nTs )(n+1)Ts
=e
e−F (nTs )s G(nTs )
nTs
un , uk = δnk eF (nTs )(n+1)Ts
(n+1)Ts
∗
e−F (nTs )s G(nTs )S(τ )G(kTs )∗ e−F (nTs )τ
dτ
e−F (nTs )τ G(nTs )u(τ ) dτ,
(k+1)Ts
nTs
CT State Space Approximations: Process Noise Covariance
ECE 539/639
nTs
Ver. 1.03
54
CT State Space Approximations Continued
ẋ(t) = F (t)x(t) + G(t)u(t)
(n+1)Ts
State Space Models
xn+1 = Fn xn + Gn un
y(t) = H(t)x(t) + v(t)
e−F (nTs )τ G(nTs )u(nTs ) dτ
yn = Hn xn + vn
xn x(nTs )
xn + u n
yn y(nTs )
= Fn xn + Gn un
F (nTs )Ts
Fn e
Hn H(nTs )
where we have defined
Gn I
Fn eF (nTs )Ts
vn v(nTs )
Gn I
F (nTs )(n+1)Ts
un e
(n+1)Ts
nTs
F (nTs )(n+1)Ts
Qn δnk e
F (nTs )(n+1)Ts
× e
∗
−F (nTs )τ
e
(n+1)Ts
nTs
G(nTs )u(τ ) dτ
−F (nTs )s
e
G(nTs )S(τ )G(kTs )
∗
−F (nTs )τ
e
∗
dτ
Rn R(nTs )
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
55
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
56
Nonlinear State Space Models
• This approximation is a more accurate representation of the CT
model
xn+1 = fn (xn ) + gn (xn )un
yn = hn (xn ) + vn
• Both approximations can be generalized to the nonlinear case
easily
where
⎡
⎤H
um
⎡Q
un
n δn,m
⎢ vm ⎥
⎥
⎣ 0
⎣ vn ⎦ ⎢
=
⎣x0 − x̄0 ⎦
x0 − x̄0
0
1
⎡
⎤
0
Rn δn,m
0
0
0
Π0
⎤
0
0⎦
0
• Here the matrices Fn , Gn , and Hn have been replaced with
nonlinear functions of the state
• Does not assume zero mean
• Does assume no interaction between process and measurement
noise, un , vk = 0, but could probably be generalized to the
earlier case of un , vk = δnk Sn
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
57
The Nonlinear Functions
The functions fn (xn ), gn (xn ) and hn (xn ) are multivariate, nonlinear,
time-varying functions
⎤
⎡
fn,1 (xn )
⎢fn,2 (xn )⎥
⎥
⎢
fn (xn ) = ⎢
⎥
..
⎦
⎣
×1
.
fn, (xn )
⎤
⎡
gn,11 (xn ) . . . gn,1m (xn )
⎢ gn,21 (xn ) . . . gn,2m (xn )⎥
⎥
⎢
gn (xn ) = ⎢
⎥
..
..
.
.
⎦
⎣
.
×m
.
.
gn,m (xn ) . . . gn,m (xn )
⎤
⎡
hn,1 (xn )
⎢hn,2 (xn )⎥
⎥
⎢
hn (xn ) = ⎢
⎥
..
⎦
⎣
p×1
.
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
58
Nonlinear State Space Models Comments
xn+1 = fn (xn ) + gn (xn )un
yn = hn (xn ) + vn
• There are other types of nonlinear state space models
• This is one of the most general
• Note that the noise is still additive for both the state update and
measurement equations
• We will see that the optimal estimator uses Taylor series
approximations
• This only works if the nonlinear functions are smooth
hn,p (xn )
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
59
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
60
Example 2: Random Walk Model of Position
Summary
• State space models can often be obtained directly from the
physical system (by Newton’s laws, Kirchoff’s laws, etc.)
Suppose we have an accelerometer.
• To be completed
• State space models are wide sense Markov (WSM)
• The nonstationary case is nearly as easy to handle as the
stationary case: a straightforward generalization
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
61
• Give examples of processes modeled in MATLAB
• Work out what the process noise power is in the exact CT to DT
conversion
ECE 539/639
State Space Models
ECE 539/639
State Space Models
Ver. 1.03
62
[1] Katsuhiko Ogata. Discrete-time Control Systems. Prentice-Hall,
Inc., 1995.
• Give complete summary of the more exact CT to DT conversion
Portland State University
Portland State University
References
To Do
J. McNames
J. McNames
Ver. 1.03
63
J. McNames
Portland State University
ECE 539/639
State Space Models
Ver. 1.03
64