Skip to content
IGCSE·Tuition
Mathematics · Lesson

Fit a simple model to supplied data

A table of numbers sits in front of you, and you are asked for a rule that describes it.

On this page
  1. How do you fit a line by hand?
  2. Worked example
  3. The mistake to watch for
  4. Check yourself
  5. Where this leads next

To fit a simple model to data, you choose a rule, usually a straight line y = mx + c, and set its numbers so that the line passes close to the supplied points. You then test the rule against every point, not only the ones you used to build it.

This lesson follows defining variables and assumptions in International Mathematics modelling. Once you can fit a model, you can start reading what its numbers mean.

How do you fit a line by hand?

  1. Check the pattern. For equal steps in x, see whether y changes by about the same amount each time. If it does, a straight line is reasonable.
  2. Pick two points that are far apart and work out the gradient: change in y divided by change in x.
  3. Find the intercept. Substitute one point into y = mx + c and solve for c.
  4. Write the model with variable names and units.
  5. Test it on all the other points and record the gaps.

The gaps tell you how good the model is. If they are small and scattered on both sides of zero, the line is a fair description.

Worked example

A student measures a plant’s height h (cm) each week w. The readings are:

w (weeks)12345
h (cm)3.14.97.28.811.1

Fit a straight-line model and test it.

Step 1, pattern: the heights rise by 1.8, 2.3, 1.6 and 2.3. They are not identical, but they stay close to 2, so a line is reasonable.

Step 2, gradient using the first and last points: (11.1 − 3.1) ÷ (5 − 1) = 8.0 ÷ 4 = 2.0.

Step 3, intercept: h = 2w + c. Using (1, 3.1), 3.1 = 2 + c, so c = 1.1.

Step 4, model: h = 2w + 1.1, with h in cm and w in weeks.

Step 5, test on the middle points:

wModel hObserved hGap (observed − model)
25.14.9−0.2
37.17.2+0.1
49.18.8−0.3

The gaps are small and fall on both sides of zero, so the line describes the data well. Check: at w = 5 the model gives 2 × 5 + 1.1 = 11.1, which matches the last reading exactly.

The mistake to watch for

A common slip is to build the line from the first two points only and stop there.

Mistaken model: using (1, 3.1) and (2, 4.9), the gradient is 1.8, and c = 3.1 − 1.8 = 1.3, so h = 1.8w + 1.3.

At w = 5 this predicts 1.8 × 5 + 1.3 = 10.3, but the student measured 11.1.

Two neighbouring points sit close together, so a small measuring error changes the gradient a lot. One test at the end would have exposed it. The correction is to choose points that are far apart and then test the model against all the other readings before trusting it.

Check yourself

Try these without a calculator, then open each answer.

1. The data are (0, 50), (2, 42) and (5, 30). Find a linear model y = mx + c and check it against the point you did not use.

Show answer

Using (0, 50) and (5, 30): gradient = (30 − 50) ÷ 5 = −4, and c = 50. Model: y = 50 − 4x.

Test with x = 2: 50 − 8 = 42, which matches the data.

2. A line passes through (1, 7) and (4, 19). Find its equation and check it with both points.

Show answer

Gradient = (19 − 7) ÷ (4 − 1) = 12 ÷ 3 = 4. Then 7 = 4 × 1 + c, so c = 3. Model: y = 4x + 3.

Check: x = 1 gives 7, and x = 4 gives 16 + 3 = 19. Both match.

3. Data: (1, 2), (2, 5), (3, 10). Is a straight line a good model? Give a reason.

Show answer

No. The rises are 3 and then 5, so the gradient is not constant. The data are curved. In fact y = x² + 1 fits all three points: 1 + 1 = 2, 4 + 1 = 5 and 9 + 1 = 10.

Where this leads next

Once you have a fitted line, the next skill is saying what its numbers mean in context: interpret parameters with units. Mixed questions are in the modelling practice set, and the non-calculator working trainer can check your gradient arithmetic.

Some students fit the line correctly but skip the testing step that earns the final mark. That pattern is what our teachers work on in online one-to-one Mathematics tuition.

Questions people ask

Which two points should I use to build a straight-line model?

Use two points that are well apart, such as the first and the last in the table. Points that sit close together make the slope sensitive to small measurement errors. After building the line, always test it against the points you did not use, because that shows whether a line suits the data at all.

What if the data do not lie exactly on a line?

Real measurements rarely do. A line can still be a good model if the differences between the line and the data are small and have no pattern. Tell the reader that the model is an approximation and give the size of the gaps, rather than pretending the fit is exact.

How can I tell that a straight line is the wrong model?

Check the changes in y for equal steps in x. If they stay the same, a line suits the data. If they keep growing or shrinking, the data are curved, and a different model is needed, such as a quadratic or an exponential one.

Updated:

Your next step

If your line fits the first two points but drifts from the rest, a one-to-one teacher can watch how you choose points and show you a cleaner way to decide.

Paid one-hour trial at your assigned teacher’s confirmed rate, starting from RM80.

Tuition is arranged with a parent or guardian. Send them this page on WhatsApp and they can enquire for you.

Parents: enquire here

  • 9,000+ students helped through our service
  • 9+ years helping IGCSE students