{ } Raw JSON

bundles / scipy 1.17.1 / scipy / odr / _odrpack

module

scipy.odr._odrpack

source: /scipy/odr/_odrpack.py :0

Members

Summary

No Docstrings

Additional content

Python wrappers for Orthogonal Distance Regression (ODRPACK).

Notes

  • Array formats -- FORTRAN stores its arrays in memory column first, i.e., an array element A(i, j, k) will be next to A(i+1, j, k). In C and, consequently, NumPy, arrays are stored row first: A[i, j, k] is next to A[i, j, k+1]. For efficiency and convenience, the input and output arrays of the fitting function (and its Jacobians) are passed to FORTRAN without transposition. Therefore, where the ODRPACK documentation says that the X array is of shape (N, M), it will be passed to the Python function as an array of shape (M, N). If M==1, the 1-D case, then nothing matters; if M>1, then your Python functions will be dealing with arrays that are indexed in reverse of the ODRPACK documentation. No real issue, but watch out for your indexing of the Jacobians: the i,jth elements (@f_i/@x_j) evaluated at the nth observation will be returned as jacd[j, i, n]. Except for the Jacobians, it really is easier to deal with x[0] and x[1] than x[:,0] and x[:,1]. Of course, you can always use the transpose() function from SciPy explicitly.

  • Examples -- See the accompanying file test/test.py for examples of how to set up fits of your own. Some are taken from the User's Guide; some are from other sources.

  • Models -- Some common models are instantiated in the accompanying module models.py . Contributions are welcome.

Credits

  • Thanks to Arnold Moene and Gerard Vermeulen for fixing some killer bugs.

Robert Kern robert.kern@gmail.com

Aliases

  • scipy.odr._odrpack