IB Math AI HL Non-Linear Modelling & Regression — Complete Cheatsheet
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. Hand-built by an IBO-certified Singapore tutor, with a print-ready PDF to download.
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$). The print-ready PDF is at the bottom, free to download.
§1 — Fit a curve, then predict SL 2.6
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.
Least squares:the fit minimises $\displaystyle\sum (y_i-\hat y_i)^2$ — the total squared gap between data and model
Exponential model:$y=k\,a^{x}$ — constant percentage growth or decay
Power model:$y=a\,x^{b}$ — many physical and allometric laws
Fit quality:$R^2$ close to $1$ means the model explains most of the variation
A scatter plot with its least-squares line of best fit. Each residual is the vertical gap from a point to the line; least squares makes the total squared residual as small as possible. Predicting inside the data range is interpolation (reliable); the dashed extension into the shaded band is extrapolation — use with care.
TrickOn the GDC pick the regression that matches the shape — LinReg, QuadReg, CubicReg, ExpReg or PwrReg — and it returns the parameters and $R^2$ in a single step.
TrapOnly trust predictions for $x$ inside the data range (interpolation). Reaching outside the range is extrapolation, and the pattern may simply not continue.
§2 — 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
NoteChoose by shape first, then confirm with $R^2$ and the residual pattern — never on $R^2$ alone. A high-order polynomial can hug the points yet behave nonsensically just outside the data.
TrapExponential and power models look alike but differ: $y=k\,a^{x}$ raises a fixed base $a$ to the variable $x$, whereas $y=a\,x^{b}$ raises the variable $x$ to a fixed exponent $b$.
§3 — Fitting a line: least-squares regression SL 2.6
For a linear model the regression line of $y$ on $x$ comes straight from the summary sums.
Predict:substitute the required $x$ into $\;y=a+bx\;$ to get $\hat y$
TrickFind the gradient first, then the intercept, then substitute to predict. On the GDC, LinReg hands you $a$ and $b$ directly — the formula is only for a "show that".
NoteThe regression line of $y$ on $x$ always passes through the mean point $(\bar x,\bar y)$. Use it to predict $y$ from $x$ — not the reverse.
§4 — Correlation $r$ and the coefficient of determination $R^2$ SL 2.6
Two numbers report how strongly a model fits: Pearson's correlation coefficient $r$ and the coefficient of determination $R^2$.
Correlation:$-1\le r\le 1$ — the sign gives the direction, the size gives the strength
Determination:$R^2=r^2$ — the proportion of the variation in $y$ explained by the model
Reading it:$R^2=0.96 \Rightarrow$ the model explains $96\%$ of the variation in $y$
TrapSquaring destroys the sign: a strong negative $r=-0.98$ still gives a positive $R^2=0.960$. So $R^2\ge 0$ always — you can never read the direction of the relationship off $R^2$.
NoteFor a non-linear fit the GDC reports $R^2$ directly (there is no single signed $r$). A higher $R^2$ means a better fit, but a fit is only as good as its residuals — check those too (§5).
§5 — Residuals: the real test of fit SL 2.6
A residual measures the error at a single point; adding the squared residuals measures the total misfit and lets you compare rival models.
Residual:$\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
TrapKeep the order observed $-$ predicted: a positive residual means the point lies above the model. Square each residual before adding, so positives and negatives cannot cancel.
TrickA good model leaves residuals scattered randomly about zero. A clear curved pattern in the residuals is the data telling you the model family is wrong — switch curves.
§6 — Exponential & power models SL 2.5
The two AI staples reward care when you evaluate them.
Exponential:$y=k\,a^{x}$ — initial value $k$ (at $x=0$); multiplies by $a$ every unit step
% change:growth or decay of $(a-1)\times100\%$ per step; $a>1$ grows, $0
Power:$y=a\,x^{b}$ — the exponent $b$ acts on $x$ only
TrapTo evaluate $y=k\,a^{x}$, raise $a$ to the power $x$ first, then multiply by $k$ — never compute $k\cdot a\cdot x$. The exponent applies to $a$, not to the product.
NoteA power model $y=a\,x^{b}$ suits allometric and physical laws (e.g. period against length). Only $x$ carries the exponent, so $(a x)^{b}$ is wrong; for $b>0$ the curve passes through the origin.
§7 — Predict with care: interpolation vs extrapolation SL 2.6
A fitted model predicts by substitution — but only some predictions are safe, and "when does it reach a target?" needs logs.
Interpolation:predicting for $x$ inside the data range — reliable
Extrapolation:predicting for $x$ outside the range — risky; the pattern may not hold
Solve for a target:from $k\,a^{x}=T$, $\;x=\dfrac{\ln(T/k)}{\ln a}$
Trap"First reaches / first exceeds" always rounds UP (the ceiling), never to the nearest whole number: $t=9.1$ means it first happens during period $10$.
NoteEven a model with $R^2=0.999$ can extrapolate nonsense — an exponential growth model predicts an unbounded population. Always state a prediction made outside the data range as tentative.
Tricklog–log (both axes logged) straightens a power law; semi-log (only $y$ logged) straightens an exponential. So a straight log–log plot signals a power model, a straight semi-log plot signals an exponential.
TrapThe intercept is $\log_{10}k$ (or $\ln a$), not $k$ (or $a$). Undo it with $10^{(\ )}$ for a $\log_{10}$ axis, but with $e^{(\ )}$ for a $\ln$ axis — match the base to the axis.
Two HL extensions: a correlation measure built on ranks, and using calculus to read a fitted curve.
Spearman's rank:$r_s=1-\dfrac{6\sum d^{2}}{n(n^{2}-1)}$ — correlation of the ranks; $d$ is each item's rank difference
Optimise 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}$
NoteSpearman's $r_s$ measures monotonic agreement using ranks only, so it is resistant to outliers and picks up curved-but-increasing relationships that Pearson's $r$ understates. Keep the leading $1-$ in the formula.
TrickFitting finds the curve; calculus reads it. Set $\frac{dP}{dx}=0$ for the optimal $x$, then substitute back to report the value (the profit or height), not the $x$. With $a<0$ the parabola opens downward, so the turning point is a maximum.
§10 — 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
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?
Look at the shape of the scatter first. A straight trend is linear; a single hump or dip is quadratic; a constant-percentage rise or fall (each step multiplies by the same factor) is exponential; a curve that starts at the origin and follows a physical or size-based law is often a power model. Then run the matching regression on the GDC and compare $R^2$ and the residual patterns. Never pick on $R^2$ alone — a high-order polynomial can score a great $R^2$ yet behave absurdly just outside the data, so let shape and context lead.
What is the difference between $r$ and $R^2$?
$r$ is Pearson's correlation coefficient for a linear relationship: it runs from $-1$ to $1$, where the sign gives the direction and the size gives the strength. $R^2$ is the coefficient of determination, and for a linear fit $R^2=r^2$ — the proportion of the variation in $y$ explained by the model, always between $0$ and $1$. Squaring removes the sign, so a strong negative $r=-0.98$ gives $R^2=0.960$; you cannot read the direction off $R^2$. For non-linear models the GDC reports $R^2$ directly, since there is no single signed $r$.
Why can't I trust a prediction outside the data range?
Because a model is only fitted to the data you have; outside that range you are assuming the pattern continues, and it often does not. Predicting inside the range is interpolation and is reliable; predicting outside is extrapolation and is risky. An exponential growth model, for instance, keeps climbing to an impossible population, and a quadratic profit model eventually turns negative. Even with $R^2=0.999$, always state an extrapolated value as tentative and sanity-check it against the real situation.
Why does "first exceeds" round up instead of to the nearest whole number?
Because you want the first whole period at which the quantity has genuinely passed the target. If solving $k\,a^{t}=T$ gives $t=7.39$, the target is passed part-way through period $8$, so it has not yet been exceeded at $t=7$ — the answer is $t=8$. This is a ceiling, not standard rounding: even $t=7.05$ rounds up to $8$. Reserve nearest-whole-number rounding for "closest to" questions; "first reaches / first exceeds" always rounds up.
When would I use a log–log or a semi-log graph?
Use them to straighten — and then fit — a non-linear law with a ruler. Plotting $\log_{10}y$ against $\log_{10}x$ (log–log) turns a power law $y=k\,x^{n}$ into a straight line of gradient $n$ and intercept $\log_{10}k$, so recover $k=10^{\text{intercept}}$. Plotting $\ln y$ against $x$ (semi-log) turns an exponential $y=a\,b^{x}$ into a line of gradient $\ln b$ and intercept $\ln a$, so $b=e^{\text{gradient}}$ and $a=e^{\text{intercept}}$. If the log–log plot is straight the law is a power; if the semi-log plot is straight it is an exponential. Just remember the intercept is a log of the constant, not the constant itself.
What's NOT in this cheatsheet
This page gives you the formulas and traps for free. The full Photon Academy IB Math AI HL library (enrolled students, or the lifetime resource library) adds:
Notes PDF — every model family, the least-squares method, r, R² and residuals, with fully worked exponential, power and linearisation examples.
Tutorial booklet — 25+ AI HL-style questions from reading a regression off the GDC to full modelling applications (growth, decay, optimisation).
Tutorial Solutions — mark-scheme-style solutions with M1/A1 annotations and the exact GDC regression screens to reproduce.
Predicted-paper questions — the modelling and regression question types most likely to appear in the next AI HL session.