• No results found

Chapter 1_2 Linear.pptx

N/A
N/A
Protected

Academic year: 2020

Share "Chapter 1_2 Linear.pptx"

Copied!
74
0
0

Loading.... (view fulltext now)

Full text

(1)

Chapter 1.2

(2)

Chapter 1.2 Linear Models 2

A linear function is a function which graphs as a straight line. A linear function has the

characteristic that

• for every unit change in the input function,

• the output function changes by a constant amount.

(3)

Example:

The Philadelphia Gas Works, PGW, provides natural gas to homes and businesses in the Philadelphia metro area.

This example deals with

residential gas usage and costs. Residences are charged

(4)

Chapter 1.2 Linear Models 4

PGW charges each residential customer a flat fee of $15

monthly.

In addition, residential customers pay $0.45 per each cubic feet

(5)

This relationship is characterized by the following:

• for every unit change in the input variable (usage increases by 1 ft3),

• the output variable changes by a constant amount (cost increases by ).

(6)

Chapter 1.2 Linear Models 6

Since every unit change in the input variable (gas usage)

produces a constant change in the output variable (cost), the

relationship between usage and cost can be modeled as a linear function.

That is, a linear model can be used to describe the relationship between the two variables.

(7)

If f(x) is a linear function of an input variable, x, then a linear model

relating them is given by:

(

)

=

� �

+

 

where:

a represents the slope of the line, and • b is the vertical axis intercept

(8)

Chapter 1.2 Linear Models 8

A linear function has a constant rate of change which is equal to the

numerical value of the slope parameter.

(

)

=

� �

+

 

The quantities a and b in the model

(9)

gas use (ft3) cost ($)

0 15.00

100 60.00

200 105.00

300 150.00

400 195.00

Returning to the gas usage example, the data can be expressed numerically as:

(10)

01p32a Chapter 1.2 Linear Models 10

(11)

How might we find an algebraic

expression for the linear relationship? The slope is calculated by dividing the

rise by the run, being careful regarding signs:

• The rise is the change in output

value (vertical scale of graph) as we move from Point 1 to Point 2.

(12)

Chapter 1.2 Linear Models 12

�����=

(

2

)

(

1

)

2 1

 

When x is the input and f(x) is the output:

In our example

• g, gas use, is the input and

• C(g), cost as a function of gas use, is the output

�����=

(

2

)

(

1

)

2 1

(13)

Arbitrarily selecting two ordered pairs from the table:

(100, 60)

(400, 195)

ris

e

=

$

13

5

(14)

Chapter 1.2 Linear Models 14

The order of assigning (g1, C(g1)) and (g2, C(g2)) is irrelevant as

long as we properly use the slope formula.

�����=

(

2

)

(

1

)

2 1

(15)

Assigning: (g1, C(g1)) = (100, 60)

(g2, C(g2)) = (400, 195)

�����= 19560

400100

$

��3

 

�����=135

300 =

$ 0.45  

��3

 

�����= (2)−�( 1)

2−�1  

(16)

Chapter 1.2 Linear Models 16

Assigning: (g1, C(g1)) = (400, 195)

(g2, C(g2)) = (100, 60)

�����= 60195

100 400

$ ��3

 

�����=135

300=

$0.45  

��3

 

�����= (2)−�( 1)

2−�1  

(17)

Note, the vertical axis intercept, b, is 15. That is, the ordered

(18)

Chapter 1.2 Linear Models 18

a

=

slope

=

$

0.45  

��

3

 

b

=

verticalaxisintercept

=

$

15

(19)

(

)

=

0 .45

+

15

 

Algebraically:

where:

• g is gas usage (ft3)

• C is cost ($)

The constant rate of change is the slope value of  .

(20)

Chapter 1.2 Linear Models 20

The function in the last example had a positive slope. Note that the line rose from left to right. That is, as the input changes by a positive value, so does the

(21)

In general, lines with:

positive slopes rise from left to right, • negative slopes fall from left to right,zero slope are horizontal, and

no slope (undefined) are vertical and are not functions since they fail the

(22)

Chapter 1.2 Linear Models 22

h(x) has a positive slope: • h(x) rises from left to

right, •

lim

h ( )=

 

lim

+

h ( )=+

(23)

r(t) has a negative slope: • r(t) falls from left to

right, • • lim ( )=+   lim + ( )=  

(24)

Chapter 1.2 Linear Models 24

This function has a zero slope: The function is

horizontal and has a constant value equal to the vertical axis intercept, b.

(25)

This graph has no slope: The graph is vertical

and has an equation of the form x = c,

where x is the input variable, and c is a constant.

(26)

Chapter 1.2 Linear Models 26

A word about units:

Any equation must be

dimensionally consistent.

That is, each term in the

equation must be in the same units.

(27)

Returning to the gas cost example:

(

)

=

0 .45

+

15

 

where:

• g in units of ft3

(28)

Chapter 1.2 Linear Models 28

Since g is in ft3, then the slope, , must be in

units of . This is consistent with the definition of slope as . When we calculate slope, we

include the units.

 

Since C is in units of $, then each

term on the right side must be in units of $.

(

)

=

0 .45

+

15

(29)

A model is an equation describing the relationship between input and output data. A well-defined model requires: 1. a mathematical equation

2. a well-described input variable, complete with units,

3. a well-described output variable, complete with units, and

(30)

01p36a Chapter 1.2 Linear Models 30

Example:

where

• t is the time, in years, since

purchase, and • r(t) is the resale

value in dollars r(t) is the resale value of a truck

(31)

Identify the point at which the input is 0. Interpret.

(32)

01p36a Chapter 1.2 Linear Models 32

Identify the point at which the input is 0. Interpret.

When the input

value, t, is 0, r(t) is 12,000. This is the value of a new

(33)

Identify the point at which the output is 0. Interpret.

(34)

01p36a Chapter 1.2 Linear Models 34

Identify the point at which the output is 0. Interpret.

When the output value, r(t), is 0, t is 8. The truck has no resale value after 8 years.

(35)

Identify the vertical axis intercept, b.

(36)

01p36a Chapter 1.2 Linear Models 36

Identify the vertical axis intercept, b.

Graphically, the vertical axis

intercept, b, is 12,000.

(37)
(38)

01p36a Chapter 1.2 Linear Models 38

Identify the slope, a.

(0, 12000), and (8, 0)

Graphically, we know two

(39)

Identify the slope, a. Assigning:

(t1, r(t1)) = (8,0)

(40)

01p36a Chapter 1.2 Linear Models 40

Identify the slope, a.

�����=

(

1

)

−�

(

2

)

1 −�2

 

�����

=

0

12000

8

0

 

 

(41)

The negative slope indicates the truck

depreciates at the constant rate of $1500 per year.

(42)

01p36a Chapter 1.2 Linear Models 42

Note that the slope units are output units

divided by input units.

 

(43)

Write the linear

model associated with these data.

The model is:

(

)

=

��

+

 

where:

(44)

(

)

=

1500

+

12000

 

01p36a Chapter 1.2 Linear Models 44

Write the linear

model associated with these data.

The model is:

0  t  8

Note that every term in the model has units of $.

(45)

Often we are interested in building

models based upon real-world data. A linear model is only considered when a scatterplot of the data indicates the data may be linear.

Consider the following data, available from the US Department of Energy,

relating to Retail Sales of Electricity in the years 2003 through 2008.

(46)

Chapter 1.2 Linear Models 46

year retail electricity

sales

(quadrillion kWh)

2003 1.20

2004 1.23

2005 1.27

2006 1.30

2007 1.33

(47)

A scatterplot of the data indicates they may be linear.

(48)

Chapter 1.2 Linear Models 48

In this course we will be spending a

significant amount of time modeling real-world data. Modeling is the process of fitting a mathematical equation, or

model, to a data set.

Let’s see how we can use the TI-84

calculator to generate a linear model for the electricity data.

(49)

The TI-84 calculator has the ability to display a statistical quantity known as

the coefficient of determination, or R2 .

This quantity provides a quantitative

measure of the quality of fit of a model to the data being modeled.

0 ≤ R2 ≤ 1

(50)

Chapter 1.2 Linear Models 50

The TI-84 can show R2 values for the

following models which we will be using: • linear

• quadratic • cubic

• exponential • natural-log

It does not display it for the following models

• logistic • sine

(51)

To enable printing the R2 value for a

model:

• Select CATALOG (2nd 0), and scroll

down to DIAGNOSTIC ON. • Select ENTER

• Select ENTER again and you should see DONE.

(52)

Chapter 1.2 Linear Models 52

We are now ready to enter the data.

Selecting the STAT key provides options for entering data in Lists.

Select STAT then EDIT then Edit.

You should see the Lists as shown at right.

(53)

If there are data in L1 and/or L2, use the cursor to highlight the list name

(example, L1). Then select CLEAR ENTER to clear the lists.

NOTE: Do NOT use DEL as the delete

(54)

Chapter 1.2 Linear Models 54

The data appear linear. A linear model is therefore appropriate.

(55)

We wish to generate a linear model for the data and save the model as a Y

variable. See that the Y variable where you want to save the model is clear.

(56)

Chapter 1.2 Linear Models 56

Select a Linear Model by selecting

STAT, CALC, and then LinReg(ax+b).

(57)

Depending upon your specific calculator model, your next screen may be one of the following:

1. You may get a screen which includes: Store RegEQ. If so, scroll down next to Store RegEQ and select VARS , Y-VARS, Function, and Y1, or any other Yi where you want to save the equation. Select CALCULATE to execute the command.

2. Or your screen may show a blinking cursor. If so, the calculator is waiting for you to enter a Y variable in which to save the linear model. If you hit ENTER without

supplying a Y variable, the regression parameters will be provided but the equation not saved. Select ENTER to execute the command.

(58)

Chapter 1.2 Linear Models 58 Select ZOOM, ZoomStat, to graph both the scatterplot and the

(59)

The best-fitting model:

1

(

)

0 .031

60.604

 

The symbol “” in the equation indicates the coefficients have been rounded for display purposes.

2

0 .992

(60)

01p39b Chapter 1.2 Linear Models 60

Here the linear model is graphed over the data scatterplot.

(61)

Recall that a linear model has a constant rate of change which is equal to the slope. The slope for the model is 0.031. Thus:

• for every unit increase in the input variable, in this case, one year,

• the increase in the output variable, quadrillion kWh sold, is a constant 0.031.

• That is, the rate of change is a constant

(62)

Chapter 1.2 Linear Models 62

So, for example, over any two year period between 2003 and 2008, the

average electricity sales increased by:

(

2

��

)

(

.031

�����������

��

h

��

)

=

0.062

�����������

��

h

(63)

Or, over any three month period

between 2003 and 2008, the average electricity sales increased by:

(

1

4

��

)(

.031

�����������

��

h

��

)

=

0.0082

�����������

��

h

(64)

Chapter 1.2 Linear Models 64

Note this model is based upon data for the period 2003 through 2008.

Using a model to estimate an output

value for an input value within the input interval over which the model is built is called interpolation.

Using a model to estimate an output

value for an input value outside the input interval over which the model is built is called extrapolation.

(65)

Using the electricity sales model, what were the expected sales at the end of 2005?

Since the model is based upon data from 2003 through 2008, this is an

interpolation.

1

(

2005

)

(

.031

) (

2005

)

60.604

 

1

(

)

0 .031

60.604

(66)

Chapter 1.2 Linear Models 66

Using the electricity sales model, what were the expected sales at the end of 2010?

Since the model is based upon data from 2003 through 2008, this is an

extrapolation.

1

(

)

0 .031

60.604

 

1

(

2010

)

(

.031

) (

2010

)

60.604

 

1

(

2010

)

1.42

(67)

Note that extrapolation calculations

assume the pattern exhibited during the interval of the input data will continue

outside that interval. This is a

(68)

Chapter 1.2 Linear Models 68

When the input to a model is in years, it is often advantageous to renumber the input to reduce the magnitude of the

coefficients in the model. This is a process called data alignment.

Reconsider the electricity sales data if we select the end of the year 2000 to align with an input value of 0.

(69)

year new

input sales (quad kWh)

2003 3 1.20

2004 4 1.23

2005 5 1.27

2006 6 1.30

2007 7 1.33

(70)

Chapter 1.2 Linear Models 70

Using the TI-84 the new best-fitting model is:

2

(

)

0 .031

+

1.110

 

1

(

)

0 .031

60.604

 

Recall the model for the raw (non-aligned) input data:

(71)

We now re-ask: What were the expected sales at the end of 2005?

Since 0 is aligned with the end of the year 2000, then the end of 2005 is

aligned with the new input of 5.

2

(

5

)

(

.031

) (

5

)

+

1.110

 

2

(

5

)

1.26

 

2

(

)

0 .031

+

1.110

(72)

Chapter 1.2 Linear Models 72

Numerical considerations in reporting and calculating results:

• When fitting a function to data, the TI-84 calculates model coefficients to a large number of decimal digits. We can round coefficient results for

display purposes but using rounded coefficients to perform calculations may result in gross inaccuracies.

(73)

Numerical considerations in reporting and calculating results (cont):

• Numerical modeling output should be rounded to the same accuracy as the output data used to create the model. For example, if output units used to

create the model have two decimal digits, then report model results with two decimal digits.

(74)

Chapter 1.2 Linear Models 74

Numerical considerations in reporting and calculating results (cont):

• When performing a series of

operations, only round the final result, not intermediate results.

References

Related documents

The programmes offered are organised such as to make the teaching load compatible with the other demands on the time of the academic staff (research, pedagogic dialogue

Figure 3.7: 16QAM results of EVM VS Received power using Direct Detection In figures 3.6 and 3.7, where direct detection was used, the obtained results were similar to those of

Erythromycin-zinc lotion was more effective and act earlier than erythromycin gel starting from 4 weeks of therapy till the end of treatment (after 10 week) and even after 4

A new customer web- portal will be implemented and this will be a major education tool to help our customers become familiar with online information as it

Specific policies and interventions can enhance supply by increasing the availability and affordability of nutritious foods while also raising incomes of project

Preliminary attachment - is a provisional remedy issued upon order of the court where an action is pending to be levied upon the property of the defendant so the property may

DisabilityCare Australia will give people care and support that is objectively assessed as reasonable over the course of their lifetime, offer early intervention where it

The key segments in the mattress industry in India are; Natural latex foam, Memory foam, PU foam, Inner spring and Rubberized coir.. Natural Latex mattresses are