[SciPy-user] lmder

Christian Kristukat gekauft at hoc.net
Tue Aug 3 07:57:15 EDT 2004


Hi,
I tried to use scipys lmder wrapper like in the following lines but it 
segfaults on SuSE9.1/python2.3/scipy0.3a. Am I using it wrong or is this 
a bug?

from scipy import *
import math

x = r_[0:10]
y = 1/3.0*x**2+1/7.0*x-math.pi

def res(a, *args):
     return y-(a[0]*x**2+a[1]*x+a[2])

def jac(*args):
     j = []
     j.append(x**2)
     j.append(x)
     j.append(1+0*x)
     j = array(j)
     return j

a = array([0,0,0])
info  = optimize.leastsq(res, a, Dfun=jac, col_deriv=1)

print info

Thanks for help,
Christian




More information about the SciPy-User mailing list