el0ps.datafit.Leastsquares¶
- class el0ps.datafit.Leastsquares(y)¶
Least-squares datafit function.
The function is defined as
\[f(\mathbf{w}) = \sum_{i=1}^m \tfrac{1}{2}(y_i - w_i)^2\]for some \(\mathbf{y} \in \mathbb{R}^m\).
- Parameters:
- yNDArray
Data vector.
- __init__(y)¶
Methods
__init__(y)bind_model(model)Impose a constraint associated with the datafit function in a pyomo model.
conjugate(w)Value of the convex conjugate of the function at
w.get_spec()Specify the numba types of the class attributes.
gradient(w)Value of gradient at
w.gradient_lipschitz_constant()Lipschitz constant of the gradient.
params_to_dict()Returns the parameters name and value used to initialize the class instance.
value(w)Value of the function at
w.