[SciPy-user] Matlab lsqlin equivalent: Constrained least squares

Robert Kern robert.kern at gmail.com
Sat Jun 24 01:39:59 EDT 2006


Sebastian Haase wrote:
> Hi,
> A friend of mine needs a constrained least squares solver.
> He says that Matlab's lsqlin
> http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/lsqlin.shtml
> would look like it should do the trick.
> 
> Is there already some function in scipy.optimize
> that is equivalent ?

Depends. What kind of bounds does he actually need?

   Constrained Optimizers (multivariate)

    fmin_l_bfgs_b -- Zhu, Byrd, and Nocedal's L-BFGS-B constrained optimizer
                       (if you use this please quote their papers -- see help)

    fmin_tnc      -- Truncated Newton Code originally written by Stephen Nash and
                       adapted to C by Jean-Sebastien Roy.

    fmin_cobyla   -- Constrained Optimization BY Linear Approximation


fmin_l_bfgs_b and fmin_tnc only do rectilinear min-max bounds. fmin_cobyla 
allows arbitrary sets of (possibly nonlinear) "f(x)>=b" bounds.

The equality contraints in lsqlin can probably by transforming the problem into 
the solution space of Aeq*x=b.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco




More information about the SciPy-User mailing list