polynomial regression section 4.1.3. starter 4.1.3 johnny’s pizza shack sells pizzas in seven...

Post on 20-Jan-2016

215 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Polynomial Regression

Section 4.1.3

Starter 4.1.3

• Johnny’s Pizza Shack sells pizzas in seven different sizes. The diameters and costs are shown in the table.

• Use regression analysis, including residual plots, to argue whether these data are linear, exponential, or neither.

Diameter (in) 5 7 9 12 15 18 24

Cost ($) 1.00 1.50 2.75 4.25 7.00 10.00 16.00

Objectives

• Convert polynomial data to linear data by use of logarithm principles

• Perform linear regression on linearized data

• Evaluate linear fit by using a residual plot

• Convert linear results to a polynomial function that models the original data

Starter Continued• Consider a polynomial function of the form

y=axb

• The shape of the graph is controlled by b– If b = 2 the function is a quadratic– If b = 3 the function is a cubic, etc.

• The growth of y is controlled by a– Last year we discussed this as vertical stretch

or shrink

Linearizing Polynomial Data• For the function y=axb, start by taking logs of

both sides– log y = log (axb)– log y = log a + log xb product rule– log y = log a + b log x power rule

• Now define A = log a• Then we have a linear function:

– log y = A + b log x (where A and b are unknown)

• Note that in this case we have the linear association between log y and log x instead of just plain x

Starter Concluded• You already have the x values in L1 and the y

values in L2 and the log y values in L3

• Now paste the logs of the x values into L4

• Perform linear regression on L4 and L3

– Note the order: L4 has log x and comes first– Check the residual plot to see if this is a good model

• It does not matter whether you use x or log x. Why?

• Note the intercept and slope values you get– These are A and b as previously defined– Find a by evaluating 10A as before– You already found b: No conversion is needed

• Look at the equation again to see why: log y = A + b log x

The Pizza Model• You should have found A = -1.317

– Calculate “little a”– So a = 10A = .048

• You should have found b = 1.829– So b = 1.829 (No conversion needed)

• Now write the polynomial model into Y2 and draw the graph on top of the scatterplot of the data– The equation is y = .048 x1.829

– If you did it right, they should match

Why are the data polynomial?• Notice that the exponent was close to 2

– So the function is roughly quadratic.– In other words, price varies as the square of diameter.

• Why would you expect this association?– Price should depend on area because larger area

needs more ingredients.

• But area varies as the square of radius.– So price should also vary as the square of radius and

diameter is just radius / 2.

• Conclusion: For area problems, expect a quadratic association between explanatory and response variables.

Objectives

• Convert polynomial data to linear data by use of logarithm principles

• Perform linear regression on linearized data

• Evaluate linear fit by using a residual plot

• Convert linear results to a polynomial function that models the original data

Homework

• Read pages 190 – 195

• Do Example 4.3 (NOT problem 4.3 !!!)

top related