scipy.odr.RealData¶
- class scipy.odr.RealData(x, y=None, sx=None, sy=None, covx=None, covy=None, fix=None, meta={})[source]¶
The data, with weightings as actual standard deviations and/or covariances.
Parameters: x : array_like
x
y : array_like, optional
y
sx, sy : array_like, optional
Standard deviations of x. sx are standard deviations of x and are converted to weights by dividing 1.0 by their squares.
sy : array_like, optional
Standard deviations of y. sy are standard deviations of y and are converted to weights by dividing 1.0 by their squares.
covx : array_like, optional
Covariance of x covx is an array of covariance matrices of x and are converted to weights by performing a matrix inversion on each observation’s covariance matrix.
covy : array_like, optional
Covariance of y covy is an array of covariance matrices and are converted to weights by performing a matrix inversion on each observation’s covariance matrix.
fix : array_like, optional
The argument and member fix is the same as Data.fix and ODR.ifixx: It is an array of integers with the same shape as x that determines which input observations are treated as fixed. One can use a sequence of length m (the dimensionality of the input observations) to fix some dimensions for all observations. A value of 0 fixes the observation, a value > 0 makes it free.
meta : dict, optional
Free-form dictionary for metadata.
Notes
The weights wd and we are computed from provided values as follows:
sx and sy are converted to weights by dividing 1.0 by their squares. For example, wd = 1./numpy.power(`sx`, 2).
covx and covy are arrays of covariance matrices and are converted to weights by performing a matrix inversion on each observation’s covariance matrix. For example, we[i] = numpy.linalg.inv(covy[i]).
These arguments follow the same structured argument conventions as wd and we only restricted by their natures: sx and sy can’t be rank-3, but covx and covy can be.
Only set either sx or covx (not both). Setting both will raise an exception. Same with sy and covy.
Methods
set_meta(**kwds) Update the metadata dictionary with the keywords and data provided by keywords.