The best-fit line
The best-fit line minimises the sum of squared distances to the data points.
Rules
- m = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)²
- b = ȳ − m · x̄
- Passes through (x̄ | ȳ)
Your turn
Three problems on this topic.
- 1 · Best-fit line
- 2
- 3
Find the slope and intercept of the best-fit line (least squares).
| x | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| y | 2 | 3.8 | 5.9 | 8 | 10.2 |
Slope
Intercept
Round results to the given precision, negative with a minus.
Worked example
Find the slope and intercept of the best-fit line (least squares).
| x | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| y | 4.5 | 8 | 11.4 | 15 | 18.4 |
Worked solution
- 1x̄ = 3, ȳ = 11.46
- 2m = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² = 3.48
- 3b = ȳ − m · x̄ = 1.02
Typical mistake: The best-fit line always passes through the centroid (x̄ | ȳ).
Common questions
What is it for in the lab?
To find a physical quantity from the slope.
