Using linear regression, find a quadratic function that is best-fit for the following points: $(1, 1), (1, 5), (-1, -2)$.
This might be a trivial question, but I'm new to this topic. I get stuck at the very first step: Building the matrix $A$. My textbook gives for the model $y = dt^2 + t$ the following $A, \hat{x}$, and $b$:
$A =\begin{bmatrix}1 & 1^2 \\2 & 2^2 \\ -1&-1^2 \end{bmatrix}$, $\hat{x} =\begin{bmatrix}c \\d \end{bmatrix}$, $b = \begin{bmatrix}1 \\5 \\ -2\end{bmatrix}.$
And then determines $\hat{x}$ by solving $A^TA\hat{x}= A^T b$ using the Cholesky decomposition (which I can do by myself).
But I don't understand this procedure. How did we calculate $A$ and $b$? Can you give me a brief explanation?
$$A \begin{bmatrix} c \\ d \end{bmatrix} = \begin{bmatrix} c \cdot 1 + d \cdot 1^2 \\ c \cdot 2 + d \cdot 2^2 \\ c (-1) + d(-1)^2 \end{bmatrix}$$ encodes the values of $ct + ct^2$ for the values of $t$ in your data. You want this to be close to the response values $\begin{bmatrix}1 \\ 5 \\ -2 \end{bmatrix}$.