Open your copy of the Fuel Efficiency Starter File and click "Run".

num-sqr

Before we try to model our fuel-efficiency data, we need to learn a new Pyret function!

1 Can you predict what the output of the num-sqr expressions below will be?
Test them out in the Interactions Area, and record the results. num-sqr​(​4​) num-sqr​(​6 - 2​)

2 What is the Contract for num-sqr?

3 What does num-sqr do?

Interpreting a Quadratic Model

In the Definitions Area of your Fuel Efficiency Starter File, you’ll find the definition of a quadratic model quad1.

4 In quad1, the value of 𝑎 is , the value of 𝒽 is , and the value of 𝑘 is

5 Fit this model to your dataset, using fit-model. What 𝑆-value did you get?

Hint: If you forgot the contract for fit-model, look it up in the contracts pages!

6 In your own words, describe what needs to change about this model to fit the data.

Modeling Fuel Efficiency

Vertex Form: 𝑦 = 𝑎(𝑥 − 𝒽)2 + 𝑘

  • 𝑎: determines whether the parabola opens up or down and how steep the curve is

  • 𝒽: x-coordinate of the vertex

  • 𝑘: y-coordinate of the vertex (in quadratic models, this is also the vertical shift!)

7 We’ve determined that peak fuel efficiency is around 45 mph. What variable in the equation should we replace with 45?

Update the definition of quad1, click "Run" and re-fit the model. What 𝑆-value did you get?

8 What y-coordinate of the vertex would best match the shape of the curve?

Update the definition of quad1, click "Run" and re-fit the model. What 𝑆-value did you get?

9 What value of 𝑎 best matches the shape of the curve?

Update the definition of quad1, click "Run" and re-fit the model. What 𝑆-value did you get?

10 Make any small changes you’d like, trying to get 𝑆 as low as you can. Write your final definition below.

fun f(x) : end 𝑆:

What does this model actually mean?

Numerical responses will vary!

After experimenting, I came up with a quadratic model for this dataset showing that x-variable is correlated to y-variable. The error in the model is described by an S-value of about Sunits, which is insignificant, moderate, significant, extreme considering that y-variable in this dataset range from lowest y-value to highest y-value. The vertex of the parabola drawn by this model is a minima or maxima? at about (x, y) which means that

Before this point, as speed increases, mpg . After this point, as speed increases mpg

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.