Exercise 7.5 (p. 343) Consider the hotel occupancy data in Table 6.4 of Chapter 6 (p. 297) t 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 yt 501 488 504 578 545 632 728 725 585 542 480 530 518 489 528 599 572 659 739 758 602 587 497 558 t 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 yt 555 523 532 623 598 683 774 780 609 604 531 592 578 543 565 648 615 697 785 830 645 643 551 606 t 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 yt 585 553 576 665 656 720 826 838 652 661 584 644 623 553 599 657 680 759 878 881 705 684 577 656 t 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 yt 645 593 617 686 679 773 906 934 713 710 600 676 645 602 601 709 706 817 930 983 745 735 620 698 t 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 yt 665 626 649 740 729 824 937 994 781 759 643 728 691 649 656 735 748 837 995 1040 809 793 692 763 t 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 yt 723 655 658 761 768 885 1067 1038 812 790 692 782 758 709 715 788 794 893 1046 1075 812 822 714 802 t 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 yt 748 731 748 827 788 937 1076 1125 840 864 717 813 811 732 745 844 833 935 1110 1124 868 860 762 877 a. Analyze this data using the multiplicative decomposition method in an Excel spreadsheet. The book contains a CD-ROM with the data sets in different data formats. Note! Data are given consecutively in column 1 (not tabled as in Table 6.4 of the book) Add a column with the time variable (month) In column C, add the formulas for calculating CMAt Monthly data Formula can be entered in cells C8:C163 (Row 1 is reserved for column labels) yt 6 2 yt 5 y t 4 y t y t 5 yt 6 CMAt 2 12 Enter the following formula in cell C8 and copy it to cells C9:C163 “=(B2+2*(B3+B4+B5+B6+B7+B8+B9+B10+B11+B12+B13)+B14)/24” Next step: Divide yt with CMAt for t = 7,…,162 (Spreadsheet formula is entered into cells D8:D163) This gives the rough seasonal components (y / CMA) Now we need to estimate the seasonal component, i.e. the 12 seasonal indices Average the rough seasonal components for each calendar month Cell E8 corresponds with calendar month 7, i.e. July Enter the following formula in E8 “=(D8+D20+D32+D44+D56+D68+D80+D92+D104+D116+D128+D140+ D152)/13” Copy the formula to cells E9:E17 (August-April). For the cells E18:E19 (May and June), remove the last term in the sum of the formula and divide by 12. The contents of cells E8:E19 are now close to the seasonal components. Fine adjust them by dividing with their average. In cell F8 enter the following formula =E8/(AVERAGE($E$8:$E$19)) and copy this to the cells F9:F19 Now, the seasonal components shall be “copied” to the rest of the relevant cells in column F. To make it more dynamic (allowing original observations to be changed) use formulas depending on the values calculated in F8:F19 In Cell F2, enter the formula =F14 (as month 1 is the same calendar month as month 13) In cell F3, enter formula =F15 and so on until cell F25 For the cells F26:F37 enter successively formulas =$F$2, =$F$3, =$F$4, =$F$5, =$F$6, =$F$7, =$F$8, =$F$9, =$F$10, =$F$11, =$F$12, =$F$13 The copy and paste these 12 cells further in the column Now, deseasonalize the original observations by dividing them with the corresponding seasonal component In cell G2 enter =B2/F2 , copy and paste into all relevant cells of column G. From deseasonalized data, the trend function can be estimated. If a linear trend is to be found, we simply use columns A and G, if a quadratic trend is to be found a new column with squares of the values in A must be created. Stick to the linear case here. In Excel, open the menu Tools (open it while a cell in the spreadsheet is active, not e.g. a chart) Select the alternative Data Analysis… If that alternative does not exist, select the alternative Add-Ins… and check the box for the Analysis ToolPak add-in, then Data Analysis will appear on the Tools menu. Scroll down to the alternative Regression and select that one. Enter the cells with the deseasonalized data here, i.e. cells G1:G169 (including column label) Enter the cells with the time variable(s) here, in our case cells A1:A169 (including column label) Check this box as labels are present (otherwise you may enter the ranges G2:G169 and A2:A169 in the Input Y and X Ranges above) Enter a cell here that does not interfere with your previously entered columns or your prospectively entered columns (trend column, cyclical component etc.) Preferably: Enter a cell under your data columns, i.e. G171 Click OK, look at cell G171 and below! Standard regression output. What we need here are the contents of cells H187 (intercept) and H188 (slope parameter). Column H should now contain the estimated trend component. In cell H2 enter the formula =$H$187+$H$188*A2 (tr1 = 554.0933 + 2.003414 t ) Copy and paste into all relevant cells in column H Next step is to filter out the combined cyclical and irregular component. This should be stored in column I. (cl ir)t = yt* / trt Enter the formula =G2/H2 in cell I2. Copy and paste into all relevant cells in column I. To separate between the cyclical and the irregular component, moving averages need to be calculated. The moving averages constitute cl and the ratio between (cl ir) and cl constitutes ir Excel has this function among the Data Analysis methods, but it is not consistent with the description in this course. Only 3-point moving averages are centred, the rest are skewed. To make 3-point centred moving averages, enter the following formula into cell J3: =average(I2:I4) Copy and paste into cells J4:J168 (Cell J169 like cell J2 will not have any value) Then enter the formula =I3/J3 into cell K3 , copy and paste into cells K4:K168 to produce ir. To make 5-point centred moving averages, enter the following formula into cell J4: =average(I2:I6) Copy and paste into cells L5:L167, calculate ir (=I4/L4) in cells M4:M167 Etc. In this case, calculate 3-, 5- 7- and 9-point moving averages. To judge upon which of the moving averages that works best, calculate the standard deviation and the serial correlation coefficient for all estimated irregular components. Use e.g. rows 171 and 172 for these outputs. In cell K171 enter the formula =stdev(K2:K169) It doesn’t matter for this calculation that some cells are empty. Excel only calculates with active cells. This formula can therefore be copied to cells M171, O171 and Q171 In cell K172 enter the formula =correl(K2:K168,K3:K169) This calculates the correlation coefficient between the series of ir terms and the onestep lagged series of ir terms. Note that be benefit of that cell K169 is empty. Empty cells are treated as missing values in the Excel calculations. Copy and paste the formula into the cells M172, O172 and Q172. There are more empty cells in these columns, but that does not affect the result. Now we can see that the 3-point moving average gives the lowest standard deviation (0.042967) of the ir terms and the 5-point moving average gives the lowest serial correlation (in absolute value). To help in the decision process, it could be wise to plot (cl ir) together with cl for the two cases (use the “line” chart type in the Chart Wizard)). 3-point 1.3 1.2 1.1 1 cl x ir cl(3) 0.9 0.8 0.7 0.6 1 5-point 13 25 37 49 61 73 85 97 109 121 133 145 157 1.3 1.2 1.1 Gives a smoother impression 1 cl x ir cl(5) 0.9 0.8 0.7 0.6 1 13 25 37 49 61 73 85 97 109 121 133 145 157 b. Use statistical software, such as SAS or MINITAB, to produce point forecasts and 95% prediction intervals for the deseasonalized hotel room averages in each month the 15th year. Copy the column of deseasonalized values (G) together with the time column (A) to the software (here to MINITAB). Perform a regression of deseasonalized values against time and ask for prediction in the 15 added time points. c. Using the values from part (b), compute point and 95% prediction interval forecasts of the hotel room averages in each month of the 15th year. See page 339 in the textbook. The same error bound can be used in the prediction interval for y as those previously used for y* . In the Minitab worksheet, calculate the bounds as the differences between column C6 (PLIM2) and C4 (PFIT1) and the differences between C5 (PLIM1) and C4. Commands that can be used in Session Window if not Calculator is used Now, the forecasts for y (hotel room averages) can be formed by multiplying the forecasted deseasonalized values (in column C4) with the estimated seasonal components from the Excel spreadsheet. Thus copy the first 12 seasonal components to MINITAB and then add the bounds to these forecasts. Forecasts Lower 95% Pred.limits Upper 95% Pred. Limits