[Numpy-discussion] How can I constrain linear_least_squares to integer solutions?

Mark Schmucker Mark.Schmucker at 4DTechnology.com
Tue Nov 27 23:51:06 EST 2007


Hi,

 

I have successfully used LinearAlgebra.linear_least_squares to estimate
solutions to continuous functions. The coefficients returned in that
case are of course floating-point values.

 

Now I have a problem where some of the terms are continuous but some
must be constrained to integer multiples. As a simple example,

 

y = c1 * x^2 + c0 * x

 

where c1 is floating-point in the usual way, but c0 can only be
integer-valued. (The actual problem has many more terms.)

 

Can anyone tell me how to constrain some of the coefficients to integer
values?

 

Thank you for any insight.

 

Mark

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20071127/bee62c07/attachment.html>


More information about the NumPy-Discussion mailing list