scipy.odr.unilinear#
- scipy.odr.unilinear = <scipy.odr._models._UnilinearModel object>[source]#
Univariate linear model
This model is defined by \(y = \beta_0 x + \beta_1\)
Examples
We can calculate orthogonal distance regression with an unilinear model:
>>> from scipy import odr >>> x = np.linspace(0.0, 5.0) >>> y = 1.0 * x + 2.0 >>> data = odr.Data(x, y) >>> odr_obj = odr.ODR(data, odr.unilinear) >>> output = odr_obj.run() >>> print(output.beta) [1. 2.]