CleverSphere

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. 1 · Best-fit line
  2. 2
  3. 3

Find the slope and intercept of the best-fit line (least squares).

x12345
y23.85.9810.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).

x12345
y4.5811.41518.4

Worked solution

  1. 1x̄ = 3, ȳ = 11.46
  2. 2m = Σ(x − x̄)(y − ȳ) / Σ(x − x̄)² = 3.48
  3. 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.

Related

More topics