Skip to content
IB Diploma ProgrammeSL & HL

Non-linear regression

Mathematics: Applications and Interpretation SL & HL Chapter Notes

Last updated November 2026

ShareWhatsAppPost

Non-linear regression notes as a printable PDF.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Non-linear regression notes as text: skim, search, and jump between subtopics.

~11 min read

1. Fitting a non-linear model with technology

Regression finds the function of a chosen type that best fits the data. In examinations the types are linear, quadratic, cubic, exponential, power and sine. Use technology to find the least squares regression curve: enter the data in two lists, choose the type, and read off the parameters.

When the data are years, enter the years after a starting year, so the list begins 0, 20, 40, … and not 1900, 1920, …. Write the model in equation form.

An exponential model ties to geometric sequences: each increase of 1 in x multiplies y by the same number b. The command term “find” asks for the equation from technology, with evidence of the x values used.

f(x) = ax² + bx + c

y = a × b^(x)

y = a x^(b)

Worked example 13 marks

Ethan and Avery are researching population data for the city of Los Angeles to create a model predicting population values. They collect the following data.

Ethan proposes the population can be modelled using quadratic regression to find a function of the form f(x) = ax² + bx + c, where x is the number of years after 1900.

(a) Find the equation of Ethan's model.

YearPopulation (thousands)
1900102
1920577
19401504
19602479
19802967
20003685
20203899
  1. 1

    M1: evidence of using the values 0, 20, 40, 60, … for their x data [1]

  2. 2

    A2: f(x) = -0.0989x² + 45.9x - 67.8 in equation form [2]

2. Sum of square residuals

A residual is the gap between an observed value of y and the value the model gives for the same x. The sum of square residuals, SS_res, adds the squares of all the residuals. It measures how well a model fits: the smaller the SS_res, the closer the model is to the data.

Square each residual before adding. Residuals above and below the curve would otherwise cancel. If SS_res = 0 the curve passes through every point.

SS_res = sum ( y_observed - y_model )²

Worked example 14 marks

Four data points are (0, 1.2), (1, 1.9), (2, 4.3) and (3, 7.6). Two models are proposed: A: y = 2^(x) and B: y = 2.3x.

Calculate SS_res for each model and state which model fits the data better.

  1. 1

    M1: residuals for A = y - 2^(x): 0.2, -0.1, 0.3, -0.4 [1]

  2. 2

    A1: SS_res(A) = 0.04 + 0.01 + 0.09 + 0.16 = 0.30 [1]

  3. 3

    A1: residuals for B = y - 2.3x: 1.2, -0.4, -0.3, 0.7, so SS_res(B) = 1.44 + 0.16 + 0.09 + 0.49 = 2.18 [1]

  4. 4

    R1: 0.30 < 2.18, so the smaller SS_res means model A fits better [1]

3. The coefficient of determination, R²

The coefficient of determination, R², gives the proportion of variability in the second variable accounted for by the chosen model. Find it with technology, beside the regression equation. For R² = 0.98843 the model accounts for 98.843% of the variation in y.

A value close to 1 means a good fit. For a linear model, R² is the square of Pearson's product moment correlation coefficient r, so R² is never negative even when r is.

Awareness only, not examined: R² = 1 - SS_res/SS_tot, so R² = 1 when SS_res = 0.

R² = r² (linear model)

Worked example 12 marks

Ethan finds the coefficient of determination for his quadratic model of the population of Los Angeles is 0.98843 to five significant figures.

(b) State whether the coefficient of determination supports Ethan's proposal. Justify your answer.

  1. 1

    R1: R² is (very) close to 1, or 0.98843 is close to 1, or the model explains 98.843% of the total variation [1]

  2. 2

    A1: therefore it supports Ethan's proposal [1]

4. Why R² alone is not enough

Many factors affect the validity of a model. R², by itself, is not a good way to decide between different models: a high value does not show that the model makes sense.

Check the parameters and the predictions against the context. A negative population, a length below zero or a value that keeps growing without limit are signs the model fails outside the data.

Comment asks for a judgement tied to a named parameter or value, not a general remark.

Worked example 11 mark

Ethan's model for the population of Los Angeles, in thousands, is f(x) = -0.0989x² + 45.9x - 67.8, where x is the number of years after 1900.

(c) Comment on the validity of Ethan's model with reference to one of the parameters in the equation.

  1. 1

    R1: the negative value of c is unrealistic as you cannot have a negative population; or the negative value of a suggests the population will decrease back to 0 or become negative in the future [1]

Recap

  • Regression with technology: enter years as years after a start year; give the model in equation form.
  • Examination types: linear, quadratic, cubic, exponential, power and sine.
  • SS_res is the sum of the squared gaps between data and model. Smaller means a better fit.
  • R² is the proportion of variability in y accounted for by the model. Close to 1 is a good fit.
  • For a linear model, R² = r².
  • R² alone does not decide between models: check parameters and predictions in context.

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. State which of y = 4 × 1.5^(x) and y = 4x^(1.5) is an exponential function.1 mark
    Answer
    1. y = 4 × 1.5^(x), because x is in the exponent.

    Trap: Swapping the two: y = 4x^(1.5) has x in the base, so it is a power function.

  2. The mass m of a sample is measured at t = 0, 1, 2, 3, 4 hours: 80, 40, 20, 10, 5 g. (a) Use technology to find an exponential model m = a × b^(t) for the data. (b) Use the model to find the mass at t = 6.3 marks
    Answer
    1. (a)
    2. a = 80 and b = 0.5, so m = 80 × 0.5^(t) [2].
    3. (b)
    4. m = 80 × 0.5⁶ = 1.25 g [1].

    Trap: Reading b as 2, the factor by which the mass halves, instead of the multiplier 0.5.

  3. The data points are (1, 5), (2, 6), (3, 13) and (4, 18). A model is y = x² + 3. Calculate SS_res.3 marks
    Answer
    1. Model values 4, 7, 12, 19, so residuals 1, -1, 1, -1 [2].
    2. SS_res = 1 + 1 + 1 + 1 = 4 [1].

    Trap: Adding the residuals without squaring gives 0, which would wrongly suggest a perfect fit.

  4. Technology gives a model for the time taken to complete a puzzle, with R² = 0.87. Interpret this value in context.2 marks
    Answer
    1. 87% of the variability in the time taken is accounted for by the model [2].

    Trap: Saying 87% of the points lie on the curve, or that the model is 87% correct.

  5. A linear model has Pearson's product moment correlation coefficient r = -0.9. Find the coefficient of determination R².2 marks
    Answer
    1. For a linear model R² = r² [1].
    2. R² = (-0.9)² = 0.81 [1].

    Trap: Writing R² = -0.9 or -0.81. R² is never negative.

  6. The number of members of a club, in hundreds, is 5, 8, 9, 8, 5 in the years 2019 to 2023. (a) Use technology to find a quadratic model for y, where x is the number of years after 2019. (b) Use the model to predict the number of members in 2025. (c) Comment on the validity of this prediction.4 marks
    Answer
    1. (a)
    2. y = -x² + 4x + 5 [2].
    3. (b)
    4. x = 6, so y = -36 + 24 + 5 = -7, that is -700 members [1].
    5. (c)
    6. A negative number of members is impossible, so the model is not valid for 2025 [1].

    Trap: Reporting -700 members as a prediction: a model can fit the data and still give impossible values outside it.

  7. Model A has R² = 0.96 and model B has R² = 0.98 for the same data. A student says that B is the better model because its R² is higher. Comment on the student's claim.3 marks
    Answer
    1. R² by itself is not a good way to decide between models: a higher R² does not show the model makes sense [2].
    2. Check the parameters and predictions of each model in context before choosing [1].

    Trap: Picking the larger R² with no check on what the model predicts.

  8. The depth of water in a harbour is modelled using sine regression by h = 2.5sin(0.52t) + 4.1, where h is in metres and t is the time in hours. The calculator is set to radians. Calculate the depth when t = 10.2 marks
    Answer
    1. h = 2.5sin(0.52 × 10) + 4.1 = 2.5sin 5.2 + 4.1, in radians [1].
    2. h = 2.5 × (-0.8835…) + 4.1 = 1.89 m [1].

    Trap: Using degree mode gives sin 5.2^(°) = 0.0906… and a depth of 4.33 m.

  9. A museum had 42, 58, 66, 69, 75, 88 thousand visitors in 2014, 2016, 2018, 2020, 2022 and 2024. Let x be the number of years after 2014. (a) Use technology to find a cubic model for y thousand visitors, with coefficients to three significant figures. (b) Write down R² for the cubic model. (c) Use the cubic model to predict the number of visitors in 2034. (d) A linear model for the same data has R² = 0.950. Evaluate whether the cubic model should be used for 2034.8 marks
    Answer
    1. (a)
    2. Use x = 0, 2, 4, 6, 8, 10, not 2014, 2016, … [1].
    3. y = 0.115x³ - 1.82x² + 11.4x + 41.9 [2].
    4. (b)
    5. R² = 0.99971 [1].
    6. (c)
    7. x = 20 [1].
    8. Unrounded model: y = 457, so about 457 000 visitors [1].
    9. (d)
    10. The cubic fits the data better: 0.99971 is closer to 1 than 0.950. But R² alone does not decide between models [1].
    11. 2034 is 10 years beyond the data. Visitors rose by 46 thousand from 2014 to 2024, yet the cubic predicts a rise of 369 thousand in the next 10 years, as the x³ term takes over. The prediction is unrealistic, so the cubic should not be used [1].

    Trap: Choosing the model with R² closest to 1 without comparing its prediction with the changes in the data; using the rounded coefficients in (c) also gives 462, not 457.

  10. The height h metres of a buoy above the seabed is 5.1, 6.8, 5.0, 3.1, 4.9 at t = 0, 3, 6, 9, 12 hours. Sine regression gives model P: h = 1.9sin(0.52t) + 5, with 0.52t in radians. (a) Calculate SS_res for model P. (b) A quadratic model Q has SS_res = 5.19. Deduce which model fits the data better. (c) Model Q predicts h = 2.76 at t = 24. Evaluate which model should be used for t = 24.7 marks
    Answer
    1. (a)
    2. Radian mode: model values 5.00, 6.90, 5.04, 3.10, 4.92 [1].
    3. Residuals h - h_P: 0.1, -0.0999, -0.0410, -0.0010, -0.0180 [1].
    4. Square and add: 0.01 + 0.00998 + 0.00168 + 0.000001 + 0.00032 [1].
    5. SS_res = 0.0220 [1].
    6. (b)
    7. 0.0220 < 5.19, so model P fits better [1].
    8. (c)
    9. P predicts h = 1.9sin(12.48) + 5 = 4.84 m. The height rises and falls with the tide, which a sine model repeats and a quadratic does not, so use P [1].
    10. t = 24 is outside the data, so the prediction assumes the pattern continues unchanged [1].

    Trap: Degree mode gives SS_res(P) = 7.39, larger than 5.19, and the wrong choice of model.

Say this, not that

Wording that loses the mark, against the wording the mark scheme credits.

Loses the markGets the mark
1900, 1920, 1940, … entered as the x values0, 20, 40, 60, …: years after 1900
-0.0989, 45.9, -67.8 with no equationf(x) = -0.0989x² + 45.9x - 67.8 in equation form
R² is high, so it supports the proposal.0.98843 is (very) close to 1, therefore it supports Ethan's proposal
The model is not valid.the negative value of c is unrealistic as you cannot have a negative population

Frequently asked questions

How do you enter years as the x values when fitting a regression model with technology?
Enter the years after a starting year, not the calendar years. Use 0, 20, 40, … for years after 1900, rather than 1900, 1920, 1940, …. Use technology to find the least squares regression curve for the chosen type, then write the model in equation form, such as f(x) = -0.0989x² + 45.9x - 67.8.
What is the sum of square residuals and how do you use it to compare two models?
A residual is the gap between an observed value of y and the model's value for the same x. The sum of square residuals, SS_res, adds the squares of all the residuals. The smaller the SS_res, the closer the model is to the data, so it fits better. Square each residual before adding, because residuals above and below the curve would otherwise cancel.
What does the coefficient of determination, R², tell you about a regression model?
R² gives the proportion of variability in the second variable accounted for by the chosen model. For R² = 0.98843 the model accounts for 98.843% of the variation in y. A value close to 1 means a good fit, and for a linear model R² = r², so it is never negative.
What is the difference between an exponential model and a power model?
In an exponential model y = a × b^(x), the variable x is in the exponent, so each increase of 1 in x multiplies y by the same number b. In a power model y = a x^(b), the variable x is in the base. For example y = 4 × 1.5^(x) is exponential, while y = 4x^(1.5) is a power function.
Why is choosing the model with the higher R² not always correct?
A high R² does not show that a model makes sense, so R² alone is not a good way to decide between models. Check the parameters and predictions against the context. A negative population, a length below zero or a value that keeps growing without limit shows the model fails outside the data.
How is R² related to Pearson's correlation coefficient r for a linear model?
For a linear model, R² is the square of Pearson's product moment correlation coefficient r, so R² = r². Because it is a square, R² is never negative even when r is. For example, if r = -0.9 then R² = 0.81.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters