Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Manual for the Matlab toolbox EKFUKF.pdf
Скачиваний:
84
Добавлен:
10.02.2015
Размер:
1.54 Mб
Скачать

CHAPTER 3. NONLINEAR STATE SPACE ESTIMATION

p

The square root of positive definite matrix P is defined as A = P, where

P = AAT :

(3.41)

To calculate the matrix A we can use, for example, lower triangular matrix of the Cholesky factorialization, which can be computed with built-in Matlab function chol. For convience, we have provided a function (schol, which computes the factorialization also for positive semidefinite matrices.

3.3.2 The Matrix Form of UT

The unscented transform described above can be written conviently in matrix form as follows:

 

 

 

p

 

p

 

 

p

 

 

 

Y =

 

 

 

 

P

P

 

(3.43)

X =

m

m +

 

c 0

 

(3.42)

 

g(X)

 

 

 

 

 

 

 

 

 

 

U = Y wm

 

 

 

 

 

 

 

 

 

(3.44)

SU = Y W YT

 

 

 

 

 

 

 

 

 

(3.45)

CU = X W YT ;

 

 

 

 

 

 

 

 

 

(3.46)

where X is the matrix of sigma points, function g( ) is applied to each column of the argument matrix separately, c = 2 (n + ), and vector wm and matrix W are defined as follows:

wm =

W =

hWm(0) Wm(2n)iT

(3.47)

I wm wm

 

diag(Wc(0) Wc(2n))

 

I wm wm T :

(3.48)

See (Särkkä, 2006) for proof for this.

3.3.3 Unscented Kalman Filter

The unscented Kalman filter (UKF) (Julier et al., 1995; Julier and Uhlmann, 2004b; Wan and van der Merwe, 2001) makes use of the unscented transform described above to give a Gaussian approximation to the filtering solutions of non-linear optimal filtering problems of form (same as eq. (3.8), but restated here for convience)

xk = f(xk 1; k 1) + qk 1

(3.49)

yk = h(xk; k) + rk;

where xk 2 Rn is the state, yk 2 Rm is the measurement, qk 1 N(0; Qk 1) is the Gaussian process noise, and rk N(0; Rk) is the Gaussian measurement noise.

30

CHAPTER 3. NONLINEAR STATE SPACE ESTIMATION

Using the matrix form of UT described above the prediction and update steps of the UKF can computed as follows:

Prediction: Compute the predicted state mean mk and the predicted covariance Pk as

p

Xk 1 = mk 1 mk 1 + c 0

^

= f(Xk 1

; k 1)

Xk

m = X^ k wm

 

k

 

 

^ ^ T

Pk = Xk W [Xk] + Qk 1:

p p

Pk 1 Pk 1

(3.50)

Update: Compute the predicted mean k and covariance of the measurement Sk, and the cross-covariance of the state and measurement Ck:

Xk = mk mk + p

 

h0

q

 

q

 

i

 

Pk

Pk

c

Yk = h(Xk ; k)

(3.51)

k = Yk wm

Sk = Yk W [Yk ]T + Rk

 

 

 

 

 

Ck = Xk W [Yk ]T :

 

 

 

 

 

Then compute the filter gain Kk and the updated state mean mk and covariance Pk:

Kk = Ck Sk 1

 

 

 

 

 

 

m

k

= m

+ K

k

[y

k

 

]

(3.52)

 

k

 

 

k

 

Pk = Pk Kk Sk KTk :

The prediction and update steps of the nonaugmented UKF can be computed with functions ukf_predict1 and ukf_update1, respectively.

3.3.4 Augmented UKF

It is possible to modify the UKF procedure described above by forming an augmented state variable, which concatenates the state and noise components together, so that the effect of process and measurement noises can be used to better capture the odd-order moment information. This requires that the sigma points generated during the predict step are also used in the update step, so that the effect of noise terms are truly propagated through the nonlinearity (Wu et al., 2005). If, however, we generate new sigma points in the update step the augmented approach give the same results as the nonaugmented, if we had assumed that the noises were additive. If the noises are not additive the augmented version should produce more accurate

31

CHAPTER 3. NONLINEAR STATE SPACE ESTIMATION

estimates than the nonaugmented version, even if new sigma points are created during the update step.

The prediction and update steps of the augmented UKF in matrix form are as follows:

• Prediction: Form a matrix of sigma points of the augmented state variable

x~k 1 = xkT 1 qkT 1 rkT 1 T as

 

 

 

 

 

 

 

 

X~ k 1 = m~ k 1

 

m~ k 1

+ p

 

h0

q

P~ k 1

q

P~ k 1

i;

(3.53)

c

where

 

 

 

 

and P~ k 1 =

2

 

 

Qk 1

 

3

 

m~ k 1 = mkT

1

0 0

 

0

 

0

: (3.54)

 

 

 

 

T

 

 

 

 

4

Pk 1

 

0

0

 

 

 

 

 

 

 

 

 

0

 

 

0

Rk 15

 

Then compute the predicted state mean mk Pk as

^

x

q

Xk

= f(X k 1

; X k 1

mk

= X^ k wm

 

^ ^ T

Pk = Xk W [Xk] ;

and the predicted covariance

; k 1)

(3.55)

where we have denoted the components of sigma points which correspond to actual state variables and process noise with matrices Xxk 1 and Xqk 1, respectively. The state transition function f is also augmented to incorporate the effect of process noise, which is now passed to the function as a second parameter. In additive noise case the process noise is directly added to the state variables, but other forms of noise effect are now also allowed.

Update: Compute the predicted mean k and covariance of the measurement Sk, and the cross-covariance of the state and measurement Ck:

^ r

Yk = h(Xk; Xk 1; k)

k = Yk wm

(3.56)

Sk = Yk W [Yk ]T

 

Ck = X^ k W [Yk ]T ;

 

where we have denoted the component of sigma points corresponding to measurement noise with matrix Xrk 1. Like the state transition function f also the measurement function h is now augmented to incorporate the effect of measurement noise, which is passed as a second parameter to the function.

32

CHAPTER 3. NONLINEAR STATE SPACE ESTIMATION

Then compute the filter gain Kk and the updated state mean mk and covariance Pk:

Kk = Ck Sk 1

 

 

 

 

 

 

m

k

= m

+ K

k

[y

k

 

]

(3.57)

 

k

 

 

k

 

Pk = Pk Kk Sk KTk :

Note that nonaugmented form UKF is computationally less demanding than augmented form UKF, because it creates a smaller number of sigma points during the filtering procedure. Thus, the usage of the nonaugmented version should be preferred over the nonaugmented version, if the propagation of noise terms doesn’t improve the accuracy of the estimates.

The prediction and update steps of the augmented UKF can be computed with functions ukf_predict3 and ukf_update3, respectively. These functions concatenates the state variables, process and measurements noises to the augmented variables, as was done above.

It is also possible to separately concatenate only the state variables and process noises during prediction step and state variables and measurement noises during update step. Filtering solution based on this formulation can be computed with functions ukf_predict2 and ukf_update2. However, these functions create new sigma points during the update step in addition to ones created during prediction step, and hence the higher moments might not get captured so effectively in cases, where the noise terms are additive.

3.3.5 Unscented Kalman Smoother

The Rauch-Rung-Striebel type smoother using the unscented transformation (Särkkä, 2008) can be used for computing a Gaussian approximation to the smoothing distribution of the step k:

p(xkjy1:T ) N(xkjmks ; Pks );

(3.58)

as follows (using again the matrix form):

• Form a matrix of sigma points of the augmented state variable x~k 1 =

xkT 1 qkT 1 T as

 

 

 

 

 

h0

q

 

q

 

 

i;

 

X~ k 1 = m~ k 1

m~ k 1

+ p

 

P~ k 1

P~ k 1

(3.59)

c

where

0

 

and P~ k 1 =

 

 

0

Qk 1

 

 

 

 

m~ k 1 = mk 1

 

 

:

 

(3.60)

T

 

T

 

 

 

 

 

Pk 1

0

 

 

 

 

33

CHAPTER 3. NONLINEAR STATE SPACE ESTIMATION

• Propagate the sigma points through the dynamic model:

 

 

X~

= f(X~ x; X~ q

; k);

(3.61)

 

k+1

k k

 

 

~ x

~ q

 

 

 

where Xk and Xk denotes the parts of sigma points, which correspond to xk

and qk, respectively.

Compute the predicted mean mk+1, covariance Pk+1 and cross-covariance

Ck+1:

mk+1 = X~ k+1x

wm

 

Pk+1 = X~ k+1x

W [X~ k+1x ]T

(3.62)

Ck+1 = X~ k+1x

W [X~ kx]T ;

 

where ~ x denotes the part of propagated sigma points ~ , which cor-

Xk+1 Xk+1

responds to xk.

Compute the smoother gain Dk, the smoothed mean msk and the covariance

Psk:

Dk = Ck+1[Pk+1] 1

 

 

 

 

ms

= m

k

+ D

[ms

 

m

]

(3.63)

k

 

k

k+1

k+1

 

Psk = Pk + Dk[Psk+1 Pk+1]DTk :

The smoothing solution of this augmented type RTS smoother can be computed with function urts_smooth2. Also a nonaugmented version of this type smoother has been implemented, and a smoothing solution with that can be computed with function urts_smooth1.

34

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]