class EDMD

class deeptime.decomposition.EDMD(basis: Callable[[ndarray], ndarray], n_eigs: Optional[int] = None, operator: str = 'koopman')

Extended dynamic mode decomposition for estimation of the Koopman (or optionally Perron-Frobenius) operator. [1] [2].

The estimator needs a basis \(\Psi : \mathbb{R}^n\to\mathbb{R}^k, \mathbf{x}\mapsto\Psi(\mathbf{x}))\) and data matrices \(X = [x_1,\ldots,x_M]\), \(Y=[y_1,\ldots,y_M]\) of time-lagged pairs of data. It then estimates a Koopman operator approximation \(K\) so that \(\Psi(y_i)\approx K^\top \Psi(x_i)\).

In other words, for data matrices \(\Psi_X\) and \(\Psi_Y\) it solves the minimization problem

\[\min\| \Psi_Y - K\Psi_X\|_F.\]
Parameters:
  • basis (callable) – The basis callable, maps from (T, k) ndarray to (T, m) ndarray. See deeptime.basis for a selection of pre-defined bases.

  • n_eigs (int, optional, default=None) – The number of eigenvalues, determining the number of dominant singular functions / modes being estimated. If None, estimates all eigenvalues / eigenvectors.

  • operator (str, default='koopman') – Which operator to estimate, see available_operators.

References

Attributes

available_operators

The supported operators.

has_model

Property reporting whether this estimator contains an estimated model.

model

Shortcut to fetch_model().

Methods

fetch_model()

Yields the estimated model or None.

fit(data, **kwargs)

Fit this estimator instance onto data.

fit_fetch(data, **kwargs)

Fits the internal model on data and subsequently fetches it in one call.

fit_transform(data[, fit_options, ...])

Fits a model which simultaneously functions as transformer and subsequently transforms the input data.

get_params([deep])

Get the parameters.

set_params(**params)

Set the parameters of this estimator.

transform(data, **kwargs)

Transforms data with the encapsulated model.

__call__(*args, **kwargs)

Call self as a function.

fetch_model() Optional[EDMDModel]

Yields the estimated model or None.

Returns:

model – The model.

Return type:

EDMDKoopmanModel or None

fit(data, **kwargs)

Fit this estimator instance onto data.

Parameters:
  • data – Input data, see to_dataset for options.

  • **kwargs – Kwargs, may contain lagtime.

Returns:

self – Reference to self.

Return type:

EDMD

fit_fetch(data, **kwargs)

Fits the internal model on data and subsequently fetches it in one call.

Parameters:
  • data (array_like) – Data that is used to fit the model.

  • **kwargs – Additional arguments to fit().

Returns:

The estimated model.

Return type:

model

fit_transform(data, fit_options=None, transform_options=None)

Fits a model which simultaneously functions as transformer and subsequently transforms the input data. The estimated model can be accessed by calling fetch_model().

Parameters:
  • data (array_like) – The input data.

  • fit_options (dict, optional, default=None) – Optional keyword arguments passed on to the fit method.

  • transform_options (dict, optional, default=None) – Optional keyword arguments passed on to the transform method.

Returns:

output – Transformed data.

Return type:

array_like

get_params(deep=False)

Get the parameters.

Returns:

params – Parameter names mapped to their values.

Return type:

mapping of string to any

set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:

**params (dict) – Estimator parameters.

Returns:

self – Estimator instance.

Return type:

object

transform(data, **kwargs)

Transforms data with the encapsulated model.

Parameters:
  • data (array_like) – Input data

  • **kwargs – Optional arguments.

Returns:

output – Transformed data.

Return type:

array_like

available_operators = ('koopman', 'perron-frobenius')

The supported operators.

property has_model: bool

Property reporting whether this estimator contains an estimated model. This assumes that the model is initialized with None otherwise.

Type:

bool

property model

Shortcut to fetch_model().