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

John Pye john at curioussymbols.com
Sun May 6 04:38:23 EDT 2007


Christian K. wrote:
> 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
'Tis true! Thanks very much.

So is it fair to say that the default value of this parameter should
perhaps be changed?

Cheers
JP



More information about the SciPy-User mailing list