UnscentedKalman

class probnum.filtsmooth.UnscentedKalman(dynamod, measmod, initrv)[source]

Bases: probnum.filtsmooth.GaussFiltSmooth

Factory method for Unscented Kalman filters.

Attributes Summary

dynamicmodel Convenience function for accessing self.dynamod.
initialdistribution Convenience function for accessing self.initdist.
initialrandomvariable Convenience function for accessing self.initrv.
measurementmodel Convenience function for accessing self.measmod.

Methods Summary

filter(dataset, times, **kwargs) Apply Gaussian filtering (no smoothing!) to a data set.
filter_step(start, stop, randvar, data, **kwargs) A single filter step.
filtsmooth(dataset, times, **kwargs) Apply Gaussian filtering and smoothing to a data set.
predict(start, stop, randvar, **kwargs) Prediction step of the Bayesian filter.
smooth(filter_posterior, **kwargs) Apply Gaussian smoothing to a set of filtered means and covariances.
smooth_step(unsmoothed_rv, pred_rv, …) A single smoother step.
smoother_step(**kwargs) Smoother step.
update(time, randvar, data, **kwargs) Update step of the Bayesian filter.

Attributes Documentation

dynamicmodel

Convenience function for accessing self.dynamod.

initialdistribution

Convenience function for accessing self.initdist.

initialrandomvariable

Convenience function for accessing self.initrv.

measurementmodel

Convenience function for accessing self.measmod.

Methods Documentation

filter(dataset, times, **kwargs)

Apply Gaussian filtering (no smoothing!) to a data set.

Parameters:
  • dataset (array_like, shape (N, M)) – Data set that is filtered.
  • times (array_like, shape (N,)) – Temporal locations of the data points.
  • kwargs
Returns:

Posterior distribution of the filtered output

Return type:

KalmanPosterior

filter_step(start, stop, randvar, data, **kwargs)

A single filter step.

Consists of a prediction step (t -> t+1) and an update step (at t+1).

Parameters:
  • start (float) – Predict FROM this time point.
  • stop (float) – Predict TO this time point.
  • randvar (RandomVariable) – Predict based on this random variable. For instance, this can be the result of a previous call to filter_step.
  • data (array_like) – Compute the update based on this data.
Returns:

Resulting filter estimate after the single step.

Return type:

RandomVariable

filtsmooth(dataset, times, **kwargs)

Apply Gaussian filtering and smoothing to a data set.

Parameters:
  • dataset (array_like, shape (N, M)) – Data set that is filtered.
  • times (array_like, shape (N,)) – Temporal locations of the data points.
  • kwargs
Returns:

Posterior distribution of the smoothed output

Return type:

KalmanPosterior

predict(start, stop, randvar, **kwargs)

Prediction step of the Bayesian filter.

Not required for all filters, e.g. the Particle Filter only has an update() method.

smooth(filter_posterior, **kwargs)

Apply Gaussian smoothing to a set of filtered means and covariances.

Parameters:
  • filter_posterior (KalmanPosterior) – Posterior distribution obtained after filtering
  • kwargs
Returns:

Posterior distribution of the smoothed output

Return type:

KalmanPosterior

smooth_step(unsmoothed_rv, pred_rv, smoothed_rv, crosscov)

A single smoother step.

Consists of predicting from the filtering distribution at time t to time t+1 and then updating based on the discrepancy to the smoothing solution at time t+1.

Parameters:
  • unsmoothed_rv (RandomVariable) – Filtering distribution at time t.
  • pred_rv (RandomVariable) – Prediction at time t+1 of the filtering distribution at time t.
  • smoothed_rv (RandomVariable) – Smoothing distribution at time t+1.
  • crosscov (array_like) – Cross-covariance between unsmoothed_rv and pred_rv as returned by predict().
smoother_step(**kwargs)

Smoother step.

update(time, randvar, data, **kwargs)

Update step of the Bayesian filter.

Must be implemented by subclasses.