kkf.covariances#
Functions
|
Compute the covariance matrix for the system dynamics in feature space. |
|
Compute the covariance matrix for the initial distribution in feature space. |
|
Compute the covariance matrix for the observation/measurement process. |
- kkf.covariances.compute_dynamics_covariance(x, n_features, dynamics, koopman_operator, n_samples)[source]#
Compute the covariance matrix for the system dynamics in feature space.
This function samples from the dynamics distribution, applies the system dynamics, and computes the covariance matrix of the transformed results.
- Parameters:
x (np.ndarray) – Current state vector or reference point.
n_features (int) – Number of features in the transformed space.
dynamics (object) – Dynamical system object containing: - dist_dyn: scipy.stats.rv_continuous distribution for dynamics noise - dynamics(x, w): method implementing the system dynamics
koopman_operator (object) – Object containing the feature map phi method for state transformation. Must have a method phi(x) that maps states to feature space.
n_samples (int) – Number of samples to use for covariance estimation.
- Returns:
Covariance matrix of size (n_features, n_features) in the transformed space.
- Return type:
np.ndarray
Notes
The function performs the following steps: 1. Samples from the dynamics noise distribution 2. Applies the system dynamics to each sample 3. Transforms the results using the Koopman operator’s feature map 4. Computes the covariance matrix of the transformed samples
- kkf.covariances.compute_initial_covariance(x, n_features, initial_distribution, koopman_operator, n_samples)[source]#
Compute the covariance matrix for the initial distribution in feature space.
This function samples from an initial distribution and computes the covariance matrix of the transformed samples using a Koopman operator’s feature map.
- Parameters:
x (np.ndarray) – Current state vector or reference point.
n_features (int) – Number of features in the transformed space.
initial_distribution (scipy.stats.rv_continuous) – Initial probability distribution to sample from.
koopman_operator (object) – Object containing the feature map phi method for state transformation. Must have a method phi(x) that maps states to feature space.
n_samples (int) – Number of samples to use for covariance estimation.
- Returns:
Covariance matrix of size (n_features, n_features) in the transformed space.
- Return type:
np.ndarray
Notes
The function performs the following steps: 1. Samples from the initial distribution 2. Applies the Koopman operator’s feature map to each sample 3. Computes the covariance matrix of the transformed samples
- kkf.covariances.compute_observation_covariance(x, n_outputs, dynamics, n_samples)[source]#
Compute the covariance matrix for the observation/measurement process.
This function samples from the measurement noise distribution and computes the covariance matrix of the measurement process.
- Parameters:
x (np.ndarray) – Current state vector or reference point.
n_outputs (int) – Number of measurement outputs.
dynamics (object) – Dynamical system object containing: - dist_obs: scipy.stats.rv_continuous distribution for measurement noise - measurements(x, w): method implementing the measurement process
n_samples (int) – Number of samples to use for covariance estimation.
- Returns:
Covariance matrix of size (n_outputs, n_outputs) for the measurement process.
- Return type:
np.ndarray
Notes
The function performs the following steps: 1. Samples from the measurement noise distribution 2. Applies the measurement function to each sample 3. Computes the covariance matrix of the measurements