3.2.3. Numerical Implementation of Single-Object Smoother

For completeness, we outline here the detailed numerical implementation of the single-object RTS smoother for both linear and nonlinear dynamic models with Gaussian assumption on the distribution of the states.

Given a linear dynamic model of the form

$$\mathbf{x}\_{+} = F\mathbf{x} + q\_{\prime}z = H\mathbf{x} + r$$

where *x* is the system state, *F* is the linear transformation matrix, *H* is the linear observation matrix, *q* and *r* are respectively the process and observation Gaussian noise, and *z* is the current time step measurement, the backward smoothing step over an interval *N* ≤ *K* (where *K* is the total number of tracking time steps) can be implemented with the standard RTS Smoother [32]. The details of the RTS smoother is given in Algorithm 2, where the superscript *s* denotes the smoothed results.


**Input:** The filtered mean and covariance {*xk*, *Pk*}*k*=1:*N*, *F*, *Q* **Output:** The smoothed mean and covariance {*x<sup>s</sup> <sup>k</sup>*, *<sup>P</sup><sup>s</sup> k* }*k*=1:*N*

```
Initialization: xs
                N = xN and Ps
                               N = PN
for k = N − 1 down to 1
    x¯k+1 = Fxk
    P¯
      k+1 = FPkFT + Q
    D = Pk+1F(P¯
                  k+1)−1
    xs
      k = xk + D(xs
                   k+1 − x¯k+1)
    Ps
      k = Pk + D(Ps
                   k+1 − P¯
                           k+1)DT
end
```
For a nonlinear dynamic model, the RTS smoother can also be applied via the unscented transformation [39]. Given the dynamic model

$$\mathbf{x}\_{+} = f(\mathbf{x}, \mathbf{q})\_{\prime} \\ y = h(\mathbf{x}, r)\_{\prime}$$

where *f* is the nonlinear state transition function and *h* is the nonlinear observation function, other variables are interpreted the same as in the linear model; the smoothed results can be inferred via the Unscented RTS (URTS) smoother [36]. The smoothing procedure is presented in Algorithm 3, and the readers are referred to Reference [39] for the detailed implementation of the unscented transform. Compared to the Sequential Monte Carlo method, unscented transform is less computationally expensive as the number of sigma points to approximate a Gaussian distribution is much lower than the number of particles to represent the entire density.
