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

Christian K ckkart at hoc.net
Sun May 6 21:05:29 EDT 2007


John Pye wrote:
> 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?

I'm not an expert but I would say no. I think it is good begin with the smallest
step size to avoid stepping beyond the optimum.

Christian




More information about the SciPy-User mailing list