The line of best fit. Need help?

  • Thread starter Thread starter sutupidmath
  • Start date Start date
  • Tags Tags
    Fit Line
sutupidmath
Messages
1,629
Reaction score
4
Well, i am taking a first course in elementary statistics, so we do not actually prove anything at all. So i was wonderign how does one determine the line of best fit?
y=mx+b, where m is the slope of the line of best fit,
I know that the slope is equal to

m=SS(xy)/SS(x), where SS(x) is the sum of square of x, while SS(xy) the sum of the squares of x,y. also

b=[SUM(y)-m*SUM(x)]/n but i have no idea how one would come up with these expressions.
Can somebody show a proof for this, or just point me to the right direction?
 
Physics news on Phys.org
The proof reqires a knowledge of elementary calculus. Basic idea is to assume a straight line fit with m and b unknown. Set up the expression for the sum of the squares of the distances of the points from the line. Find m and b which minimize the expression.
 
Let μ and β be the least squares estimators of m and b in y = mx + b.

The estimated equation is then y[t] = β + μ x[t] + u[t] where u is the residual error and t indexes "data row" (e.g., observation).

u[t] = y[t] - (β + μ x[t])

u[t]^2 = (y[t] - (β + μ x[t]))^2

Sum over t:
Σt u[t]^2 = Σt (y[t] - (β + μ x[t]))^2

Now minimize with respect to μ and β by differentiating Σt u[t]^2 with respect to μ and β separately, setting each derivative to zero, then solving for μ and β that satisfy these two equations simultaneously:

∂Σt u[t]^2/∂μ = ∂Σt u[t]^2/∂β = 0.
 
Last edited:
EnumaElish said:
Let μ and β be the least squares estimators of m and b in y = mx + b.

The estimated equation is then y[t] = β + μ x[t] + u[t] where u is the residual error and t indexes "data row" (e.g., observation).

u[t] = y[t] - (β + μ x[t])

u[t]^2 = (y[t] - (β + μ x[t]))^2

Sum over t:
Σt u[t]^2 = Σt (y[t] - (β + μ x[t]))^2

Now minimize with respect to μ and β by differentiating Σt u[t]^2 with respect to μ and β separately, setting each derivative to zero, then solving for μ and β that satisfy these two equations simultaneously:

∂Σt u[t]^2/∂μ = ∂Σt u[t]^2/∂β = 0.

Thankyou for your replies! I totally forgot to let you know that i had managed to get to the result i wanted, my approach was almost identical with what u did, with the exception of notation, but i got to the result!

thnx both of you!
 
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Thread 'Detail of Diagonalization Lemma'
The following is more or less taken from page 6 of C. Smorynski's "Self-Reference and Modal Logic". (Springer, 1985) (I couldn't get raised brackets to indicate codification (Gödel numbering), so I use a box. The overline is assigning a name. The detail I would like clarification on is in the second step in the last line, where we have an m-overlined, and we substitute the expression for m. Are we saying that the name of a coded term is the same as the coded term? Thanks in advance.

Similar threads

Replies
3
Views
2K
Replies
1
Views
2K
Replies
16
Views
3K
Replies
30
Views
4K
Replies
8
Views
7K
Replies
5
Views
2K
Replies
1
Views
1K
Back
Top