pykoop.shift_episodes
- shift_episodes(X, n_inputs=0, episode_feature=False)
Shift episodes and truncate shifted inputs.
The Koopman matrix
Kapproximately satisfies:Theta_+ = Psi @ K.T
where
Psicontains the unshifted states and inputs, andTheta_+contains the shifted states.The regressors used in
KoopmanPipelineexpectPsias theirXandTheta_+as theiry. This function breaks its input (also namedX) intoPsiandTheta_+for use with these regressors.- Parameters:
- Returns:
Tuple whose first element is the unshifted array and whose second element is the shifted array with its inputs truncated. Both arrays have the same number of samples. Their episode features are stripped if present.
- Return type:
Tuple[np.ndarray, np.ndarray]