Updated · By Pete Bromfield, former Head of Maths with IB examining experience

IA modelling, step by step · comparing models

Choosing and comparing models: residuals, R², SSR and testing

AA SLAA HLAI SLAI HL

A good modelling IA does not just fit a curve — it argues for one. This page fits four models to the same data, compares them in four different ways, and shows the one that fits best is not always the one to choose.

Example data, invented for this guide. The context is realistic, but the numbers were made up to show the method. Use your own measured or sourced data in your IA.

The data and four candidates

A student learning to touch-type records their speed on a 1-minute test at the end of chosen practice days. From the shape (rising, bending over) and the context (skill improves quickly, then more slowly), four candidates are reasonable: a line as the baseline, a quadratic, a logarithmic model and a power model.

Example data: typing speed and days of practice
ix: Day of practicey: Typing speed (words per minute)
1118
2225
3327
4533
5735
61039
71441
82045
92848
Four models fitted to the same example data
Four candidate models fitted to all nine points.

1. How well does each fit? SSR, R² and RMSE

Models fitted to all the data
ModelParametersSSRR²RMSE
Logarithmic22.4400.99690.521
Power217.760.97711.40
Quadratic regression335.960.95372.00
Straight line (least squares)2130.00.83253.80

On these numbers alone the logarithmic fits best (lowest SSR), with the power close behind. But the table is only the start.

Why R² can mislead

  • R² can only go up when you add parameters: a quadratic always has at least the R² of a line, a cubic at least that of a quadratic. Compare models with the same number of parameters, or account for the extra ones.
  • For models fitted after a transformation (ln y, ln x and ln y), a calculator's r or R² describes the straight line in the transformed units, not the fit to your original data. Compute SSR in the original units (as in the table above) to compare fairly.
  • For non-linear models, R² = 1 − SSR/SST is still a useful summary, but it no longer equals the square of a correlation coefficient and it can mislead for curves that do not include a constant term. Treat it as one piece of evidence.
  • A high R² does not show the shape is right. The line above has R² = 0.8325 — high-looking — yet its residuals show a clear pattern.

2. Look at the residual plots

A model has captured the shape when its residuals look like random scatter about zero. A curve, a trend or a funnel shape in the residuals is information the model has missed.

Residual plot for the logarithmic model fitted to the example data
Logarithmic: residuals scattered about 0 with no clear pattern.
Residual plot for the power model fitted to the example data
Power: a remaining pattern: the fit is good but not the best.
Residual plot for the quadratic regression model fitted to the example data
Quadratic regression: smaller residuals, but the curve turns down at the end — check the context.
Residual plot for the straight line (least squares) model fitted to the example data
Straight line (least squares): a clear curve (negative, positive, negative): the model misses the bend.

In the full worked example

  • 3. Test on points you did not use: fit on seven points, predict the other two
  • 4. Extrapolation and the domain
  • 5. Choose, and justify the choice
  • What SL and HL examiners expect
  • Is your comparison good enough? The checklist

Chosen a model? Next, evaluate it and check accuracy and rounding. The free Grapher's Compare models runs the same test on points you did not use, with your own data.

How this earns marks

Every step of a model maps onto the assessment criteria. What examiners look for, criterion by criterion:

  • A Criterion A (Presentation): Put the data, the graph, the model, the checks and the comparison in the order you discuss them; caption every graph and table; move long tables to an appendix.
  • B Criterion B (Mathematical communication): Define every variable with units and domain, write models in proper notation (x², not x^2; ≈ for rounded values), and label every graph's axes with units.
  • C Criterion C (Personal engagement): Choose the model from your own context and say why before fitting it; make and explain your own decisions (which points, which asymptote, which period).
  • D Criterion D (Reflection): Interpret the parameters in context, read the residual plot, compare models, test predictions on data you did not use, and state the domain and limitations.
  • E Criterion E (Use of mathematics): Fit correctly and show one fit in full; explain what technology did; use residuals, SSR and R² with understanding (R² can mislead for non-linear and transformed fits). At HL, more sophistication and rigour — for example deriving least squares or refining a model with calculus.

The criterion names are the current IB criteria (exams up to 2028); the advice is our summary, not the IB's wording. The most common mark-losing mistakes in modelling IAs, by criterion: see the list.

Get feedback on your write-up Self-check your draft

Works with Desmos, GeoGebra and spreadsheets

Already have your data in Desmos, GeoGebra, Google Sheets or Excel? Paste it straight into Model my data for the step-by-step method with your numbers, then send the model back.

  1. Step 1: select the x and y cells of a table in your graphing calculator and copy them
  2. Step 2: paste into the model-my-data helper, which reports how many points it found
  3. Step 3: copy the regression and the data back and paste them into an empty expression line

Copy the table cells (or the lists x_1=[…] and y_1=[…]) → paste into the helper → copy the data, the Desmos regression, a GeoGebra command or a CSV back. Nothing is uploaded: it goes through your clipboard. Desmos is a trademark of Desmos Studio PBC and GeoGebra a trademark of GeoGebra GmbH; IB Math Revision is not affiliated with or endorsed by either.

Frequently asked questions

Should I choose the model with the highest R²?

Not automatically. R² rises with extra parameters and can mislead for transformed or non-linear fits. Use it together with residual plots, SSR in the original units, the number of parameters, the context and a test on data you did not fit.

What is a residual plot?

A graph of the residuals (data minus model) against x. If the model has captured the shape, the points scatter randomly about zero; a curve or trend means it has missed something.

How do I test a model on data I did not use?

Hold back one or two points (or collect extra ones), fit the model to the rest, and compare its predictions with the held-back values. Report the errors, for example as a sum of squared errors.

Next steps

Related models: Straight line y = mx + c · Logarithmic y = a ln x + b. Or model your own data, and see what the IA package adds.

Free: the IA checklist, criterion by criterion

Every check for Criteria A–E in a 4-page PDF, the mistakes that cost the most marks and a self-assessment grid. We'll email it to you, and for three weeks your weekly email carries one IA tip, timed to your deadline if you give it. Free — no account, no payment.