inmoose.utils.lm_fit
- class inmoose.utils.lm_fit(design, b)
Python equivalent to R
lm.fitThis class is merely a wrapper around
RegressionResults, the return type ofOLS.fit()andWLS.fit().It contains the solution to the equation \(A X = B\), where \(A\) is a known matrix, \(B\) a known vector and \(X\) the unknown to solve for. The solution is obtained by a least-square-error fit based on the QR-decomposition of \(A\).
- Parameters:
design (array_like) – matrix \(A\) of the equation
b (array_like) – offset (vector \(B\) in the equation)
- __init__(design, b)
Methods
__init__(design, b)Attributes
coefficientsthe value found for \(X\)
df_residualsdegrees of freedom of residuals
effectsvector of orthogonal single-df effects.
fitted_valuesthe value \(A X\)
qrthe QR decomposition of matrix \(A\)
rankthe column rank of matrix \(A\)
residualsthe residuals, i.e. the difference between \(A X\) and \(B\)
weightsthe weights used in the least-square-error fit