optimisation.algorithms.least_squares_penalty module

Define a variation of LeastSquares.

It is not intended to be used with phi_s fit. Approach is here to make the residues grow when the constraints are not respected.

class LeastSquaresPenalty(*args, **kwargs)

Bases: LeastSquares

A least-squares method, with a penalty function to consider constraints.

Everything is inherited from LeastSquares.

__init__(*args, **kwargs) None

Set additional information.

_abc_impl = <_abc._abc_data object>
_norm_wrapper_residuals(var: ndarray) float

Give residuals with a penalty.

_penalty(constraints_evaluations: ndarray) float

Compute appropriate penalty.

supports_constraints: bool = True