PlainSolver#

class PlainSolver(cond=None, lapack_driver=None)[source]#

Solve the \(2\)-norm ordinary least-squares problem without any regularization or constraints.

That is, solve

\[\argmin_{\Ohat} \|\D\Ohat\trp - \Z\trp\|_F^2.\]

The solution is calculated using scipy.linalg.lstsq().

Parameters:
condfloat or None

Cutoff for ‘small’ singular values of the data matrix. See scipy.linalg.lstsq().

lapack_driverstr or None

Which LAPACK driver is used to solve the least-squares problem. See scipy.linalg.lstsq().

Properties:
d#

Number of unknowns in each row of the operator matrix (number of columns of \(\D\) and \(\Ohat\)).

data_matrix#

\(k \times d\) data matrix \(\D\).

k#

Number of equations in the least-squares problem (number of rows of \(\D\) and number of columns of \(\Z\)).

lhs_matrix#

\(r \times k\) left-hand side data \(\Z\).

options#

Keyword arguments for scipy.linalg.lstsq().

r#

Number of operator matrix rows to learn (number of rows of \(\Z\) and \(\Ohat\))

Methods:

cond

Compute the \(2\)-norm condition number of the data matrix \(\D\).

copy

Make a copy of the solver.

fit

Verify dimensions and save the data matrices.

load

Load a serialized solver from an HDF5 file, created previously from the save() method.

residual

Compute the residual of the \(2\)-norm regression objective for each row of the given operator matrix.

save

Serialize the solver, saving it in HDF5 format.

solve

Solve the Operator Inference regression via scipy.linalg.lstsq().

verify

Verify the solver.