Closed noamteyssier closed 1 year ago
can implement this better using matrix operations instead of current mapping implementation:
$$ \mathbf{\beta} =( \mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^T \mathbf{y} $$
$$ \mathbf{\beta} =( \mathbf{X}^T \mathbf{W} \mathbf{X})^{-1} \mathbf{X}^T\mathbf{W}\mathbf{y} $$
can implement this better using matrix operations instead of current mapping implementation:
OLS
$$ \mathbf{\beta} =( \mathbf{X}^T \mathbf{X})^{-1} \mathbf{X}^T \mathbf{y} $$
Weighted OLS
$$ \mathbf{\beta} =( \mathbf{X}^T \mathbf{W} \mathbf{X})^{-1} \mathbf{X}^T\mathbf{W}\mathbf{y} $$