I have an assignment that I am needing help with. Here is the problem, I have to compute the least squares best straight line fit to the points and plot both of them.
Here is the formulas we were given to work with:
dist=ABS(m8x0+b-y0)/SQR(m*m+1)
To fit the data points to a straight line we are supossed to use this:
For i = 1 to n
sx=sx+x(1)
sy=sy+x(1)
sx2=sx2+x(i)^2
sxy-sxy+x(i)*y(i)
Next
We were also given the coefficients to the m and b. can anyone please, please help or point me in a direction? Thanks
Here is the formulas we were given to work with:
dist=ABS(m8x0+b-y0)/SQR(m*m+1)
To fit the data points to a straight line we are supossed to use this:
For i = 1 to n
sx=sx+x(1)
sy=sy+x(1)
sx2=sx2+x(i)^2
sxy-sxy+x(i)*y(i)
Next
We were also given the coefficients to the m and b. can anyone please, please help or point me in a direction? Thanks