UnivariateFilter#
- class pymc_extras.statespace.filters.UnivariateFilter[source]#
The univariate kalman filter, described in [1], section 6.4.2, avoids inversion of the F matrix, as well as two matrix multiplications, at the cost of an additional loop. Note that the name doesn’t mean there’s only one observed time series. This is called univariate because it updates the state mean and covariance matrices one variable at a time, using an inner-inner loop.
This is useful when states are perfectly observed, because the F matrix can easily become degenerate in these cases.
References
- __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)Perform the update step of the Kalman filter.