Improvements to the lstsq solver classes (lstsq._tikhonov.py).
Major improvement: lstsq.SolverTikhonov.predict() and lstsq.SolverTikhonovDecoupled.predict() attempt to solve the problem via the normal equations, (ATA + PTP)X = ATB. Though this problem is usually much smaller than the full system, it is notoriously ill conditioned if A has a high condition number (which it often does in OpInf). If the regularizer P is rank-deficient or not strong enough, then scipy.linalg.solve() can fail or give inaccurate results. If this is the case, the solvers now revert to solving the padded least-squares system [AT | PT ]TX = [BT0T ]T with scipy.linalg.lstsq(), which handles the problem in a slightly slower but more stable way.
Other improvements/changes:
Solver class documentation uses the general framework used in the Wiki.
Solver class instance attributes A, B, k, d, and r are now properties. This improves both user safety and documentation.
Solvers documentation and code treats two-dimensional B as the main case and one-dimensional B as a special case. All signatures to fit() are now fit(A, B).
Slightly improved inheritance structure (promoted some methods to _BaseSolver, etc.)
Instead of behavioral hyperparameters like compute_extras or check_regularizer, each solver now has cond(), regcond(), misfit(), and residual() methods that can only be called after fit().
lstsq.SolverL2.regcond() and lstsq.SolverL2Decopuled.regcond() (formerly accessible as the regcond_ attribute, created in predict() when compute_extras was True) computed the regularized condition number incorrectly; this has been corrected.
Improved test coverage for lstsq._tikhonov due to separating the post-processing routines.
OpInf ROM fit() methods, lstsq.solver(), and lstsq.solve() no longer accepts extra **kwargs methods, because all lstsq Solver class behavioral hyperparameters have been removed.
Improvements to the
lstsq
solver classes (lstsq._tikhonov.py
).Major improvement:
lstsq.SolverTikhonov.predict()
andlstsq.SolverTikhonovDecoupled.predict()
attempt to solve the problem via the normal equations, (ATA + PTP)X = ATB. Though this problem is usually much smaller than the full system, it is notoriously ill conditioned if A has a high condition number (which it often does in OpInf). If the regularizer P is rank-deficient or not strong enough, thenscipy.linalg.solve()
can fail or give inaccurate results. If this is the case, the solvers now revert to solving the padded least-squares system [AT | PT ]T X = [BT 0T ]T withscipy.linalg.lstsq()
, which handles the problem in a slightly slower but more stable way.Other improvements/changes:
A
,B
,k
,d
, andr
are now properties. This improves both user safety and documentation.B
as the main case and one-dimensionalB
as a special case. All signatures tofit()
are nowfit(A, B)
._BaseSolver
, etc.)compute_extras
orcheck_regularizer
, each solver now hascond()
,regcond()
,misfit()
, andresidual()
methods that can only be called afterfit()
.lstsq.SolverL2.regcond()
andlstsq.SolverL2Decopuled.regcond()
(formerly accessible as theregcond_
attribute, created inpredict()
whencompute_extras
wasTrue
) computed the regularized condition number incorrectly; this has been corrected.lstsq._tikhonov
due to separating the post-processing routines.fit()
methods,lstsq.solver()
, andlstsq.solve()
no longer accepts extra**kwargs
methods, because alllstsq
Solver class behavioral hyperparameters have been removed.This also updates the package to version
1.2.1
.