beta = (X'X)^-1 X'y solved by QR; a rank-deficient design is refused.
Standard errors use sigma^2 = RSS / (n - p) (eq 3.8).
Usage
morie_esl_ols_normal_equations(X, y)
Arguments
- X
Design matrix including any intercept column, n > p.
- y
Response.
Value
Named list: estimate, beta, se, sigma2, rss, df_residual, n, p.
References
Hastie, T., Tibshirani, R. & Friedman, J. (2009). The
Elements of Statistical Learning (2nd ed.), sec. 3.2.
Examples
morie_esl_ols_normal_equations(cbind(1, 0:3), c(1, 3, 5, 7))$beta
#> [1] 1 2