The line of best fit. Need help?

  • Context: Undergrad 
  • Thread starter Thread starter sutupidmath
  • Start date Start date
  • Tags Tags
    Fit Line
Click For Summary

Discussion Overview

The discussion revolves around the concept of determining the line of best fit in the context of elementary statistics. Participants explore the mathematical expressions involved in calculating the slope and intercept of the line, as well as the underlying principles of least squares estimation.

Discussion Character

  • Exploratory, Technical explanation, Mathematical reasoning

Main Points Raised

  • One participant seeks clarification on how to derive the expressions for the line of best fit, specifically the formulas for slope (m) and intercept (b).
  • Another participant suggests that the proof requires knowledge of elementary calculus and outlines a basic approach involving minimizing the sum of the squares of the distances from the points to the line.
  • A detailed mathematical formulation is provided by a participant, explaining the least squares estimators for m and b, including the residual error and the process of minimizing the sum of squared residuals.
  • One participant acknowledges that they reached the desired result using a similar approach to the one described, noting a difference in notation but confirming their success in deriving the line of best fit.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the derivation process, as the discussion includes various approaches and levels of understanding regarding the mathematical foundations of the line of best fit.

Contextual Notes

The discussion assumes familiarity with basic statistical concepts and calculus, but does not resolve the specific derivation steps or clarify all assumptions involved in the least squares method.

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!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 28 ·
Replies
28
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
5K
  • · Replies 8 ·
Replies
8
Views
7K