kkf.filter#

Koopman Kalman Filter algorithm implementation.

Combines Koopman operator theory with Kalman filtering for nonlinear state estimation.

Functions

apply_koopman_kalman_filter(...[, optimize, ...])

Implementation of the Koopman-Kalman Filter algorithm.

kkf.filter.apply_koopman_kalman_filter(koopman_operator, observations, initial_distribution, n_features, optimize=False, n_restarts_optimizer=10, noise_samples=100, reg=1e-10)[source]#

Implementation of the Koopman-Kalman Filter algorithm.

This function combines Koopman operator theory with Kalman filtering to perform state estimation for nonlinear dynamical systems. It operates by lifting the state space to a higher-dimensional feature space where the dynamics are approximately linear.

Parameters:
  • koopman_operator (object) – Object containing Koopman operator methods and attributes: - compute_edmd(n_features): Extended Dynamic Mode Decomposition method - dynamical_system: Dynamical system object - U, B, C: Matrices for Koopman approximation - phi: Feature map function

  • observations (np.ndarray) – Array of shape (n_timesteps, n_outputs) containing system measurements.

  • initial_distribution (object) – Distribution object for initial state with methods: - mean: Returns mean of initial state - rvs: Random sampling method

  • n_features (int) – Number of features in the lifted space.

  • optimize (bool, optional) – Whether to optimize the kernel parameters. Default is False.

  • n_restarts_optimizer (int, optional) – Number of restarts for kernel optimization. Default is 10.

  • noise_samples (int, optional) – Number of samples for noise covariance estimation. Default is 100.

  • reg (float, optional) – Jitter regularization for the Koopman Gram-matrix inversion. Default is 1e-10.

Returns:

Object containing all filter estimates and covariances.

Return type:

KoopmanKalmanFilterSolution

Notes

The algorithm consists of three main phases:

  1. Initialization:

    • Sets up initial states and covariances

    • Computes Koopman approximation

  2. Prediction Step:

    • Projects state forward using system dynamics

    • Updates covariances using Koopman operator

  3. Update Step:

    • Incorporates new measurements

    • Updates state and covariance estimates

The filter operates in both the original state space (x) and the lifted feature space (z), maintaining estimates and covariances in both spaces.