nispace.stats.misc.residuals

nispace.stats.misc.residuals(x, y, decenter=False)[source]

Compute residuals for Regression with dependent variable y and independent variable(s) x. Requires numpy arrays with columns as independent variables.

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