class DMD¶
- class deeptime.decomposition.DMD(mode='exact', rank=None, driver='scipy')¶
Dynamic mode decomposition estimator. [1]
There are two supported modes:
standard, which produces “projected” DMD modes (following the original formulation of DMD),
exact, which produces DMD modes that do not required ordered data but just matched pairs of data [2].
- Parameters:
mode (str) – The estimation mode, see
available_modes
for available modes.rank (int or None, optional, default=None) – Truncation of the rank after performing SVD.
driver (str, default='numpy') – Which package to use for the SVD. Defaults to numpy, can also be ‘scipy’.
Notes
In standard DMD, one considers a temporally ordered list of data vectors \((z_0,\ldots,z_T)\in\mathbb{R}^{T\times d}\). The data is split into the pair
\[X = (z_0, \ldots, z_{T-1}),\quad Y=(z_1,\ldots, z_T).\]If the mode is exact, the list does not need to be temporally ordered but just the pairs \((X_i, Y_i)\) have to match. The underlying assumption is that the data are generated by a linear relationship
\[z_{t+1} = A z_t\]for some matrix \(A\).
The so-called DMD modes and eigenvalues are then the (potentially scaled) eigenvectors and eigenvalues of \(A\).
References
Attributes
The available drivers.
The available estimation modes.
Property reporting whether this estimator contains an estimated model.
mode
Shortcut to
fetch_model()
.Methods
Yields the estimated model if
fit()
was called.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)See
DMDModel.transform()
.- __call__(*args, **kwargs)¶
Call self as a function.
- fetch_model() Optional[DMDModel] ¶
Yields the estimated model if
fit()
was called.- Returns:
model – The model or None.
- Return type:
DMDModel 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:
- 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)¶
See
DMDModel.transform()
.- Parameters:
data ((T, d) np.ndarray) – Input data
- Returns:
result – Propagated input data
- Return type:
(T, d) np.ndarray
- available_drivers = ('numpy', 'scipy')¶
The available drivers.
- available_modes = ('exact', 'standard')¶
The available estimation modes.
- 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()
.