Linear regression (OLS) assumes
y=Xw+ε and minimizes the residual sum of squares
L(w)=∥y−Xw∥22. Differentiating gives
∂w∂L=2XT(Xw−y); setting it to zero yields the normal equation
XTXw=XTy, with closed-form solution
w=(XTX)−1XTy when
X has full column rank — complexity about
O(nd2+d3), so gradient descent (
O(nd) per step) wins in high dimensions. The 5 Gauss-Markov assumptions: (1) linearity in parameters, (2) zero conditional mean
E[ε∣X]=0 (exogeneity), (3) homoscedasticity
Var(ε)=σ2I, (4) independent errors, (5) no perfect multicollinearity (
rank(X)=d); normally distributed errors additionally validate small-sample t/F inference.