The normal equation of \(X\beta = y\) can be obtained using \({X^T}X\beta = {X^T}y\) which is equivalent to \(\beta = {\left( {{X^T}X} \right)^{ - 1}}{X^T}y\).
Find \({X^T}X\) as follows:
\(\begin{aligned}{X^T}X &= \left[ {\begin{aligned}1&1&1&1\\1&2&4&5\end{aligned}} \right]\left[ {\begin{aligned}1&1\\1&2\\1&4\\1&5\end{aligned}} \right]\\ &= \left[ {\begin{aligned}{1 + 1 + 1 + 1}&{1 + 2 + 4 + 5}\\{1 + 2 + 4 + 5}&{1 + 4 + 16 + 25}\end{aligned}} \right]\\ &= \left[ {\begin{aligned}4&{12}\\{12}&{46}\end{aligned}} \right]\end{aligned}\)
Find the inverse of \({X^T}X\) as follows:
\(\begin{aligned}{\left( {{X^T}X} \right)^{ - 1}} &= {\left[ {\begin{aligned}4&{12}\\{12}&{46}\end{aligned}} \right]^{ - 1}}\\ &= \frac{1}{{184 - 144}}\left[ {\begin{aligned}{46}&{ - 12}\\{ - 12}&4\end{aligned}} \right]\\ &= \frac{1}{{40}}\left[ {\begin{aligned}{46}&{ - 12}\\{ - 12}&4\end{aligned}} \right]\end{aligned}\)
Find \({X^T}y\) as follows:
\(\begin{aligned}{X^T}y &= \left[ {\begin{aligned}1&1&1&1\\1&2&4&5\end{aligned}} \right]\left[ {\begin{aligned}0\\1\\2\\3\end{aligned}} \right]\\ &= \left[ {\begin{aligned}{0 + 1 + 2 + 3}\\{0 + 2 + 8 + 15}\end{aligned}} \right]\\ &= \left[ {\begin{aligned}6\\{25}\end{aligned}} \right]\end{aligned}\)