Presentation is loading. Please wait.

Presentation is loading. Please wait.

Slide 1 DSCI 5340: Predictive Modeling and Business Forecasting Spring 2013 – Dr. Nick Evangelopoulos Lecture 3: Time Series Regression (Ch. 6) Material.

Similar presentations


Presentation on theme: "Slide 1 DSCI 5340: Predictive Modeling and Business Forecasting Spring 2013 – Dr. Nick Evangelopoulos Lecture 3: Time Series Regression (Ch. 6) Material."— Presentation transcript:

1 slide 1 DSCI 5340: Predictive Modeling and Business Forecasting Spring 2013 – Dr. Nick Evangelopoulos Lecture 3: Time Series Regression (Ch. 6) Material based on: Bowerman-O’Connell-Koehler, Brooks/Cole

2 slide 2 DSCI 5340 FORECASTING Review of Homework in Textbook Ex 4.20 Page 210 Ex 4.21 Page 212 Ex 5.5 Page 266 EX 5.10 Page 268

3 slide 3 DSCI 5340 FORECASTING Insurance Innovation Data Ex 4.20 Page 210 4.20 part a. Since there are two parallel lines – one for Mutual and one for Stock, a dummy variable can show the difference in the intercepts of the models. Y =  0 +  1 X +  2 D S + 

4 slide 4 DSCI 5340 FORECASTING 4.20 part b Y =  0 +  1 X +  2 D S +   a,m =  0 +  1 a +  2 (0) for X = a assets, and m= Mutual type of company (D = 0)  a,s =  0 +  1 a +  2 (1) for X = a assets, and m= Stock type of company (D = 1)  a,m -  a,s =  2  2 is the difference between the mean of number of months pasted (y) for a mutual type of company and a stock type of company.

5 slide 5 DSCI 5340 FORECASTING Since the p-value for  2 is 3.74187E-05, reject H 0 :  2 = 0, and conclude that  2 is not equal to 0. 95% CI for  2 is 4.98 to 11.13, which does not include 0. Type of Firm is a significant variable in predicting Number of months elapsed at both a significance level of 5% and 1%.

6 slide 6 DSCI 5340 FORECASTING Ex 4.20 part d - Interaction Since the data indicate that the lines for the two type of firms are parallel. A p-value of.9821 is less than any reasonable alpha level. So the beta coefficient for xDs cannot be assumed to be nonzero.

7 slide 7 DSCI 5340 FORECASTING Ex 4.21 page 212 a.Y =  0 +  1 D M +  2 D T +  For Bottom Shelf, D M = 0 and D T = 0 which implies:  B =  0 +  1 (0) +  2 (0) =  0. For Middle Shelf, D M = 1 and D T = 0 which implies:  M =  0 +  1 (1) +  2 (0) =  0 +  1. For Top Shelf, D M = 0 and D T = 1 which implies:  T =  0 +  1 (0) +  2 (1) =  0 +  2.  M could be used to represent  1  T could be used to represent  2

8 slide 8 DSCI 5340 FORECASTING Ex 4.21 part b 4.21 part b. Note if  M and  T are equal to zero, then:  B =  0,  M =  0 +  M =  0 +  0, and  T =  0 +  2 =  0 +  0. Thus, H 0 :  M =0 and  T = 0 implies H 0 :  B =  M =  T.

9 slide 9 DSCI 5340 FORECASTING Ex 4.21 part c Since  B =  0,  M =  0 +  M, and  T =  0 +  T, we can solve for  0,  M, and  T. Therefore,  M =  M -  B,  T =  T -  B, and  M -  T =  M -  T. Note that t (.025, df=15) = 2.131 (see table on page 593). 95% CI for  M is 21.4 +/– 2.131*1.433, which is 18.35 to 24.45. 95% CI for  T is -4.30 +/– 2.131*1.433, which is -7.35 to -1.25.

10 slide 10 DSCI 5340 FORECASTING Ex 4.21 part d page 213 Note that the Fit is 77.2 which corresponds to the mean of the Middle Shelf sales. Thus the output at the bottom of the Analysis of Variance is for a 95% CI and 95% PI for mean sales when using a middle display height.

11 slide 11 DSCI 5340 FORECASTING Ex 4.21 part e. Note that in part c, we were not able to get a confidence interval on  M -  T since it was equal to  M -  T. However, if the following model is used: Y =  0 +  1 D B +  2 D M +  then  M -  T is equal to  M since the Top Shelf is now the reference group. Note that t (.025, df=15) = 2.131 (same as before). 95% CI for  M -  T (note equal to  M )is 25.7 +/– 2.131*1.433, which is 22.65 to 28.75.

12 slide 12 DSCI 5340 FORECASTING Page 266 Ex 5.5 - outliers

13 slide 13 DSCI 5340 FORECASTING EX 5.10 part a, Page 268 Y* =  0 +  1 X +  where Y* = ln(Y). Prediction point for 7 desktop computers and 95% PI for Y* is 5.0206 and 4.3402 to 5.7010. Prediction point for 7 desktop computers and 95% PI for Y is exp(5.0206) = 151.5 and exp(4.3402) = 76.72 to exp(5.7010) = 299.166. Note that putting a “.” for Y* in the data with an X = 7 will provide a prediction interval and predicted value for this value in SAS.

14 slide 14 DSCI 5340 FORECASTING EX 5.10 part b, Page 268 There are a couple of small residuals at -.59979. It may be possible to remove one of these residuals at a time or to try adding a square term to the model.

15 slide 15 DSCI 5340 FORECASTING Chapter 6 Polynomial Fits Use higher order terms when curvature exists in graph of y and x. Typically, x is time and square and cubic terms are added to increase the R square. Interactions can also be formed with higher order terms.

16 slide 16 DSCI 5340 FORECASTING Requirements for Fitting a pth-Order Polynomial Regression Model 1. The number of levels of x must be greater than or equal to (p + 1). 2. The sample size n must be greater than (p + 1) to allow sufficient degrees of freedom for estimating F 2.

17 slide 17 DSCI 5340 FORECASTING Count the number of times that a curve changes directions. A polynomial fit would have the highest order term be equal to one minus the number of times the curve changes directions. What degree polynomial would you use here?

18 slide 18 DSCI 5340 FORECASTING The use of a model outside its range is dangerous (although sometimes unavoidable). GNP (y) Inflation Rate (x,%) Extrapolation

19 slide 19 DSCI 5340 FORECASTING Line Tending Upward:  1 > 0 Curve Tending Downward:  1 < 0 Trend and coefficient sign

20 slide 20 DSCI 5340 FORECASTING Holds Water:  2 > 0 Does Not Hold Water:  2 < 0 Curvature and coefficient sign

21 slide 21 DSCI 5340 FORECASTING Curve Tending Upward:  1 < 0 Curve Tending Downward:  1 > 0 Inverse relationship

22 slide 22 DSCI 5340 FORECASTING Curve Tending Upward:  1 < 0 Curve Tending Downward:  1 > 0 Exponential curve

23 slide 23 DSCI 5340 FORECASTING S Curve y = exp(  0 +  1 (1/x) +  )

24 slide 24 DSCI 5340 FORECASTING Line Tending Upward: b 1 > 0 Curve Tending Downward: b 1 < 0 Logarithmic transformation for Y

25 slide 25 DSCI 5340 FORECASTING Curve Tending Upward: b 1 > 0 Curve Tending Downward: b 1 < 0 Logarithmic transformation for X

26 slide 26 DSCI 5340 FORECASTING Examples of autocorrelation in residuals

27 slide 27 DSCI 5340 FORECASTING Detecting Autocorrelation

28 slide 28 DSCI 5340 FORECASTING Detecting Positive Autocorrelation

29 slide 29 DSCI 5340 FORECASTING Detecting Negative Autocorrelation

30 slide 30 DSCI 5340 FORECASTING Rules of thumb for DW If DW is close to 2 then there is no autocorrelation. If DW is close to 0 then there is positive autocorrelation. If DW is close to 4 then there is negative autocorrelation.

31 slide 31 DSCI 5340 FORECASTING Modeling Seasonal Factor with Dummy Variables

32 slide 32 DSCI 5340 FORECASTING Trigonometric Models Model two is for increasing variation cyclically.

33 slide 33 DSCI 5340 FORECASTING Autoregressive errors Use Proc ARIMA for a First Order Autoregressive Process for the Error Term

34 slide 34 DSCI 5340 FORECASTING Prediction Intervals for Autoregressive Models

35 slide 35 DSCI 5340 FORECASTING Page 318 Ex 6.3 Page 318 Ex 6.4 Homework in Textbook


Download ppt "Slide 1 DSCI 5340: Predictive Modeling and Business Forecasting Spring 2013 – Dr. Nick Evangelopoulos Lecture 3: Time Series Regression (Ch. 6) Material."

Similar presentations


Ads by Google