[SciPy-User] Bounded Linear Least-Squares

Daniel Lepage dplepage at gmail.com
Wed Apr 20 10:39:59 EDT 2011


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.

Thanks,
Dan Lepage



More information about the SciPy-User mailing list