Supplement: Curve Fitting aka

Slides:



Advertisements
Similar presentations
Graphing the Line of Best Fit Sensei By: Gene Thompson, PHS Edited: John Boehringer, PHS.
Advertisements

Polynomial Functions and Models Lesson 4.2. Review General polynomial formula a 0, a 1, …,a n are constant coefficients n is the degree of the polynomial.
7.7 Choosing the Best Model for Two-Variable Data p. 279.
Copyright © Cengage Learning. All rights reserved. 2 Polynomial and Rational Functions.
5/16/2015 V. J. Motto 1 Chapter 1: Data Sets and Models V. J. Motto MAT 112 Short Course in Calculus.
Finding the Equation of a Quadratic Using QUADDATA recorded by rolling a ball up and down a ramp. The distance is measured from an arbitrary starting.
Curving Fitting with 6-9 Polynomial Functions Warm Up
Identifying the general polynomial shape Example 1 General Rule: Basic polynomial function is one more that the number of direction changes.
Curving Fitting with 6-9 Polynomial Functions Warm Up
Introduction As we saw in the previous lesson, we can use a process called regression to fit the best equation with the data in an attempt to draw conclusions.
MAT 150 – Algebra Class #11 Topics: Find the exact quadratic function that fits three points on a parabola Model data approximately using quadratic functions.
Introduction Data surrounds us in the real world. Every day, people are presented with numbers and are expected to make predictions about future events.
SECTION 2.2 BUILDING LINEAR FUNCTIONS FROM DATA BUILDING LINEAR FUNCTIONS FROM DATA.
Lesson 13 Graphing linear equations. Graphing equations in 2 variables 1) Construct a table of values. Choose a reasonable value for x and solve the.
Chapter 1: Prerequisites for Calculus Section Lines
5-7 Scatter Plots. _______________ plots are graphs that relate two different sets of data by displaying them as ordered pairs. Usually scatter plots.
SOLVING & GRAPHING LINEAR EQUATIONS
Topic 2: Linear Equations and Regression
2.8Exploring Data: Quadratic Models Students will classify scatter plots. Students will use scatter plots and a graphing utility to find quadratic models.
1 6.9 Exponential, Logarithmic & Logistic Models In this section, we will study the following topics: Classifying scatter plots Using the graphing calculator.
Scatter plots and Regression Algebra II. Linear Regression  Linear regression is the relationship between two variables when the equation is linear.
Fitting Exponentials and Polynomials to Data Lesson 11.7.
Population Growth - Quadratic or Exponential ? What will the population be in 3000?
6-7: Investigating Graphs of Polynomial Functions.
10/18/2015 V. J. Motto 1 Chapter 1: Models V. J. Motto MAT 112 Short Course in Calculus Data Sets and the “STAT” Function.
Splash Screen.
+ Warm Up #1. + Polynomials Unit Polynomial Functions.
Topic 5: Logarithmic Regression
Review of Quadratics and Exponentials. QUADRATICS Analyzing Data, Making Predictions Quadratic Functions and Graphs – Graph is a curve, opened up or down.
7-8 Curve Fitting with Exponential and Logarithmic Models Warm Up
Draw Scatter Plots and Best-Fitting Lines Section 2.6.
Scatter Plots, Correlation and Linear Regression.
Domain and Range of Quadratic Functions
2.5 Using Linear Models P Scatter Plot: graph that relates 2 sets of data by plotting the ordered pairs. Correlation: strength of the relationship.
Ch. 6.1 Polynomial Functions
Apply polynomial models to real- world situations by fitting data to linear, quadratic, cubic, or quartic models.
Curve Fitting with 3-9 Polynomial Models Warm Up Lesson Presentation
Sections What is a “quadratic” function?
Regression on the Calculator Hit the “STAT” button and then select edit Enter the data into the lists. The independent data goes in L 1 and the dependent.
Splash Screen.
MAT 150 – Algebra Class #11 Topics:
Wednesday Today you need: Whiteboard, Marker, Eraser Calculator 1 page handout.
3 Polynomial and Rational Functions © 2008 Pearson Addison-Wesley. All rights reserved Sections 3.1–3.4.
Entry Task Write the equation in slope intercept form and find the x and y intercepts. 1. 4x + 6y = 12.
1.8 Quadratic Models Speed (in mi/h) Calories burned Ex. 1.
Linear Regression A step-by-step tutorial… Copyright © 2007 College of the Redwoods First edition by Aeron Ives.
Objectives: Be able to identify quadratic functions and graphs Be able to model data with a quadratic functions in the calculator.
Section 1.3 Scatter Plots and Correlation.  Graph a scatter plot and identify the data correlation.  Use a graphing calculator to find the correlation.
2.1 Linear Functions and Models. Graphing Discrete Data We can graph the points and see if they are linear. Enter the data from example 1 into L1 and.
Holt Algebra Linear, Quadratic, and Exponential Models Warm Up Find the slope and y-intercept of the line that passes through (4, 20) and (20, 24).
Tables and graphs taken from Glencoe, Advanced Mathematical Concepts.
Section 6-1 Polynomial Functions. Polynomial Function  P(x) = 2x 3 – 5x 2 –2x+5  This is standard form. The exponent in a term determines the degree.
Wednesday: Need a graphing calculator today. Need a graphing calculator today.
UNIT 8 Regression and Correlation. Correlation Correlation describes the relationship between two variables. EX: How much you study verse how well you.
Over Lesson 4–5 5-Minute Check 1 A.positive B.negative C.no correlation The table shows the average weight for given heights. Does the data have a positive.
Warm Up 1. Solve the world problem given to you group. Also use the discriminant to figure out how many solutions your problem would have. 2. Solve using.
Over Lesson 3-4 5–Minute Check 1 Solve 9 x – 2 = 27 3x. A. B.–1 C. D.
Fitting Exponentials and Polynomials to Data
Splash Screen.
Strong Positive Strong Positive Weak Positive Strong Negative
Questions? Standard. Questions? Standard Questions? Honors.
Exercise 4 Find the value of k such that the line passing through the points (−4, 2k) and (k, −5) has slope −1.
1.3 Modeling with Linear Functions
Polynomial Functions and Models
Using the TI84 Graphing Calculator
Splash Screen.
Sine Waves Part II: Data Analysis.
Sine Waves Part II: Data Analysis.
Learning Objectives for Section 2.3 Quadratic Functions
Which graph best describes your excitement for …..
Presentation transcript:

Supplement: Curve Fitting aka Supplement: Curve Fitting aka . . . Choosing the appropriate model to fit the data Linear Cubic 𝑦=𝑎𝑥+𝑏 𝑦=𝑎 𝑥 3 +𝑏 𝑥 2 +𝑐𝑥+𝑑 Quartic Quadratic 𝑦=𝑎 𝑥 4 +𝑏 𝑥 3 +𝑐 𝑥 2 +𝑑𝑥+𝑒 𝑦=𝑎 𝑥 2 +𝑏𝑥+𝑐

Linear family Domain: ℝ Range: ℝ One y-intercept Positive or negative slope.

Quadratic Family Domain: ℝ Range: depends on vertex Opens up (positive a) or down (negative a)

Cubic Family Domain: ℝ Range: ℝ Increases left to right (positive a) or decreases left to right (negative a)

Quartic Family Domain: ℝ Range: depends on relative maxima/minima Opens up (positive a) or down (negative a)

Curve Fitting: Find the curve of best fit for a given set of data Curve Fitting: Find the curve of best fit for a given set of data. This means finding an equation that models the data closely with the smallest error. There are several options; we will concentrate on the bolded ones in this unit: Linear Quadratic Cubic Quartic Logarithmic Exponential Power Logistic Sinusoidal Parts of this lesson adapted from: www.adventures-in-education.com/Books/Linear and Curve Fitting.htm www.usciences.edu/~lvas/Math101/Poly_Regressions.pdf

Remember Linear Regression? Let’s review it. Height (in) Weight (lbs) 58 120 60 90 62 105 65 66 130 67 124 69 162 134 74 122 76 185 Turn on STAT PLOT 1. Input the data into L1 and L2. ZOOM9:ZoomStat STAT CALC 4:LinReg ENTER VARS Y-VARS 1:Function ENTER FUNCTION 1:Y1 ENTER ENTER If you do not get R and R2 turn DIAGNOSTICS ON. 𝑦=3.45𝑥−100.62

Gas Consumption (gallons) If the data is NOT linear, you need to explore other options. Speed of Car (miles) Gas Consumption (gallons) 20 5.2 30 5.8 40 6.2 50 6.4 60 70 80 Linear 1Y Quadratic 2Y 0.6 0.4 0.2 -0.2 -0.4 -0.2 Use successive differences between the y-values to determine which model fits best. If the first are equal (or closest to each other) then it is linear; if second equal, then quadratic; if third equal, then cubic, etc.

Gas Consumption (gallons) If the data is NOT linear, you need to explore other options. Speed of Car (miles) Gas Consumption (gallons) 20 5.2 30 5.8 40 6.2 50 6.4 60 70 80 Turn on STAT PLOT 1. Input the data into L1 and L2. ZOOM9:ZoomStat STAT CALC 5:QuadReg ENTER VARS Y-VARS 1:Function ENTER FUNCTION 1:Y1 ENTER ENTER 𝑦=−.001 𝑥 2 +0.11𝑥+3.4 𝑟 2 =1 Looking at the graph, it is obvious that the data is not linear!

Sometimes things are not quite clear Sometimes things are not quite clear. What would you choose for this blind data set. Linear 1Y x y 1 -4 2 3 4 5 -2 6 7 8 15 Quadratic 2Y Cubic 3Y Quartic 4Y 4 1 -1 -2 2 3 12 -3 -2 1 5 9 1 3 4 8 2 1 4 The cubic looks the most promising. Or you can try putting the quadratic in Y1, the cubic in Y2, and the quartic in Y3.

Input the data into L1 and L2. ZOOM9:ZoomStat STAT CALC 5:QuadReg ENTER VARS Y-VARS 1:Function ENTER FUNCTION 1:Y1 ENTER ENTER (Record the r2 value.) STAT CALC 6:CubicReg ENTER FUNCTION 2:Y2 ENTER STAT CALC 7:QuartReg ENTER FUNCTION 3:Y3 ENTER Y= (change line types) x y 1 -4 2 3 4 5 -2 6 7 8 15

The data increases then decreases and then increases which more closely resembles a CUBIC polynomial. Therefore, the CUBIC is the more appropriate model with R2=.9910. Also, when you ZoomOut, it is clear that the QUARTIC is not an appropriate model. 𝑦=0.33 𝑥 3 −3.95 𝑥 2 +14.01𝑥−14.64 𝑟 2 =.99

Healthcare costs have been increasing over the years Healthcare costs have been increasing over the years. The following data shows the average cost of healthcare per person from 1976 to 1998. Let x = 0 denote 1970. find a model that fits the data well. Then find the year when the average healthcare cost reached $2800 per person. Input data into L1 and L2. Run quadratic, cubic, and quartic regressions sending equations to Y1, Y2, and Y3 respectively. Record the R2 values. Year $ (per person) 1976 618 1980 860 1987 1324 1993 1865 1998 2256

Let x = 0 denote 1970. Find a model that fits the data well Let x = 0 denote 1970. Find a model that fits the data well. Then find the year when the average healthcare cost reached $2800 per person. Discussion: It is important to examine the graphs while zooming out from the data rather than just comparing R2 values. The R2 indicates how well the curve passes through the data points but does not indicate the correct overall trend or pattern. The cubic model increases the complexity of the equation without changing the value of R2 by much. The quartic model appears accurate since R2=1. However, both the cubic and the quartic start decreasing at a certain point which the data does not indicate. Therefore, the quadratic is the best model to choose. Cubic Quadratic Quartic 𝑦=0.77 𝑥 2 +58.43𝑥+613.70 𝑟 2 =.9988

Clear the cubic and quartic models from Y2 and Y3. Enter 2800 in Y2. Look at the graph. CALC 5:Intersect Enter. At First curve? prompt, select Enter. At Second curve? prompt, select Enter. Use left/right arrows keys to move cursor to best guess of intersection, then select Enter. 27.5 + 1976 = 2003.5 so in the year 2003, the healthcare costs reached $2800 per person. NOTE: Use the up/down arrow keys to select between curves.

Time (days) Population The population in a bacteria culture over 5 days s given in the table below. Find a good model for the data. Estimate the population after 7 days. Time (days) Population 30 1 133 2 214 3 337 4 527 5 819 Input data into L1 and L2. Run quadratic, cubic, and quartic regressions sending equations to Y1, Y2, and Y3 respectively. Record the R2 values. Examine and choose. Answer the question. 𝑦=6.44 𝑥 3 −23.60 𝑥 2 +114.86𝑥+31.23 𝑟 2 =.9999 Discussion: If we are only interested in the first seven days, then all models fit the data closely and we do not need to worry about the overall trend. In this case, the cubic model has a higher R2 value than the quadratic so choose cubic over quadratic. Although the quartic has a slightly higher R2 value than cubic they are almost the same and therefore there is no need to add complexity. The best model is the CUBIC.

Delete the quadratic and quartic models from Y1 and Y3. Enlarge the viewing WINDOW so that you can see the y-value when x=7. Select CALC1:ValueEnter. Type 7 Enter. On day 7 there will be approximately 1886 bacteria.

A company decides to develop a cost equation based on the quantity of the product produced in a day. Find a good model. How much will is cost the company to produce 195 units? How many units can they produce for $800? Quantity Cost ($) 20 642.35 35 766.48 50 858.82 65 928.83 80 1005.32 95 1078.82 110 1140.79 Input data into L1 and L2. Run quadratic, cubic, and quartic regressions sending equations to Y1, Y2, and Y3 respectively. Record the R2 values. Examine and choose. Answer the question. Discussion: The leading coefficients of the cubic (.00033) and the quartic (-.0000098) are so small that they add complexity without adding much to accuracy (very similar R2 values). So . . . Look at the graphs and the data!

Using the quadratic model, when x=195, y=$1287. Discussion: Using the quadratic model, cost starts to decrease after units while the cubic cost continues to increase. So if you want a prediction for up to 195 units, use the quadratic model; for a prediction after 195 units, use the cubic. The quartic is rules out as it drops off rapidly which is unlike the data. Using the quadratic model, when x=195, y=$1287. Using the cubic model, when x=195, y=$1936. Using the quadratic model, when y=$800, x=42 units. Using the cubic model, when y=$800, x=41 units. Cubic Quadratic Quartic 𝑦=.02 𝑥 2 +8.09𝑥+497.61 𝑟 2 =.9979 𝑦=.00033 𝑥 3 −.08 𝑥 2 +11.71𝑥+441.47 𝑟 2 =.9993

Concentration (mg/cc) The table below shows the concentration of a drug in a patient’s bloodstream t hours after it was administered. Find a CUBIC model with a restricted domain 0.5  t  3. When was the concentration 0.1825 mg/cc? Time (hours) Concentration (mg/cc) 0.5 .16 1 .19 1.5 .2 2 2.5 .18 3 .17 Input data into L1 and L2. Run cubic regression and send equation to Y1. Enclose the equation in parentheses and add the restricted domain using two inequalities. Record the R2 value. Answer the question.

.1825 mg/cc at time = 0.8 and 2.4 hours. 𝑟 2 =.9941 Discussion: If we were concerned with overall trend, the increasing nature of a cubic would not be a good model. However, if we are only interested in part of a cubic we can restrict the domain and only concern ourselves with that one section!

After winter break, 3 students came to school sick with the flu After winter break, 3 students came to school sick with the flu. The following table shows the number of students infected with the flu depending on the number of days after the winter break. Find the quadratic and quartic models that fit this data. Which model appears to be a better fit to the data? Using your chosen model, find the day at which the number of infected students reaches the maximum. When will the number of infected students drop to zero? Input data into L1 and L2. Run quadratic and quartic regressions and send equations to Y1 and Y2, respectively. Record the R2 values. Examine and choose. Answer the question. Time (days) # Infected Students 3 5 6 10 14 15 23 20 25 21 30 9

Quartic has significantly higher R2 value. 𝑦=.00013 𝑥 4 −.012 𝑥 3 +.26 𝑥 2 −.39𝑥+2.95 𝑅 2 =.9899 Use CALCMaximum: Maximum number of infected students is 24 on day 19.5. Use CALC  Intersect: Zero infected students on day 33.