sushie.utils.ols(X: Array | ndarray | bool | number | bool | int | float | complex, y: Array | ndarray | bool | number | bool | int | float | complex) Tuple[Array, Array, Array][source]

Perform ordinary linear regression using QR Factorization.

Parameters:
X: Array | ndarray | bool | number | bool | int | float | complex

\(n \times p\) matrix for independent variables with no intercept vector.

y: Array | ndarray | bool | number | bool | int | float | complex

\(n \times m\) matrix for dependent variables. If \(m > 1\), then perform \(m\) ordinary regression in parallel.

Returns:

A tuple of
  1. contains residuals (Array),

  2. adjusted \(r^2\) (Array) for of the regression,

  3. \(p\) values (Array) for the coefficients.

Return type:

Tuple[Array, Array, Array]


Last update: Oct 27, 2024