[SciPy-User] Bounded Linear Least-Squares

josef.pktd at gmail.com josef.pktd at gmail.com
Wed Apr 20 10:54:18 EDT 2011


On Wed, Apr 20, 2011 at 10:39 AM, Daniel Lepage <dplepage at gmail.com> wrote:
> Hi all,
>    Does scipy have a function analogous to Matlab's lsqlin? I need to
> solve two problems of the form Ax = b, one subject to the constraint
> that 0 <= x, and one subject to 0 <= x <= 1. The first case is handled
> by scipy.optimize.nnls, but it doesn't support the second. I know that
> scipy.optimize includes several constrained optimization routines, but
> AFAICT they're all aimed at minimizing arbitrary functions, and as
> such I'd expect them to be far slower than an actual linear solver. Is
> there such a constrained linear solver in scipy (or numpy, or
> scikits.*, etc.)?
>
> Even better would be a constrained matrix factorization routine, i.e.
> that solves AX = B for X with A, X and B all being matrices, subject
> to 0 <= X <= 1, but obviously you can construct the latter from the
> former, so the former would suffice.

I don't know anything that would solve this directly, but I think that

scipy.optimize.fmin_slsqp

should work well in this case.

Josef

>
> Thanks,
> Dan Lepage
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>



More information about the SciPy-User mailing list