StandardFilter#

class pymc_extras.statespace.filters.StandardFilter[source]#

Basic Kalman Filter

__init__()#

Kalman Filter.

Notes

The BaseFilter class is an abstract base class (ABC) for implementing kalman filters. It defines common attributes and methods used by kalman filter implementations.

seq_names#

A list of name representing time-varying statespace matrices. That is, inputs that will need to be provided to the sequences argument of pytensor.scan

Type:

list[str]

non_seq_names#

A list of names representing static statespace matrices. That is, inputs that will need to be provided to the non_sequences argument of pytensor.scan

Type:

list[str]

Methods

__init__()

Kalman Filter.

add_check_on_time_varying_shapes(data, ...)

Insert a check that time-varying matrices match the data shape to the computational graph.

build_graph(data, a0, P0, c, d, T, Z, R, H, Q)

Construct the computation graph for the Kalman filter.

check_params(data, a0, P0, c, d, T, Z, R, H, Q)

Apply any checks on validity of inputs.

handle_missing_values(y, Z, H, d)

Handle missing values in the observation data y.

kalman_step(*args)

Performs a single iteration of the Kalman filter, which is composed of two steps : an update step and a prediction step.

predict(a, P, c, T, R, Q)

Perform the prediction step of the Kalman filter.

unpack_args(args)

The order of inputs to the inner scan function is not known, since some, all, or none of the input matrices can be time varying.

update(a, P, y, d, Z, H, all_nan_flag)

Compute one-step forecasts for observed states conditioned on information up to, but not including, the current timestep, y_hat, along with the forcast covariance matrix, F.