Skip to content

Instantly share code, notes, and snippets.

@Scriddie
Last active July 24, 2019 11:34
Show Gist options
  • Save Scriddie/4b4d7ee7ac45d7878bad04c97449312a to your computer and use it in GitHub Desktop.
Save Scriddie/4b4d7ee7ac45d7878bad04c97449312a to your computer and use it in GitHub Desktop.
lin_reg_result
# Find coefficients as XtX_inverse * XtY
select round(sum(XtX_inverse.value * XtY.value), 4) coefficients
from XtX_inverse
join XtY
on XtX_inverse.row_num = XtY.row_num
group by XtX_inverse.col_num, XtY.col_num;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment