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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET 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?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
