residual#

swordfish.function.residual()#

Return the residuals from the least squares regression of Y on X.

Note

  • For an in-memory table, the residuals can be obtained setting mode=2 in function ols or wls;

  • For a DFS table, the residuals can only be obtained with function residual.

Parameters:
  • Y (Constant) – The dependent variable. It is a vector.

  • X (Constant) – The independent variable(s). X can be a matrix, table or tuple. When X is a matrix, if the number of rows is the same as the length of Y, each column of X is a factor; If the number of columns equals the length of Y, each row of X is a factor.

  • params (Constant) – The regression estimator.

  • intercept (Constant, optional) – T Boolean variable indicating whether to include an intercept in the regression. The default value is true, meaning that the system automatically adds a column of “1” to X to generate the intercept.