[SciPy-user] Another leastsq Jacobian bug
Tue Jun 26 18:47:41 CDT 2007
Lin Shao wrote:
> No I didn't. The simplest refute to your answer is that your J is
> -2*params*(xx*params-params^2). How could there be a term
> with params's quadratic in the derivative if the original function
> is a quadratic function?
> On 6/25/07, Christian K <firstname.lastname@example.org> wrote:
>> Lin Shao wrote:
>>>>> ## Now define my Jacobian
>>>>> def Jacobian(params,xx,yy,mode='col'):
>>>>> J = N.empty((len(params),xx.size))
>>>>> J = (xx-params)**2
>>>>> J = -2*params*(xx-params)
>>>> shouldn't that be -2*params*(xx-params)*params ?
>>> I think I was right. Think about what's the derivative of -x^2 -- it's -2x
>> you forgot about the chain rule .
You're right. Sorry.
More information about the SciPy-user