Orthogonal regression fitting in scipy least squares method

scipy.odr implements the Orthogonal Distance Regression. See the instructions for basic use in the docstring and documentation.


I've found the solution. Scipy Odrpack works noramally but it needs a good initial guess for correct results. So I divided the process into two steps.

First step: find the initial guess by using ordinaty least squares method.

Second step: substitude these initial guess in ODR as beta0 parameter.

And it works very well with an acceptable speed.

Thank you guys, your advice directed me to the right solution