wls#

swordfish.function.wls()#

Return the result of an weighted-least-squares regression of Y on X.

Parameters:
  • Y (Constant) – A dependent variable.

  • X (Constant) –

    An independent variable.

    Y is a vector. X can be a matrix, table or tuple. When X is a matrix, if the number of rows is equal to the length of Y, each column of X is a factor. If the number of rows is not equal to the length of Y, but the number of columns is equal to the length of Y, each row of X is a factor.

  • W (Constant) – A vector indicating the weight in which each element is a non-negative.

  • intercept (Constant, optional) – A Boolean variable that indicates whether to include the intercept in regression, by default DFLT.

  • mode (Constant, optional) –

    An integer, by default DFLT. It can be:

    • 0: a vector of the coefficient estimates

    • 1: a table with coefficient estimates, standard error, t-statistics, and p-value

    • 2: a dictionary with all statistics