fit()

Contents

fit()#

ROM.fit(states, lhs=None, inputs=None, fit_transformer: bool = True, fit_basis: bool = True)[source]#

Calibrate the model to training data.

Parameters:
stateslist of s (n, k_i) ndarrays

State snapshots in the original state space. Each array states[i] is data corresponding to a different trajectory; each column states[i][:, j] is one snapshot. If there is only one trajectory of training data (s = 1), states may be an (n, k) ndarray. In this case, it is assumed that lhs and inputs (if given) are arrays, not a sequence of arrays.

lhslist of s (n, k_i) ndarrays or None

Left-hand side regression data. Each array lhs[i] is the data corresponding to parameter value parameters[i]; each column lhs[i][:, j] corresponds to the snapshot states[i][:, j].

  • If the model is time continuous, these are the time derivatives of the state snapshots.

  • If the model is fully discrete, these are the “next states” corresponding to the state snapshots.

If None, these are estimated using ddt_estimator (time continuous) or extracted from states (fully discrete).

inputslist of s (m, k_i) ndarrays or None

Input training data. Each array inputs[i] is the data corresponding to parameter value parameters[i]; each column inputs[i][:, j] corresponds to the snapshot states[:, j]. May be a two-dimensional array if \(m=1\) (scalar input). Only required if one or more model operators depend on inputs.

fit_transformerbool

If True (default), calibrate the preprocessing transformation using the states. If False, assume the transformer is already calibrated.

fit_basisbool

If True, calibrate the high-to-low dimensional mapping using the states. If False, assume the basis is already calibrated.

Returns:
self