18
Mathematical Modeling Making Predictions with Data

Mathematical Modeling Making Predictions with Data

Embed Size (px)

Citation preview

Page 1: Mathematical Modeling Making Predictions with Data

Mathematical Modeling

Making Predictions with Data

Page 2: Mathematical Modeling Making Predictions with Data

1 2 3 4 5 6 7 8 9 100

10

20

30

40

50

time, t (s)

Dis

tan

ce,

d (

ft)

Function

A rule that takes an input, transforms it, and produces a unique output• Can be represented by

– a table that maps an input to an output– a graph– an equation involving two variables

• Domain – the set of inputs• Range – the set of outputs

t d

2 13

3 18

5 28

8 43

10 53

y = 5t + 3

t ≥ 0d ≥ 3

Page 3: Mathematical Modeling Making Predictions with Data

Linear FunctionA function that demonstrates a constant rate of change between two quantities • Can be represented by a line on a coordinate

grid• Can be represented by a linear equation

involving two variables

0 1 2 3 4 5 6 70

5

10

15

20

25

30

Number of items, n

Co

st (

$) y = 4.5 x

• Can represent real-life situations Distance traveled over time Cost based on number of

items purchased

Page 4: Mathematical Modeling Making Predictions with Data

Linear Equation

A linear function can be expressed by a linear equation• An equation involving two variables

Independent variable, x Horizontal axis

Dependent variable, y Vertical axis

0 5 10 150

10

20

30

40

50

60f(x) = 5 x + 3

x

y

0 5 10 150

102030405060

Distance

Time, t (s)

Do

ista

nc

e, d

(ft

)• Variables can

represent any two related quantities

Page 5: Mathematical Modeling Making Predictions with Data

• Data is often collected in tables

• Data is graphed on a coordinate plane as ordered pairs

Linear Equation

1 2 3 4 5 60

5

10

15

20

25

30

time, t (s)d

ista

nce

, d

(ft

)

d t2 133 185 288 43

10 53

2 13

(2, 13)

(3, 18)

(5, 28)

Page 6: Mathematical Modeling Making Predictions with Data

Linear Equation

• A line can be drawn through data points– Line-of-best-fit– Trendline

• Slope intercept form y = mx + b

m = slope = = b = y-intercept

1 2 3 4 5 60

5

10

15

20

25

30

Time, t (s)

Dis

tan

ce,

d (

ft)

y = 5x + 35 3

5

1 =

=

Page 7: Mathematical Modeling Making Predictions with Data

Function Notation

• Functions often denoted by letters such as F, f, G, w, V, etc.

• G(t) represents the output value of G at the input number t Garbage production over time

0 5 10 15 20 25 30 35 400

200

400

600

800

1000

1200

f(x) = 20.0511904761905 x + 427.916666666667R² = 0.993625638829868

Garbage Production

Year (t=0 represents 1970)Ga

rba

ge

Pro

du

ce

d p

er

da

y (

ton

s)

t is a member of the Domain t ≥ 0

G(t) is a member of the Range G(t) ≥ 427.92 tons

slope m = 20.05 tons/year Garbage production increases

by 20.05 tons/year

Page 8: Mathematical Modeling Making Predictions with Data

Function Notation• Example: d(t) = 5t +3

Slope, m = 5 ft/s The toy car moves 5 feet for every second of time

y-intercept, b = 3 ft The toy car is initially 3 feet from the line at time t = 0

What is the distance at t = 6 s d(6) = 5 · (6) + 3 = 33 ft

1 2 3 4 5 6 7 8 9 100

10

20

30

40

50 f(x) = 5 x + 3

time, t (s)

dis

tan

ce,

d (

ft)

When will the object be 23 feet from the line? d(t) = 23 = 5t +3, t = 4

Page 9: Mathematical Modeling Making Predictions with Data

Correlation Coefficient, r

• Measure of strength of a linear relation -1 ≤ r ≤ 1

r = ±1 is a perfect correlation r = 0 indicates no correlation

• Positive r indicates a direct relationship As one variable increases, so does the other

• Negative r indicates an inverse relationship As one variable increases, the other decreases

• Strength of relationship r > 0.8 is a strong correlation r < 0.5 is a weak correlation

Page 10: Mathematical Modeling Making Predictions with Data

Coefficient of Determination, r2

• Measure of how well the line represents the data 0 ≤ r2 ≤ 1

• Portion of the variance of one variable that is predictable from the other Example: r2 = 0.65, 65% of variation in y is due to x.

The other 35% is due to other variable(s).

• Square of the Correlation Coefficient

Page 11: Mathematical Modeling Making Predictions with Data

Finding Trendlines with Excel

• Create table of data• Common practice to re-label

years starting with n = 1

• Select data

Fiscal Year Sales (millions $)

03 2.35

04 2.22

05 2.34

06 2.54

07 2.55

08 2.75

09 3.11

10 3.24

11 3.15

Fiscal YearYear

2003 = 1Sales

(millions $)

2003 1 2.35

2004 2 2.22

2005 3 2.34

2006 4 2.54

2007 5 2.55

2008 6 2.75

2009 7 3.11

2010 8 3.24

2011 9 3.15

Page 12: Mathematical Modeling Making Predictions with Data

Finding Trendlines with Excel

• Insert Scatterplot

Page 13: Mathematical Modeling Making Predictions with Data

Finding Trendlines with Excel

• Format the Scatterplot• Select the scatterplot

• Choose the Layout tab • Chart Title• Axis Titles• Gridlines• Legend (delete)

Page 14: Mathematical Modeling Making Predictions with Data

Finding Trendlines with Excel

• Format the Scatterplot• Select the scatterplot• Under Chart Tools

• Choose Format tab• Select Horizontal (Value) Axis in drop down menu

• Choose Format selection• Adjust the axis options

• Select Vertical (Value) Axis• Choose Format selection• Adjust the axis options

Note that the horizontal axis was formatted to show several years in the future.

Page 15: Mathematical Modeling Making Predictions with Data

Finding Trendlines with Excel

• Add Trendline• Select the scatterplot• Under Chart Tools

• Choose Layout tab• In the Analysis panel

• Choose Linear Trendline• Select Trendline (either within

chart or in Current Selection panel)

• Forecast• Display Equation• Display R-squared value

Page 16: Mathematical Modeling Making Predictions with Data

Making Predictions

• Use the trendline to make predictions– Function notation

S(t) = 0.1335t+2.0269

where S(t) = projected sales

t = year number (t = calendar year - 2002)

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 200

1

2

3

4

5

f(x) = 0.1335 x + 2.02694444444444R² = 0.894824364028563

Sales Forecast

Year, t (where t = 0 represents 2002)

Sal

es (

mil

lio

n $

)

Page 17: Mathematical Modeling Making Predictions with Data

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 200

1

2

3

4

5

f(x) = 0.1335 x + 2.02694444444444R² = 0.894824364028563

Sales Forecast

Year, t (where t = 0 represents 2002)

Sal

es (

mil

lio

n $

)

Making Predictions

• Use the trendline to make predictions– What is the sales projection for 2015?

t = 2015 – 2002 = 13

S(13) = 0.1335(13)+2.0269 = $3.76 million

2015

2003

r2 = 0.89r =

Page 18: Mathematical Modeling Making Predictions with Data

• Use the trendline to make predictions– When will the sales reach $4 million?

S(t) = 0.1335t+ 2.0269

4 = 0.1335t + 2.0269

0.1335t = 4 – 2.0269

t =

Say t = 15t = calendar year – 2002

15 = calendar year – 2002

Calendar year = 15 + 2002

Calendar year = 2017 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 200

1

2

3

4

5

f(x) = 0.1335 x + 2.02694444444444R² = 0.894824364028563

Sales Forecast

Year, t (where t = 0 represents 2002)

Sal

es (

mil

lio

n $

)

Making Predictions

2017

2003

1.9731

2002