15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.11.2 Use<br />

SciPy Reference Guide, Release 0.8.dev<br />

See the docstrings of odr.odrpack and the functions and classes for usage instructions. The ODRPACK User’s Guide<br />

is also quite helpful. It can be found on one of the ODRPACK’s original author’s website:<br />

http://www.boulder.nist.gov/mcsd/Staff/JRogers/odrpack.html<br />

Robert Kern robert.kern@gmail.com<br />

class Data(x, y=None, we=None, wd=None, fix=None, meta={})<br />

The Data class stores the data to fit.<br />

Each argument is attached to the member of the instance of the same name. The structures of x and y are<br />

described in the Model class docstring. If y is an integer, then the Data instance can only be used to fit with<br />

implicit models where the dimensionality of the response is equal to the specified value of y. The structures of<br />

wd and we are described below. meta is an freeform dictionary for application-specific use.<br />

we weights the effect a deviation in the response variable has on the fit. wd weights the effect a deviation<br />

in the input variable has on the fit. To handle multidimensional inputs and responses easily, the structure of<br />

these arguments has the n’th dimensional axis first. These arguments heavily use the structured arguments<br />

feature of ODRPACK to conveniently and flexibly support all options. See the ODRPACK User’s Guide for a<br />

full explanation of how these weights are used in the algorithm. Basically, a higher value of the weight for a<br />

particular data point makes a deviation at that point more detrimental to the fit.<br />

we – if we is a scalar, then that value is used for all data points (and<br />

all dimensions of the response variable).<br />

If we is a rank-1 array of length q (the dimensionality of the response variable), then this<br />

vector is the diagonal of the covariant weighting matrix for all data points.<br />

If we is a rank-1 array of length n (the number of data points), then the i’th element is the<br />

weight for the i’th response variable observation (single-dimensional only).<br />

If we is a rank-2 array of shape (q, q), then this is the full covariant weighting matrix broadcast<br />

to each observation.<br />

If we is a rank-2 array of shape (q, n), then we[:,i] is the diagonal of the covariant weighting<br />

matrix for the i’th observation.<br />

If we is a rank-3 array of shape (q, q, n), then we[:,:,i] is the full specification of the covariant<br />

weighting matrix for each observation.<br />

If the fit is implicit, then only a positive scalar value is used.<br />

wd – if wd is a scalar, then that value is used for all data points<br />

(and all dimensions of the input variable). If wd = 0, then the covariant weighting matrix for<br />

each observation is set to the identity matrix (so each dimension of each observation has the<br />

same weight).<br />

If wd is a rank-1 array of length m (the dimensionality of the input variable), then this vector<br />

is the diagonal of the covariant weighting matrix for all data points.<br />

If wd is a rank-1 array of length n (the number of data points), then the i’th element is the<br />

weight for the i’th input variable observation (single-dimensional only).<br />

If wd is a rank-2 array of shape (m, m), then this is the full covariant weighting matrix broadcast<br />

to each observation.<br />

If wd is a rank-2 array of shape (m, n), then wd[:,i] is the diagonal of the covariant weighting<br />

matrix for the i’th observation.<br />

If wd is a rank-3 array of shape (m, m, n), then wd[:,:,i] is the full specification of the covariant<br />

weighting matrix for each observation.<br />

3.11. Orthogonal distance regression (<strong>scipy</strong>.odr) 291

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!