mathematical.linear_regression
Functions for performing linear regression.
Data:
Type hint for arguments that take either a sequence of floats or a numpy array. |
Functions:
|
Calculate coefficients of a linear regression y = a * x + b. |
|
Calculate coefficients of a linear regression y = a * x + b. |
-
ArrayLike_Float
Type hint for arguments that take either a sequence of floats or a numpy array.
-
linear_regression_perpendicular
(x, y=None)[source] Calculate coefficients of a linear regression y = a * x + b. The fit minimizes perpendicular distances between the points and the line.
- Parameters
If y is omitted, x must be a 2-D array of shape (N, 2).
-
linear_regression_vertical
(x, y=None, a=None, b=None)[source] Calculate coefficients of a linear regression y = a * x + b. The fit minimizes vertical distances between the points and the line.
- Parameters
If y is omitted, x must be a 2-D array of shape (N, 2).