instagram

Students use a custom-built Desmos slider activity to visually fit a quadratic model to the data, compute its fit in Pyret, and interpret the results.

Lesson Goals

Students will be able to…​

  • Recognize when different kinds of models best describe a situation or data, and use those functions to solve problems and make predictions.

Student-facing Lesson Goals

  • Let’s use Pyret to model quadratic relationships in data.

Materials

Supplemental Materials

Preparation

  • Much of the exploration in this lesson hinges on the same custom-built interactive Desmos activity we used in Building Quadratic Models.

    • Set the pacing so that students are able to interact with the slides 3-7.

    • Decide how you will share the link or code with students and, if you are using our Google Slides, add the appropriate link to the slide deck.

    • If you don’t already have a code, or you want to share a new one, you will first want to:

  • If you’re a first-time Desmos user, fear not! Here’s what you need to do.

  • Decide whether you want students to model and interpret all of the datasets in the Desmos file. If it’s a priority for you, you may want to print the optional page for each dataset (2-seam, sliders, 4-seam, full) to scaffold that work.

🔗Fitting Quadratic Models

Overview

Students work with the vertex form to fit a quadratic model for Aaron Judge’s batting angle and hit distance data. They extend the model-fitting techniques from the Fitting Linear Models lesson into quadratic relationships and explore the vertex form ( f(x) = a(xh)2  + k) of quadratic models using a custom Desmos slider activity.

Launch

We’ve been talking about model settings and vocabulary for quadratic functions that look a lot like the ones you might see in a textbook: clean and predictable. But real-world data is messy!

Let’s return to our dataset to dig into that messiness.

  • Open the Aaron Judge Starter File and click "Run".

  • Before we try to build a quadratic model for our data, we need to learn a new Pyret function!

  • Stop and think:   What to do you predict will be the output of these two expressions?

    • sqr​(​4​)

    • sqr​(​6 - 2​)

  • Test your predictions be evaluating the expressions in the Interactions Area.

  • What is the Contract for sqr?

  • # sqr :: Number -> Number

  • What does sqr do?

  • Multiply the input times itself

  • Why will we need sqr in order to build quadratic models in Pyret?

  • All quadratic functions square some expression using the input.

  • Build a scatter plot using bat-angle as the explanatory variable (on the x-axis) and hit-distance as the response variable (on the y-axis).

  • What about this scatter plot might make someone wonder whether a parabola is really a good model?

  • Answers will vary.

  • It’s not perfectly symmetrical.

  • The band of points is pretty wide.

  • Why does it make sense to use a quadratic model for this data?

  • While no curve will include all of these data points, there is a clear trend in which the hit distance rises, peaks, and then falls as the bat angle increases.

  • Models are - by definition - approximations of the real world.

Investigate

Let’s try to build the best possible quadratic model we can for our Aaron Judge Batting Data, using what we know about how a, h, and k influence the shape of a parabola.

  • From looking at our scatter plot, what do we know about the model settings in the vertex form of our quadratic model?

  • a should be negative because the curve opens down.

  • h should be around 30, because it seems to be the optimum bat angle.

  • k should be about 450, because the y-value of the vertex is around there.

Building on what we already know about the data, let’s experiment with Desmos sliders to visually fit the best model we can.

Make sure you have shared the link or code you made for your class to Exploring Quadratic Functions (Desmos).

  • Open Exploring Quadratic Functions (Desmos). You should be on Slide 3: Fitting Models .

  • Turn to the Fitting the Model Visually in Desmos section of Modeling Bat Angle v. Hit Distance (Curveballs) and define your best-guess model for the relationship between bat-angle and hit-distance in the curve ball data.

  • Return to the Aaron Judge Starter File and modify the curve function on line 47 using the model settings from the model you fit in Desmos.

  • Use fit-model to determine how well your model predicts hit distance from bat angle.

  • Record and interpret the results by completing Modeling Bat Angle v. Hit Distance (Curveballs).

  • Slides 4-7 of the Desmos file each focus on other subsets of Aaron Judge’s batting data.

    • Visually fit models for these datasets in Desmos.

    • Update the last four functions defined in the Pyret file.

    • Write fit-model expressions to test them out and interpret the S-value.

    • Your teacher may have printed pages to support you with modeling and interpreting these other datasets (2-seam, sliders, 4-seam, full).

  • According to the S-values, does your quadratic model do a better job of predicting hit distances from bat angle than the optimal linear model did?

  • Yes. Hopefully students have come up with a model whose predictions are expected to be at least 30 feet more accurate than the optimal linear model.

  • Linear regression allows us to find the computationally optimal model. Do we know whether or not the quadratic models we just built are the best?

  • We don’t know!

  • This fitting process was purely about adjusting sliders and seeing if S goes down. It was all trial-and-error, with no guarantee that there’s no better model out there.

  • Slides 3-6 in the Desmos file display data for specific pitch types. Slide 7 shows the full dataset. Which of the subsets is most visually similar to the full dataset and what does that tell us?

  • The four-seam fastball dataset looks very similar to the full dataset. That is an indicator that four-seam fastballs likely represent a significant portion of the dataset.

  • count(judge-table, "pitch-type") reveals that 93 of the 262 pitches are four-seam fastballs.

Quadratic models written in Vertex Form make it incredibly easy to find the vertex (h, k), the axis of symmetry h, and whether the parabola opens up or down (a). But finding the roots or y-intercept is a lot harder! Just as there are multiple forms of linear functions that make it easier to work with certain information, there are other forms of quadratic models!

Synthesize

  • How did your quadratic model compare to the optimal linear model for this data?

  • Unlike the linear models, our quadratic models, roughly followed the shape of the data.

  • The S-values for our quadratic models showed significantly less error in predictions than the optimal linear model did.

  • Once you approximated the vertex of a dataset, how much trial and error was involved in defining a quadratic model in vertex form that visually fit the dataset?

  • h and k didn’t need to change much!

  • We knew whether a would be negative or positive, but it took some playing to find a number that matched the width of the curve to the points.

Optional Activity: Guess the Model!

  1. Divide students into small groups (2-4), and have each team come up with a secret, quadratic, real-world scenario, then have them write down a quadratic function that fits this scenario on a sticky note. Make sure these functions are private within each team! (Note: students may be tempted to just make up a scenario where something rises and falls, or vice versa. Challenge them to think through why the change in the output is quadratic with respect to the change of the change in the input!)

  2. On the board or some flip-chart paper, have each team draw a scatter plot for their quadratic function. They should only draw the point cloud - not the function itself! Finally, have students title their scatter plot to describe their real-world scenario (e.g., "percentage of people wearing diapers vs. age").

  3. Have teams rotate so that each team is in front of another team’s scatter plot. Have them figure out the original function, write their best guess on a sticky note, and stick it next to the plot.

  4. Have teams return to their original scatter plot, and look at the model their colleagues guessed. How close were they? What strategies did the class use to figure out the model?

    • The model settings can be constrained to make the activity easier or harder. For example, limiting these model settings to whole numbers, positive numbers, etc.

    • To extend the activity, have the teams continue rotating so that each group adds their sticky note for the best-guess model. Then do a gallery walk so that students can reflect: were the models all pretty close? All over the place? Were the guesses for one model setting grouped more tightly than the guesses for another?

🔗Additional Practice

  • Modeling Fuel Efficiency v. Speed engages students with visually fitting a quadratic model for fuel efficiency data using Slide 8 of the Desmos file and what they know about the model settings in the vertex form from the shape of the data. As with the activity they just completed, students will then define and fit their model in Pyret, and interpret the results.

  • NOTE: While the fuel efficiency dataset used in the optional materials we’ll be offering throughout our quadratics lessons is based on real data obtained from the Transportation Energy Book, it has been augmented with fictional data in order to provide a sufficiently-rich dataset for student modeling. You can find out more about this augmentation in the README tab of the dataset.

  • A scatter plot of the fuel efficiency data has the familiar "rise and fall" pattern of a parabola…​ but there appears to be a "dip" around 40mph. The existence of a "dip" like this is normal in real data, but it doesn’t mean that the overall shape of this relationship isn’t quadratic. This is a great opportunity to remind students that there’s no such thing as a perfect model!

  • Students may wonder why fuel efficiency is a function of the square of the speed, rather than the speed itself! Physicists have determined that the biggest factor affecting fuel efficiency is drag: the effect of air slowing it down. Physicists have calculated that drag increases based on squared velocity. Additionally, a car’s transmission uses more efficient gears for higher speeds (the engine can turn more slowly at higher gears), but rarely does a car have a gear optimized for speeds above 65mph. As a result efficiency falls sharply once the "highest" gear is reached, as higher speeds require the engine to run faster.

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.