## UKUDF:

Path: Common/Estimation

```--------------------------------------------------------------------------
Implement an Unscented Kalman Filter in UD (upper diagonal) form.
The filter uses numerical integration to propagate the state.
The filter propagates sigma points, points computed from the
state plus a function of the covariance matrix. For each state
there are two sigma states.

The filter appends internal data to the datastructure

To initialize call

d = UKUDF( 'initialize', d );

To update

d = UKUDF( 'update', d, y );

d.x gives the current estimated state and d.pXX the state covariance.

The measurement function is of the form

meas = MeasFun( x, dMeasFun );

The state function is of the form

xDot = StateFun( x, t, dStateFun );

Since version 9.

--------------------------------------------------------------------------
Form:
d = UKUDF( action, d, y )
--------------------------------------------------------------------------

------
Inputs
------
action    (1,:)  'initialize' or 'update'
d         (1,1)  UKF data structure
.rHSFun      (1,:) Name of RHS function
.rHSFunData  (1,1) RHS function data structure
.measFun     (1,:) Name of measurement function
.measFunData (1,1) Measurement function data
.x           (n,1) Initial state vector
.p           (n,n) Covariance matrix for x
.dY          (1,1) Number of measurements
.L           (1,1) Number of states
.rP          (n,n) Process noise covariance
.rM          (n,n) Measurement noise covariance
.alpha       (1,1) Scaling 1e-4 <= alpha <= 1
.kappa       (1,1) Secondary scaling usually 0
.beta        (1,1) Prior knowledge of distribution = 2
for Gaussian distributed noise
.dT          (1,1) Time step
.t           (1,1) Time
y         (m,1)  Measurement vector

-------
Outputs
-------
d         (1,1)  UKF data structure with the following appended
.L          (1,1) Number of states
.n           (1,1) Twice the number of states
.y           (m,1) Measurements based on the states
.xA          {n}   Sigma points

--------------------------------------------------------------------------
References: Voss, H. U., Timmer, J., Kurths, J., "Nonlinear Dynamical System
Identification from Uncertain and Indirect Measurements,"
International Journal of Bifurcation and Chaos, Vol. 14, No. 6,
2005, pp. 1905-1933.

Van der Merwe, R. and Wan, E., "The Square-Root Unscented Kalman
Filter for State and Parameter Estimation".
--------------------------------------------------------------------------
```

## Children:

```Math: Integration/RK4
```

Back to the Common Module page