pykoop.shift_episodes
- shift_episodes(X, n_inputs=0, episode_feature=False)
Shift episodes and truncate shifted inputs.
The Koopman matrix
K
approximately satisfies:Theta_+ = Psi @ K.T
where
Psi
contains the unshifted states and inputs, andTheta_+
contains the shifted states.The regressors used in
KoopmanPipeline
expectPsi
as theirX
andTheta_+
as theiry
. This function breaks its input (also namedX
) intoPsi
andTheta_+
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]