Class KalmanSmoother

  • All Implemented Interfaces:
    KalmanObserver

    public class KalmanSmoother
    extends Object
    implements KalmanObserver
    Kalman smoother for linear, extended or unscented filters.

    This implementation is attached to a filter using the observer mechanism. Once all measurements have been processed by the filter, the smoothing method can be called.

    For example

    
         // Kalman filter
         final KalmanFilter<SimpleMeasurement> filter = new LinearKalmanFilter<>(decomposer, process, initialState);
    
         // Smoother observer
         final KalmanSmoother smoother = new KalmanSmoother(decomposer);
         filter.setObserver(smoother);
    
         // Process measurements with filter (forwards pass)
         measurements.forEach(filter::estimationStep);
    
         // Smooth backwards
         List<ProcessEstimate> smoothedStates = smoother.backwardsSmooth();
     
    See Also:
    "Särkkä, S. Bayesian Filtering and Smoothing. Cambridge 2013"
    • Constructor Detail

      • KalmanSmoother

        public KalmanSmoother​(MatrixDecomposer decomposer)
        Simple constructor.
        Parameters:
        decomposer - decomposer to use for the smoother gain calculations
    • Method Detail

      • init

        public void init​(KalmanEstimate estimate)
        Description copied from interface: KalmanObserver
        Callback for initialisation of observer.
        Specified by:
        init in interface KalmanObserver
        Parameters:
        estimate - estimate calculated by a Kalman filter
      • updatePerformed

        public void updatePerformed​(KalmanEstimate estimate)
        Description copied from interface: KalmanObserver
        Notification callback after each Kalman filter measurement update.
        Specified by:
        updatePerformed in interface KalmanObserver
        Parameters:
        estimate - estimate calculated by a Kalman filter
      • backwardsSmooth

        public List<ProcessEstimate> backwardsSmooth()
        Backwards smooth. This is a backward pass over the filtered data, recursively calculating smoothed states, using the Rauch-Tung-Striebel (RTS) formulation. Note that the list result is a `LinkedList`, not an `ArrayList`.
        Returns:
        list of smoothed states