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 a is , the value of h is , and the value of k is
5 Fit this model to your dataset, using fit-model
. What S-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: f(x) = a(x − h)2 + k |
|
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 S-value did you get?
8 What y-coordinate of the vertex (vertical shift) would best match the shape of the curve?
Update the definition of quad1
, click "Run" and re-fit the model. What S-value did you get?
9 What value of a best matches the shape of the curve?
Update the definition of quad1
, click "Run" and re-fit the model. What S-value did you get?
10 Make any small changes you’d like, trying to get S as low as you can. Write your final definition below.
fun f(x) :
end
S:
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). 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.