kernel_linear_id#

Kernel-based linear system identification.

The algorithm uses a concatenated state space representation to compute the state and input matrices given a sample of system observations. Uses the matrix inversion lemma and a linear kernel to compute the linear relationship between observations.

class gym_socks.algorithms.identification.kernel_linear_id.KernelLinearId(regularization_param=None, verbose=False, *args, **kwargs)[source]#

Stochastic linear system identification using kernel distribution embeddings.

Computes an approximation of the state and input matrices, as well as an estimate of the stochastic disturbance mean given a sample of system observations.

Parameters
  • regularization_param (float) – Regularization parameter used in the solution to the regularized least-squares problem.

  • verbose (bool) – Boolean flag to indicate verbose output.

property disturbance_mean#

The estimated stochastic disturbance mean.

fit(S)[source]#

Run the algorithm.

Parameters

S (numpy.ndarray) – Sample of (x, u, y) tuples taken iid from the system evolution. The sample should be in the form of a list of tuples.

Returns

Instance of KernelLinearId class.

Return type

self

property input_matrix#

The estimated input matrix.

predict(T, U=None)[source]#

Predict.

Parameters
  • T (numpy.ndarray) – State vectors. Should be in the form of a 2D-array, where each row indicates a state.

  • U (Optional[numpy.ndarray]) – Input vectors. Should be in the form of a 2D-array, where each row indicates an input.

Returns

The predicted resulting states after propagating through the estimated system dynamics.

Return type

numpy.ndarray

score()[source]#
property state_matrix#

The estimated state matrix.

gym_socks.algorithms.identification.kernel_linear_id.kernel_linear_id(S, regularization_param=None, verbose=False)[source]#

Stochastic linear system identification using kernel distribution embeddings.

Computes an approximation of the state and input matrices, as well as an estimate of the stochastic disturbance mean given a sample of system observations.

Parameters
  • S (numpy.ndarray) – Sample of (x, u, y) tuples taken iid from the system evolution. The sample should be in the form of a list of tuples.

  • regularization_param (Optional[float]) – Regularization parameter used in the solution to the regularized least-squares problem.

  • verbose (bool) – Boolean flag to indicate verbose output.

Returns

The fitted model computed using the linear identification algorithm.

Return type

numpy.ndarray