scipy.odr.RealData#
- class scipy.odr.RealData(x, y=None, sx=None, sy=None, covx=None, covy=None, fix=None, meta=None)[source]#
The data, with weightings as actual standard deviations and/or covariances.
- Parameters:
- xarray_like
Observed data for the independent variable of the regression
- yarray_like, optional
If array-like, observed data for the dependent variable of the regression. A scalar input implies that the model to be used on the data is implicit.
- sxarray_like, optional
Standard deviations of x. sx are standard deviations of x and are converted to weights by dividing 1.0 by their squares.
- syarray_like, optional
Standard deviations of y. sy are standard deviations of y and are converted to weights by dividing 1.0 by their squares.
- covxarray_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.
- covyarray_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.
- fixarray_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.
- metadict, 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./np.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] = np.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.