[SciPy-user] Another leastsq Jacobian bug
Mon Jun 25 22:33:35 CDT 2007
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 .
More information about the SciPy-user