# Parametric Estimation for Multivariate Linear Regression

$$x=\begin{bmatrix}x\_1\\.\\.\\.\x\_d\end{bmatrix}$$

We need to find the parameters $$W=\begin{bmatrix}w\_0\\.\\.\\.\w\_d\end{bmatrix}$$

so that the linear function $$g(x|w\_d,w\_{d-1},...,w\_1,w\_0) = w\_dx\_d + w\_{d-1}x\_{d-1}+...+w\_1x\_1+w\_0$$

minimizes the square error on the dataset $${x^t,r^t}\_{t=1}^N$$ where $$x^t=\begin{bmatrix}x\_1^t\x\_2^t\\.\\.\\.\x\_d^t\end{bmatrix}$$

Let $$D=\begin{bmatrix}1 & x\_1^1\&x\_2^1&...\&x\_d^1\1 & x\_1^2\&x\_2^2&...\&x\_d^2\\.&.&.&...&.\\.&.&.&...&.\\.&.&.&...&.\1 & x\_1^N\&x\_2^N&...\&x\_d^N\\\end{bmatrix}*{N \times (d+1)}$$ and $$r=\begin{bmatrix}r\_1\r\_2\\.\\.\\.\r\_N\end{bmatrix}*{N\times 1}$$

Then, $$W=(D^TD)^{-1}D^Tr$$

Sometimes, the inverse doesn't exist. This usually happens when the number of dimensions is too less.
