tigercontrol.models.control.KalmanFilter

class tigercontrol.models.control.KalmanFilter[source]

Description: Kalman Filter adjusts measurements of a signal based on prior states and knowledge of intrinsic equations of the system.

More precisely, we know that the signal at time t is a linear combination of its previous value plus a control signal u(t) and a process noise w(t - 1), i.e. x(t) = A x(t - 1) + B u(t) + w(t), and that the measurement at time t is a linear combination of the signal value and the measurement noise v(t), i.e. z(t) = H x(t) + v(t).

Based on these, the model can advance by itself in time using a ‘time’ update and/or incorporate and correct a measurement using a ‘measurement’ update:

a. Time Update (prediction) - Project state ahead: x(t) = A x(t - 1) + B u(t) - Project error covariance ahead: P(t) = A P(t - 1) A^T + Q

b. Measurement Update - Compute Kalman Gain: K(t) = P(t) H^T (H P(t) H^T + R)^{-1} - Update estimate based on measurement: x(t) = x(t) + K(t) (z(t) - H x(t)) - Update error covariance: P(t) = (I - K(t) H) P(t)

where we assume w(t) ~ N(0, Q) and v(t) ~ N(0, R).

The user must provide estimates for A, B, H, Q and R, as well as initial estimates for x(0) and P(0).

__init__()[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__() Initialize self.
help() Description:
initialize(x, A, B, H, P, Q, R) Description:
predict(u, z[, n]) Description:
step(u, z[, n]) Description:
to_ndarray(x) Description: If x is a scalar, transform it to a (1, 1) numpy.ndarray; otherwise, leave it unchanged.
update(**kwargs)

Attributes

compatibles
spec