Fits a linear regression model to a single variant.
Fits a linear regression model to a single variant.
The algorithm here is based off the linear regression algorithm used in Hail, as described in https://arxiv.org/pdf/1901.09531.pdf.
At a high level, we compute the QR decomposition once per covariate matrix, and use Q to project the genotypes into the orthogonal complement of the column space of the covariate matrix. Then we use a simple algorithm for linear regression with one independent variable to solve for relevant output (https://en.wikipedia.org/wiki/Simple_linear_regression#Numerical_example).