FilterEx.Kalman (filter_ex v0.2.0)
Summary
Functions
Parameters
dim_x : int
Predict next state (prior) using the Kalman filter state propagation equations.
Add a new measurement (z) to the Kalman filter.
Functions
Link to this function
adaptive_eps(self, z)
Link to this function
adaptive_stddev(self, z)
Link to this function
estimate(self)
Link to this function
filter(self, zz, opts \\ [])
Link to this function
new(opts \\ [])
Parameters
dim_x : int
Number of state variables for the Kalman filter. For example, if
you are tracking the position and velocity of an object in two
dimensions, dim_x would be 4.
This is used to set the default size of P, Q, and u
dim_z : int
Number of of measurement inputs. For example, if the sensor
provides you with position in (x,y), dim_z would be 2.
dim_u : int (optional)
size of the control input, if it is being used.
Default value of 0 indicates it is not used.
Link to this function
predict(self, u \\ nil, bB \\ nil, fF \\ nil, qQ \\ nil)
Predict next state (prior) using the Kalman filter state propagation equations.
Parameters
u : np.array, default 0
Optional control vector.
B : np.array(dim_x, dim_u), or None
Optional control transition matrix; a value of None
will cause the filter to use `self.B`.
F : np.array(dim_x, dim_x), or None
Optional state transition matrix; a value of None
will cause the filter to use `self.F`.
Q : np.array(dim_x, dim_x), scalar, or None
Optional process noise matrix; a value of None will cause the
filter to use `self.Q`.
Link to this function
residual(self)
Link to this function
to_eps_adaptive(self, opts)
Link to this function
to_stddev_adaptive(self, opts)
Link to this function
update(self, z, rR \\ nil, hH \\ nil)
Add a new measurement (z) to the Kalman filter.
If z is None, nothing is computed. However, x_post and P_post are updated with the prior (x_prior, P_prior), and self.z is set to None.
Parameters
z : (dim_z, 1): array_like
measurement for this update. z can be a scalar if dim_z is 1,
otherwise it must be convertible to a column vector.
If you pass in a value of H, z must be a column vector the
of the correct size.
R : np.array, scalar, or None
Optionally provide R to override the measurement noise for this
one call, otherwise self.R will be used.
H : np.array, or None
Optionally provide H to override the measurement function for this
one call, otherwise self.H will be used.