Try the fastest way to create flashcards
Question

# For each of the sets of data that follows, use the least squares approximation to find the best fits with both (i) a linear function and (ii) a quadratic function. Compute the error $E$ in both cases. $\\$ (a)$\{(-3,9),(-2,6),(0,2),(1,1)\}$(b)$\{(1,2),(3,4),(5,7),(7,9),(9,12)\}$(c)$\{(-2,4),(-1,3),(0,1),(1,-1),(2,-3)\}$

Solution

Verified
Step 1
1 of 7

#### i)

First, we need to find the matrix of the system and the right-hand side.

$A=\begin{bmatrix} -3 & 1 \\ -2 & 1 \\ 0 & 1 \\ 1 & 1 \end{bmatrix} \quad y=\begin{bmatrix} 9 \\ 6 \\ 2 \\ 1 \end{bmatrix}$

Now, we find the solution to the system

\begin{align*} A^*Ax&=A^*y \\ \begin{bmatrix} 14 & -4 \\ -4 & 4 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} &=\begin{bmatrix} -38 \\ 18 \end{bmatrix} \end{align*}

$\boldsymbol{\Rightarrow x=\begin{bmatrix} -2 \\ 2.5 \end{bmatrix}}$

Which means that the linear approximation of this data is given with

$\textcolor{#c34632}{y=-2t+2.5}$

and the error is computed as

$\textcolor{#c34632}{||Ax-y||^2=1}$

## Recommended textbook solutions

#### Linear Algebra

4th EditionISBN: 9780130084514 (1 more)Arnold J. Insel, Lawrence E. Spence, Stephen H. Friedberg
863 solutions

#### Linear Algebra and Its Applications

5th EditionISBN: 9780321982384 (3 more)David C. Lay, Judi J. McDonald, Steven R. Lay
2,070 solutions

#### Elementary Linear Algebra

11th EditionISBN: 9781118473504Howard Anton
2,932 solutions

#### Elementary Linear Algebra

12th EditionISBN: 9781119406778Anton Kaul, Howard Anton
3,078 solutions