Skip to main content

Module bounded

Module bounded 

Source
Expand description

Optimisation with simple bounds l ≤ x ≤ u, following scipy.optimize:

  • minimize_lbfgsb: the limited-memory quasi-Newton method L-BFGS-B of Byrd, Lu, Nocedal and Zhu (1995): a generalised Cauchy point along the projected gradient path fixes the active bounds, a subspace minimisation of the limited-memory model moves the free variables, and a line search capped at the bounds finishes the step.
  • least_squares_bounded: nonlinear least squares with bounds and robust loss functions by the trust-region reflective method of Branch, Coleman and Li (a port of SciPy’s least_squares(method='trf') with the exact trust-region solver).
  • lsq_linear: linear least squares with bounds by the bounded-variable least-squares algorithm of Stark and Parker (SciPy’s lsq_linear(method='bvls')).
  • nnls: non-negative least squares by the active-set method of Lawson and Hanson.

See the book entry Bound-constrained optimisation.

Structs§

BoundedLeastSquaresResult
The result of least_squares_bounded.
BoundedResult
The result of a bound-constrained minimisation.
LbfgsbOptions
Options for minimize_lbfgsb, with SciPy’s defaults.
LeastSquaresOptions
Options for least_squares_bounded, with SciPy’s defaults.
LinearLsqResult
The result of lsq_linear and nnls.

Enums§

Loss
Robust loss functions ρ(z) of the squared residual z = (f / f_scale)² (SciPy’s loss).

Functions§

least_squares_bounded
Minimises ½ Σ ρ(fᵢ(x)²) subject to lb ≤ x ≤ ub by the trust-region reflective method (SciPy’s least_squares(method='trf', tr_solver='exact', x_scale=1)). fun returns the residuals and jac their Jacobian (rows = residuals).
least_squares_dogbox
Bounded nonlinear least squares by the dogbox method (SciPy’s least_squares(method="dogbox")), Voglis and Lagaris’s rectangular trust region. Variables on a bound whose gradient pushes further out are fixed; for the others the Gauss-Newton step and the Cauchy point define a dogleg, followed inside the intersection of the box-shaped trust region with the bounds. It suits small problems with bounds, and is SciPy’s port step for step; same options and result as least_squares_bounded.
least_squares_lsmr
The trust-region reflective method with an iterative trust-region solver, for large or sparse problems (SciPy’s least_squares(method='trf', tr_solver='lsmr')). The Jacobian is any LinearOperator (a sparse CsrMatrix, a dense matrix, or products supplied by closures), used only through products with vectors.
lsq_linear
Linear least squares with bounds, min ½‖A x − b‖² subject to lb ≤ x ≤ ub (SciPy’s lsq_linear(method='bvls')), by Stark and Parker’s bounded-variable least squares: start from the unconstrained solution clipped to the bounds, then, while the KKT conditions are violated, free the variable with the most violated condition and solve on the free set, stepping back to the first bound crossed.
minimize_lbfgsb
Minimises f subject to lb ≤ x ≤ ub by L-BFGS-B (SciPy’s minimize(method='L-BFGS-B')). fg returns the value and gradient. Infinite bounds are allowed.
nnls
Non-negative least squares min ‖A x − b‖ with x ≥ 0 (SciPy’s nnls), by Lawson and Hanson’s active-set method: repeatedly free the variable whose gradient most wants to grow, solve the unconstrained problem on the free set, and step back to the boundary when a free variable would turn negative.