function [bols] = ols1(y,X); % PURPOSE: simple OLS regression % INPUTS: % n by 1 vector y (dependent variable) % n by k matrix X (explanatory variables) % OUTPUT: k by 1 vector of regression coefficients % % % written by: A brilliant Math week student bols=inv(X'*X)*X'*y;