☰ IB Maths AI HL · course menu
Topics
IB Maths AI HL · free cheatsheet
Non-Linear Modelling & Regression cheatsheet (IB Maths AI HL)
Choosing a model, fitting it by least-squares regression on the GDC, judging the fit with r, R² and residuals, then predicting with confidence — plus exponential & power models and log–log linearisation — for IB Mathematics Applications & Interpretation HL. Written by an IB-certified teacher.
What this cheatsheet covers
Modelling is the beating heart of IB Mathematics Applications & Interpretation HL. You are handed a table of real bivariate data — populations, temperatures, prices, decay counts — and asked to choose a curve that captures the pattern, fit it by least-squares regression on the GDC, and then use it to predict. A calculator is always allowed, so no marks are for grinding the fit by hand; every mark lives in picking the right model family (linear, quadratic, cubic, exponential or power), judging the fit with $R^2$ and residuals, and reading the prediction back in context — including knowing when a prediction is trustworthy and when it is a guess.
This cheatsheet condenses SL 2.5–2.6 and AHL 2.9–2.10 onto one page — the model menu, least-squares regression, the correlation coefficient $r$ and coefficient of determination $R^2$, residuals, exponential and power models, log–log and semi-log linearisation, and the all-important interpolation-versus-extrapolation judgement — and flags the traps that quietly cost marks ($k\cdot a\cdot x$ instead of $k\,a^{x}$, forgetting to raise before multiplying, mistaking a log-axis intercept for $k$).
Fit a curve, then predict
SL 2.6Least squares:the fit minimises $\displaystyle\sum (y_i-\hat y_i)^2$ — the total squared gap between data and modelExponential model:$y=k\,a^{x}$ — constant percentage growth or decayPower model:$y=a\,x^{b}$ — many physical and allometric lawsFit quality:$R^2$ close to $1$ means the model explains most of the variation
Non-linear modelling fits a curve — not just a straight line — to bivariate data, then uses it to predict. A regression routine chooses the parameters by least squares, making the total squared residual as small as possible, while $R^2$ reports how much of the data's variation the model explains.
The model menu: which curve fits?
SL 2.5
Match the shape of the scatter to a model family, then let the GDC fit it.
| Model | Form | Shape & typical use |
|---|---|---|
| Linear | $y=mx+c$ | Constant rate of change; a straight-line trend |
| Quadratic | $y=ax^2+bx+c$ | One turning point (max or min); profit, projectile height |
| Cubic | $y=ax^3+bx^2+cx+d$ | Up to two turns; an S-shaped rise |
| Exponential | $y=k\,a^{x}$ | Constant % growth/decay; multiplies by $a$ each step |
| Power | $y=a\,x^{b}$ | Allometric/physical laws; through the origin for $b>0$ |
| Sinusoidal | $y=d+a\sin\!\big(\tfrac{2\pi}{T}(x-c)\big)$ | Periodic data (tides, temperature); amplitude $a=\tfrac{\max-\min}{2}$, midline $d=\tfrac{\max+\min}{2}$ — set the GDC to radians |
Fitting a line: least-squares regression
SL 2.6Gradient:$b=\dfrac{n\sum xy-\sum x\sum y}{n\sum x^2-(\sum x)^2}$Intercept:$a=\bar y-b\bar x$Predict:substitute the required $x$ into $\;y=a+bx\;$ to get $\hat y$
For a linear model the regression line of $y$ on $x$ comes straight from the summary sums.
Correlation $r$ and the coefficient of determination $R^2$
SL 2.6Correlation:$-1\le r\le 1$ — the sign gives the direction, the size gives the strengthDetermination:$R^2=r^2$ — the proportion of the variation in $y$ explained by the modelReading it:$R^2=0.96 \Rightarrow$ the model explains $96\%$ of the variation in $y$
Two numbers report how strongly a model fits: Pearson's correlation coefficient $r$ and the coefficient of determination $R^2$.
Residuals: the real test of fit
SL 2.6Residual:$\text{residual}=y-\hat y$ — observed minus predicted (from the fitted model)Total misfit:$\text{SS}_{\text{res}}=\displaystyle\sum (y-\hat y)^2$Best fit:the model with the smaller $\text{SS}_{\text{res}}$ (equivalently the larger $R^2$) fits better
A residual measures the error at a single point; adding the squared residuals measures the total misfit and lets you compare rival models.
Exponential & power models
SL 2.5
The two AI staples reward care when you evaluate them.
Predict with care: interpolation vs extrapolation
SL 2.6Interpolation:predicting for $x$ inside the data range — reliableExtrapolation:predicting for $x$ outside the range — risky; the pattern may not holdSolve for a target:from $k\,a^{x}=T$, $\;x=\dfrac{\ln(T/k)}{\ln a}$
A fitted model predicts by substitution — but only some predictions are safe, and "when does it reach a target?" needs logs.
Linearising data: log–log & semi-log
AHL 2.10Power law:$y=k\,x^{n}\Rightarrow \log_{10}y=\log_{10}k+n\log_{10}x$ — plot $\log_{10}y$ vs $\log_{10}x$: gradient $n$, intercept $\log_{10}k$Recover:$k=10^{\text{intercept}}$Exponential:$y=a\,b^{x}\Rightarrow \ln y=\ln a+(\ln b)\,x$ — plot $\ln y$ vs $x$: gradient $\ln b$, intercept $\ln a$Recover:$b=e^{\text{gradient}}$, $\;a=e^{\text{intercept}}$
Taking logs turns a power or an exponential law into a straight line — the AHL trick for spotting the model and reading off its parameters.
Reading a fitted model: rank correlation & optimisation
AHL 2.9Spearman's rank:$r_s=1-\dfrac{6\sum d^{2}}{n(n^{2}-1)}$ — correlation of the ranks; $d$ is each item's rank differenceOptimise a model:at a max/min of a fitted $P=ax^2+bx+c$, $\;\dfrac{dP}{dx}=2ax+b=0\Rightarrow x=-\dfrac{b}{2a}$
Two HL extensions: a correlation measure built on ranks, and using calculus to read a fitted curve.
Exam attack plan
All sections
| Question cue | What to do | Watch for |
|---|---|---|
| "Which model fits this data?" | Match the scatter's shape; run that regression; compare $R^2$ | High $R^2$ alone isn't proof — check the residual pattern and context |
| "Find the equation of best fit" | LinReg / QuadReg / ExpReg / PwrReg; read the parameters and $R^2$ | Use $y$ on $x$ to predict $y$; the line passes through $(\bar x,\bar y)$ |
| "Interpret $r$ / find $R^2$" | $R^2=r^2$; state the % of variation in $y$ explained | Squaring kills the sign; $R^2\ge 0$ always |
| "Find the residual at a point" | $y-\hat y$ (observed $-$ predicted) using the fitted model | Keep the order; positive means the point is above the model |
| "Predict $y$ when $x=\dots$" | Substitute into the fitted model | Inside range = interpolation (safe); outside = flag as extrapolation |
| "When does it first reach / exceed $T$?" | Solve $k\,a^{x}=T$: $x=\ln(T/k)/\ln a$ | "First exceeds" rounds UP (ceiling) |
| "Straighten the data (log–log / semi-log)" | log–log $\to$ power (gradient $n$); semi-log $\to$ exponential (gradient $\ln b$) | Intercept is $\log k$ or $\ln a$, not $k$ or $a$ |
| "Maximise profit / minimise cost" | Differentiate the fitted model, set $=0$, solve, substitute back | Report the value, not the $x$; check max vs min via the sign of $a$ |
Worked Example — Fitting & Using an Exponential Model
Question (AI HL Paper 2 style — 8 marks)
A culture of bacteria is measured every hour. The table gives the count $N$ (in thousands) at time $t$ hours.
| $t$ (hours) | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| $N$ (thousands) | 5.00 | 7.50 | 11.3 | 16.9 | 25.3 | 38.0 |
(a) Use your GDC to find the exponential regression model $N=k\,a^{t}$, and write down the value of $R^2$.
(b) Interpret the values of $k$ and $a$ in context.
(c) Use the model to predict the count at $t=3.5$ hours, and state whether this prediction is reliable.
(d) Find the first whole hour at which the count first exceeds $100$ thousand.
Solution
- (a) Enter $t$ in one list and $N$ in another, then run ExpReg. (M1) The GDC returns $N=5.00\,(1.50)^{t}$ with $R^2=1.00$ (3 s.f.). (A1)
- (b) $k=5.00$: the initial count is $5.00$ thousand bacteria (at $t=0$). (A1) $a=1.50$: the count grows by $(1.50-1)\times100\%=50\%$ each hour. (A1)
- (c) $t=3.5$ lies inside the data range $0\le t\le 5$, so this is interpolation — reliable. $N=5.00\times1.50^{3.5}$ (M1) $=5.00\times4.133=20.7$ thousand (3 s.f.). (A1)
- (d) Solve $5.00\times1.50^{t}=100$, i.e. $1.50^{t}=20.0$, so $t=\dfrac{\ln 20.0}{\ln 1.50}=\dfrac{2.996}{0.4055}=7.39$. (M1) Since the count must first exceed $100$, round up to the next whole hour: $t=8$ hours. (A1)
Examiner's note: always show the model you fitted and quote $R^2$. Part (c) is interpolation, so it is trustworthy; a prediction at, say, $t=20$ would be extrapolation and should be flagged as unreliable. The two classic errors here are computing $k\cdot a\cdot t$ instead of $k\,a^{t}$, and rounding $7.39$ down to $7$ in (d) — "first exceeds" always rounds UP. Check: $5.00\times1.50^{7}=85.4<100$ but $5.00\times1.50^{8}=128>100$, confirming $t=8$.
Common Student Questions
- How do I choose between a linear, quadratic, exponential and power model?
- What is the difference between $r$ and $R^2$?
- Why can't I trust a prediction outside the data range?
- Why does "first exceeds" round up instead of to the nearest whole number?
- When would I use a log–log or a semi-log graph?
How do I choose between a linear, quadratic, exponential and power model?
What is the difference between $r$ and $R^2$?
Why can't I trust a prediction outside the data range?
Why does "first exceeds" round up instead of to the nearest whole number?
When would I use a log–log or a semi-log graph?
Your next step



