MathLab with Mr. Ahmed

MathLab with Mr. Ahmed is a math learning website by Ahmed Amasha, a mathematics teacher teaching the American curriculum. Explore Algebra 2, Precalculus, Calculus, and SAT and PSAT Math Prep through lessons, focused practice and printable resources.

MathLabwith Mr. Ahmed
Free preview

3.M Focus on Modeling (Chapter Supplement)

Fit polynomial models to data and interpret predictions with realistic constraints.

Before you solve

Ideas in this lesson

Explore the lesson brief and the worked example for Idea 11. Create a free account to continue with the remaining ideas and practice.

Lesson brief and rules

3.M Focus on Modeling (Chapter Supplement)

Inspect a scatterplot, choose a justified polynomial degree, fit the model, and test predictions against the data and physical domain.

Remember
A model must respect the observed data and the practical meaning of its domain.
Worked example 11
01 / In a polynomial trend study, the following invented observations are recorded as input-output pairs: (0,3.23)(0,3.23), (1,4.54)(1,4.54), (2,6.03)(2,6.03), (3,7.4)(3,7.4), (4,8.77)(4,8.77), (5,10.26)(5,10.26), (6,11.57)(6,11.57). Keep every observation, including repeated inputs. Use technology to obtain the requested least-squares fit. Show a labeled scatter plot and overlay your fitted curve. Compare linear, quadratic, and cubic fits by their sums of squared residuals. Choose the lowest degree whose SSESSE is below 0.10.1, describe whether the data require a peak or valley, and explain why merely choosing the smallest SSESSE can overfit. If each measured output is increased by 22, explain exactly how the fitted coefficients and SSESSE change without refitting. Complete the written work or drawing first. The selected answer checks the result only; your reasoning or drawing needs teacher/self-review.
02 / Enter the 77 observations as paired lists; do not sort the two lists independently.
03 / Use the calculator polynomial regression command of degree 1(1 ( not interpolation )), then store its coefficients. This minimizes ∑i(yi−p(xi))2\sum_i(y_i-p(x_i))^{2}. The normal equations are (ATA)c=ATy(A^{T}A)c=A^{T}y, where row ii of AA is (1,xi)(1,x_i).
04 / The fitted model is p(x)=1.4x+3.2p(x)=1.4x+3.2. Coefficients displayed to six decimals; retain full precision in calculations.
05 / Overlay this curve on the data for 0≤x≤60\le x\le 6. The vertical residuals, in input order, are 0.0300,−0.0600,0.0300,0.0000,−0.0300,0.0600,−0.03000.0300, -0.0600, 0.0300, 0.0000, -0.0300, 0.0600, -0.0300; their squared sum is 0.0108000.010800.
06 / degree 11: SSE=0.010800SSE=0.010800, p(x)=1.4x+3.2p(x)=1.4x+3.2; degree 22: SSE=0.010800SSE=0.010800, p(x)=1.4x+3.2p(x)=1.4x+3.2; degree 33: SSE=0.008400SSE=0.008400, p(x)=−0.003333x3+0.03x2+1.333333x+3.22p(x)=-0.003333x^{3}+0.03x^{2}+1.333333x+3.22
07 / The stipulated SSESSE rule selects degree 11. Higher-degree models contain the lower-degree family and therefore cannot have larger best-fit SSESSE; this alone does not establish a better physical model.
08 / Adding 22 to every output adds 22 only to the fitted constant term. Every residual and the SSESSE stay unchanged, since observed and predicted outputs shift equally.
09 /
0−0.931.21.812.44.553.67.284.810.02612.76InputOutput
Reference scatter plot and fitted polynomial. Open circles: observations; solid curve: fitted model.
Worked example 2 · Choose polynomial degree and compare least-squares fit

In a polynomial trend study, the following invented observations are recorded as input-output pairs: (0,2.435)(0,2.435), (1,5.73)(1,5.73), (2,8.035)(2,8.035), (3,9.0)(3,9.0), (4,8.765)(4,8.765), (5,7.47)(5,7.47), (6,4.765)(6,4.765). Keep every observation, including repeated inputs. Use technology to obtain the requested least-squares fit. Show a labeled scatter plot and overlay your fitted curve. Compare linear, quadratic, and cubic fits by their sums of squared residuals. Choose the lowest degree whose SSESSE is below 0.10.1, describe whether the data require a peak or valley, and explain why merely choosing the smallest SSESSE can overfit. If all outputs are converted to a unit half as large, explain how coefficients and SSESSE change. Complete the written work or drawing first. The selected answer checks the result only; your reasoning or drawing needs teacher/self-review.

Enter the 77 observations as paired lists; do not sort the two lists independently.
Use the calculator polynomial regression command of degree 2(2 ( not interpolation )), then store its coefficients. This minimizes ∑i(yi−p(xi))2\sum_i(y_i-p(x_i))^{2}. The normal equations are (ATA)c=ATy(A^{T}A)c=A^{T}y, where row ii of AA is (1,xi,xi2)(1,x_i,x_i^{2}).
The fitted model is p(x)=−0.6x2+4x+2.4p(x)=-0.6x^{2}+4x+2.4. Coefficients displayed to six decimals; retain full precision in calculations.
Overlay this curve on the data for 0≤x≤60\le x\le 6. The vertical residuals, in input order, are 0.0350,−0.0700,0.0350,0.0000,−0.0350,0.0700,−0.03500.0350, -0.0700, 0.0350, 0.0000, -0.0350, 0.0700, -0.0350; their squared sum is 0.0147000.014700.
degree 11: SSE=30.254700SSE=30.254700, p(x)=0.4x+5.4p(x)=0.4x+5.4; degree 22: SSE=0.014700SSE=0.014700, p(x)=−0.6x2+4x+2.4p(x)=-0.6x^{2}+4x+2.4; degree 33: SSE=0.011433SSE=0.011433, p(x)=−0.003889x3−0.565x2+3.922222x+2.423333p(x)=-0.003889x^{3}-0.565x^{2}+3.922222x+2.423333
The stipulated SSESSE rule selects degree 22. Higher-degree models contain the lower-degree family and therefore cannot have larger best-fit SSESSE; this alone does not establish a better physical model.
The numerical outputs double. Every fitted coefficient doubles and every residual doubles, so the SSESSE is multiplied by 44.

0−0.731.21.412.43.553.65.694.87.8369.97InputOutput
Reference scatter plot and fitted polynomial. Open circles: observations; solid curve: fitted model.

Written-work review:

15 questions with a worked answer for each.Start practice ↗
Textbook reference: Stewart, Redlin & Watson, Precalculus: Mathematics for Calculus, 7th ed. (Cengage, 2016). The explanations and practice here are original, organized by textbook section.