Last two on my assignment and I'm fully lost and no resource is helping
6. Find the least squares line fit of the form y = ax + b through the data
(-2,2), (1,0), (2,-4), (5,-6). What is the residual?
7. Find the least squares quadratic fit of the form y = ax^2 + bx + c through the data
(-3,1), (-2,2), (1,0), (2,-4), (4,-5), (5,-6). What is the residual?
#URGENT : Least squares line fit of the form
28 messages · Page 1 of 1 (latest)
- Ask your question and show the work you've done so far. If you've posted a screenshot of a question, specify which part you need help with.
- Wait patiently for a helper to come along.
- Once someone helps you, say thank you and close the thread with:
+close - Feel free to nominate the person for helper of the week in #helper-nominations
- Do not ping the mods, unless someone is breaking the rules.
- If you're happy with the help you got here, and the server overall, you can contribute financially as well:
URGENT : Least squares line fit of the form
Nothing I've done so far is working and Im runninginto issues and a lotta scratch out pages
Plugging in all the data points gives a system of (linear) equations in the coefficients. You should know from class how to determine the least squares solution(s) to said system, which gives your fit.
The residuals are then just, if $f(x)$ is your fit, $y_i-f(x_i)$ for each data point $(x_i,y_i)$
Omegabet_
I have to actively show all the matrices and I keep getting 3 dif answers
I think I got 6 thoguh
You get Ax=b as your system, then the normal equations are obtained by left multiplication by the adjoint, which here is just the transpose
Like for 5 you get the normal equations as [34,6],[6,4]=(-42,-8)
Which has a unique solution since the matrix is invertible
@unborn mulch

probably
should I open a new channel for new questions or keep it here?
you can keep it here, but I'm unable to help further as of rn
That’s ok! I’ll make a new one then!
Plugging in the data gives the system $\begin{bmatrix}2&1\1&1\2&1\5&1\end{bmatrix}\begin{bmatrix}a\b\end{bmatrix}=\begin{bmatrix}2\0\4\-6\end{bmatrix}$
Omegabet_
to which as said, you left multiply by the transpose of the coefficient matrix then solve the resulting system
gotcha
+close