[SciPy-user] multiple regression: problem with matrix algebra

Christian K. ckkart at hoc.net
Sun May 6 03:05:26 EDT 2007


John Pye wrote:
> Hi all
> 
> I am having a little trouble with using optimize.leastsq for multiple
> regression. I've used an approach based on this tute, which deals only
> with single regression:
> http://linuxgazette.net/115/andreasen.html
> 
> But now in my adaptation to multiple regression, I can get it to work
> only if I do some dirty loop-based evaluation for my residuals. But if I
> try to use elegant matrix evaluation, the fit parameters go awry:

Set the iteration stepsize (epsfcn keyword arg of leastsq) to something 
higher than the default, which is machine precision (?), e.g. 1e-12. 
Then both methods work.

Christian






More information about the SciPy-User mailing list