Fast OLS for a single cross-sectional unit. Uses normal equations
rather than lm() for speed when called in a loop.
.unit_ols(y, X)A list with elements:
Coefficient vector.
Variance-covariance matrix of coefficients.
Residual vector.
R-squared.
Residual degrees of freedom.
Residual variance (s^2).
Numeric vector: dependent variable.
Numeric matrix: regressors (including intercept if desired).