How can I solve this Least Squares Regression problem?

AI Thread Summary
The discussion centers on solving a Least Squares Regression problem, where participants are trying to establish the correct system of equations based on given data points. There is confusion regarding the subscripts used in the equations and the correct formulation of the system, particularly with the terms involving sums of cubes. One user realizes a mistake in their calculations related to the sum of x-cubes and corrects their approach. Another user seeks guidance on solving a different system of equations, expressing uncertainty in eliminating variables and receiving advice on using Gauss elimination. The conversation highlights the importance of careful formulation and systematic solving in regression analysis.
themadhatter1
Messages
139
Reaction score
0

Homework Statement



[PLAIN]http://img683.imageshack.us/img683/4744/leastsquares.jpg
[PLAIN]http://img149.imageshack.us/img149/4793/graphwd.jpg

Homework Equations





The Attempt at a Solution



So would these be the points?
(-41,51),(-22,62),(23,63),(44,24)

I'm not too sure how to evaluate the sigmas because it shows n as being the subscript up above in the directions but in the problem it shows i as being the subscript, and I don't understand how i can equal 1. When clearly the subscript is not always 1.
 
Last edited by a moderator:
Physics news on Phys.org
Your xi's are x1=-4, x2=-2, x3= 2, x4= 4 and your yi's are the corresponding y values. i goes from 1 to 4.
 
So I would have...

nc+0b+40a=19
0c+40b+144a=-12
40c+144b+544a=160

Is this correct for the system of equations? What would n be?
 
Last edited:
themadhatter1 said:
So I would have...

nc+0b+40a=19
0c+40b+144a=-12
40c+144a+544b=160

Is this correct for the system of equations? What would n be?

They look correct. n is the number of points.
 
The system of equations I have created is wrong. I started to solve the system of equations

4c+0b+40a=19
0c+40b+144a=-12
40c+144b+544a=160

I used linear combinations to start to solve it and I got -9\52 for b. The equation for the regression is suppose to be
y=(-5/14)x2-(3/10)x+(41/6) and since the b I got doesn't match up with the b in the answer if I solved for a and c those values would also be wrong. I know I'm solving the system correctly because I checked my solution with a matrix on my calculator and my solution matches the one calculated using matrices.

What's wrong with my system of equations?
 
Last edited:
I got the same result as you. Try to plug in the x values into the equation given as solution. You will see, they do not match to the given curve. Try the same with your parameters.

ehild
 
Check your term for "sum-of-x-cubes" again. Since the ordinates x_i are equally disposed about zero, this term should be zero as well. I have not check any other values.
 
TheoMcCloskey said:
Check your term for "sum-of-x-cubes" again. Since the ordinates x_i are equally disposed about zero, this term should be zero as well. I have not check any other values.

Oops... That is right.

ehild
 
ohhh... ok, thanks. haha that was a stupid mistake.

4c+0b+40a=19
0c+40b+0a=-12
40c+0b+544a=160
 
  • #10
I'm stuck on another one of these problems. This time I have the system of equations and I know It's right, but I'm not sure how I can solve it.

4c+9b+29a=20
9c+29b+99a=70
29c+99b+353a=254

I know that the solution is a=1 b=-1 c=0 but I'm not sure how to solve the equation to get those variables.

I'm trying to get it into row echelon form. The only thing that I can do to eliminate a vairable is subtract the third equation from 11 times the first equation. That yields:

-11c+0b+63a=254
9c+29b+99a=70
29c+99b+353a=254

I don't see how I can eliminate any other variables.
 
  • #11
You should do Gauss elimination systematically, but before it, try to make the equations a bit more "friendly". At start, subtract 2 times the first equation from the second, and 3 times the second equation from the third.

ehild
 
Back
Top