We define the following vectors and matrices:
Y = [ y_{1} ], X = [ 1 x_{11} ... x_{K1} ], & β = [ b_{0} ].
[ ... ] [ ... ... ... ] [ b_{1} ]
[ y_{n} ] [ 1 x_{1n} ... x_{Kn} ] [ ... ]
[ b_{K} ]
X contains all realisations of the K+1 regressors. Each row i∈[1,n] of X gives the values of all regressors for observation i. Each column k∈[2,K+1] of X gives all the realisations of the variable X_{k-1} across all observations.
We have that: SSR(β) = (Y - Xβ)'(Y - Xβ), The OLS estimate of β is the value β̂ minimising SSR(β). The first order condition reads:
X'(Y - Xβ) = 0 ⇔ X'Y = X'Xβ̂
Then if the matrix X'X is invertible (meaning X has full rank), we have the closed-form expression of the OLS estimator.
β̂ = (X'X)^{-1}X'Y.