kkf.solution#
Solution data structure for Koopman Kalman Filter results.
Provides the KoopmanKalmanFilterSolution dataclass for storing and accessing filter outputs.
Classes
|
A class to store the solution of a Koopman-Kalman Filter iteration. |
- class kkf.solution.KoopmanKalmanFilterSolution(x_plus, x_minus, Pz_plus, Pz_minus, Px_plus, Px_minus, S, K)[source]#
Bases:
objectA class to store the solution of a Koopman-Kalman Filter iteration.
This class maintains the state estimates, covariance matrices, and filter gains for both the prior (minus) and posterior (plus) estimates in both state and feature spaces.
- Parameters:
- x_plus#
Posterior state estimate after measurement update.
- Type:
np.ndarray
- x_minus#
Prior state estimate from prediction step.
- Type:
np.ndarray
- Pz_plus#
Posterior covariance matrix in feature space after measurement update.
- Type:
np.ndarray
- Pz_minus#
Prior covariance matrix in feature space from prediction step.
- Type:
np.ndarray
- Px_plus#
Posterior covariance matrix in state space after measurement update.
- Type:
np.ndarray
- Px_minus#
Prior covariance matrix in state space from prediction step.
- Type:
np.ndarray
- S#
Innovation (residual) covariance matrix.
- Type:
np.ndarray
- K#
Kalman gain matrix.
- Type:
np.ndarray
Notes
The class uses the common Kalman filter notation where: - (-) denotes prior estimates before measurement update - (+) denotes posterior estimates after measurement update - Pz refers to covariances in the feature/transformed space - Px refers to covariances in the original state space
Examples
>>> solution = KoopmanKalmanFilterSolution( ... x_plus=np.array([1.0, 2.0]), ... x_minus=np.array([0.9, 1.9]), ... Pz_plus=np.eye(2), ... Pz_minus=np.eye(2) * 1.1, ... Px_plus=np.eye(2) * 0.9, ... Px_minus=np.eye(2), ... S=np.eye(2) * 0.5, ... K=np.array([[0.1, 0], [0, 0.1]]) ... )
- get_estimation_error()[source]#
Calculate the difference between prior and posterior estimates.
- Returns:
The difference between posterior and prior state estimates.
- Return type:
np.ndarray
- get_feature_dimension()[source]#
Get the dimension of the feature space.
- Returns:
The dimension of the feature space.
- Return type:
- get_state_dimension()[source]#
Get the dimension of the state vector.
- Returns:
The dimension of the state vector.
- Return type: