def func(p, input):
x,z = input
x = np.array(x)
z = np.array(z)
return (p[0]*x + p[1]*z + p[2])
initialGuess = [1,1,1]
myModel = Model(func)
myData = Data([x_data, z_daya], y_data)
myOdr = ODR(myData, myModel, beta0 = initialGuess)
myOdr.set_job(fit_type=0)
out = myOdr.run()
print out.beta
It works perfectly in 2d dimension (2 axes), but in 3d dimension the results are not even close to real, moreover it is very sensitive to initial Guess, so it returns different result even if i change InitiaGuess from [1,1,1] to [0.99,1,1]
What do I do wrong?
Im not very strong in mathematics, but may be I should specify some additional parameters such as Jacobian matrix or weight matrix or something else?
Can you provide a complete runnable example including some data? Note
that if you do not specify any errors on your data, they are assumed
to correspond to a standard deviation of 1 for all dimensions. If that
is wildly different from the actual variance around the "true"
surface, then it might lead the optimizer astray.
--
Robert Kern
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user