Kalman Filter and Smoother
cuthbert.gaussian.kalman
Implements the square-root, parallel-in-time Kalman filter for linear Gaussian SSMs.
build_filter(get_init_params, get_dynamics_params, get_observation_params)
Builds an exact Kalman filter object for linear Gaussian SSMs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
get_init_params
|
GetInitParams
|
Function to get m0, chol_P0 to initialize filter state, given model inputs sufficient to define p(x_0) = N(m0, chol_P0 @ chol_P0^T). |
required |
get_dynamics_params
|
GetDynamicsParams
|
Function to get dynamics parameters, F, c, chol_Q given model inputs sufficient to define p(x_t | x_{t-1}) = N(F @ x_{t-1} + c, chol_Q @ chol_Q^T). |
required |
get_observation_params
|
GetObservationParams
|
Function to get observation parameters, H, d, chol_R, y given model inputs sufficient to define p(y_t | x_t) = N(H @ x_t + d, chol_R @ chol_R^T). |
required |
Returns:
| Type | Description |
|---|---|
Filter
|
Filter object for exact Kalman filter. Suitable for associative scan. |
Source code in cuthbert/gaussian/kalman.py
build_smoother(get_dynamics_params, store_gain=False, store_chol_cov_given_next=False)
Builds an exact Kalman smoother object for linear Gaussian SSMs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
get_dynamics_params
|
GetDynamicsParams
|
Function to get dynamics parameters, F, c, chol_Q given model inputs sufficient to define p(x_t | x_{t-1}) = N(F @ x_{t-1} + c, chol_Q @ chol_Q^T). |
required |
store_gain
|
bool
|
Whether to store the gain matrix in the smoother state. |
False
|
store_chol_cov_given_next
|
bool
|
Whether to store the chol_cov_given_next matrix in the smoother state. |
False
|
Returns:
| Type | Description |
|---|---|
Smoother
|
Smoother object for exact Kalman smoother. Suitable for associative scan. |
Source code in cuthbert/gaussian/kalman.py
cuthbert.gaussian.types
Provides shared types for Gaussian representations in state-space models.
GetInitParams
Bases: Protocol
Protocol for defining the initial distribution of a linear Gaussian SSM.
GetDynamicsParams
Bases: Protocol
Protocol for defining the dynamics model of a linear Gaussian SSM.
GetObservationParams
Bases: Protocol
Protocol for defining the observation model of a linear Gaussian SSM.