nispace.stats.misc.residuals
- nispace.stats.misc.residuals(x, y, decenter=False)[source]
OLS residuals of
yonx(plus intercept).Numba-compiled; requires plain
np.ndarrayinputs (no pandas) and does not handle NaN — any NaN inx/ypropagates silently throughnp.linalg.pinv. Dead code on the live pipeline: nothing in NiSpace actually calls this function — every real caller uses the NaN-tolerantresiduals_nan()instead.- Parameters:
x (numpy.ndarray) – shape (n_values, n_predictors)
y (numpy.ndarray) – shape (n_values, 1) or (n_values,)
decenter (bool, optional) – add mean of y to residuals before return
- Returns:
1D array of residuals w or w/o added mean of y
- Return type:
numpy.ndarray