> For the complete documentation index, see [llms.txt](https://vikram-bajaj.gitbook.io/cs-gy-6923-machine-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vikram-bajaj.gitbook.io/cs-gy-6923-machine-learning/types-of-machine-learning/supervised-learning/parametric-estimation/parametric-estimation-for-multivariate-linear-regression.md).

# 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.
