Date post: | 05-Apr-2018 |
Category: |
Documents |
Upload: | williamsa01 |
View: | 221 times |
Download: | 0 times |
of 19
7/31/2019 Time Series Analysis With Minitab13
1/19
Chapter 13
Time Series Forecasting
Topics to be covered in this chapter:
Time Series Plot
Trend Analysis
Seasonal Patterns
Decomposition
Autocorrelation
Moving Average Models
Exponential Smoothing Models
Time Series Plot
Example 13.1 of PBS discusses monthly retail sales of General Merchandise Stores beginning January1992 and ending May 2002 (125 months). The data are provided in EG13_001.MTW. Minitab can be
used to plot the monthly retail sales by selecting
Stat h Time Series h Time Series Plot
from the menu. This command plots measurement data on the y-axis versus time data on the x-axis.Minitab assumes that the y-axis data occurred in the order that the values appear in the column, inequally spaced time intervals. If the data did not occur that way, you may want to use
Graph h Plot
to plot they-axis data versus a date/time column on thex-axis.
In the dialog box, Graph variables defines the variables to be used in each graph. Under Y en-
ter a column containing the observations on the graph. Thex-axis is automatically the time axis. Thex-axis time scales can be labeled with values from a date/time column, called a date/time stamp, or withtime units chosen in the dialog box: index units, calendar units, or clock units.
203
7/31/2019 Time Series Analysis With Minitab13
2/19
204 Chapter 13
Click on the Annotation button to add a title to the plot. You can also change the default starttime, suppress time unit scales, or tell Minitab to use a different time interval by clicking on the Optionsbutton. For each time unit axis shown in the Options sub-dialog box, check the box to show the timescale, or uncheck the box to suppress the axis. This is useful for getting rid of cluttered axes. For theretail sales data, we uncheck the box to suppress the month axis:
7/31/2019 Time Series Analysis With Minitab13
3/19
Time Series Forecasting 205
Since January 1992, overall sales have gradually increased and a distinct pattern repeats itself
approximately every 12 months.
Trend Analysis
Example 13.2 of PBS discusses monthly retail sales of General Merchandise Stores beginning January1992 and ending May 2002 (125 months). The pattern of increasing growth in the time series plot ofthe retail sales data is an example of a linear trend. Minitab can be used to estimate the linear trend.Select
Stat h Time Series h Trend Analysis
from the menu. This command fits a general trend model to time series data and provides forecasts.
You can choose among linear, quadratic, exponential, and S-curve models. To forecast future sales,check Generate forecasts and enter a number in Number of forecasts. In the Starting from origin box,enter a positive integer to specify a starting point for the forecasts. If you leave this space blank, Mini-
7/31/2019 Time Series Analysis With Minitab13
4/19
206 Chapter 13
tab generates forecasts from the end of the data. For the retail sales data, we enter Sales as the Variableand under Model Type, choose Linear. Minitab estimates the linear trend to be
Yt= 18736.5 + 145.53 t
where tis the number of months elapsed beginning with the first month of the time series.
Trend Analysis
Data Sales
Length 125.000
NMissing 0
Fitted Trend Equation
Yt = 18736.5 + 145.531*t
Accuracy Measures
MAPE: 12.4750
MAD: 3756.77
MSD: 36632916
The trend analysis includes a graphic display plot as shown below. To turn the graphics display on (oroff), click on the Results button in the trend analysis dialog box.
We can also use regression techniques to fit a linear model to the above data. This gives additional out-put, such as the value for the model. First, select2R
Calc hMake Patterned Data h Simple Set of Numbers
from the menu to create a variable x (or t), wherex is the number of months elapsed, beginningwith the first month of the time series. That is,x = 1 corresponds to January 1992,x = 2 corresponds toFebruary 1992, etc. Next, select
7/31/2019 Time Series Analysis With Minitab13
5/19
Time Series Forecasting 207
Stat h Regression h Regression
from the menu. Enter Sales as the response variable andx as the predictor variable and click OK.
Regression Analysis: Sales versus x
The regression equation is
Sales = 18736 + 146 x
Predictor Coef SE Coef T P
Constant 18736 1098 17.06 0.000
x 145.53 15.12 9.62 0.000
S = 6102 R-Sq = 42.9% R-Sq(adj) = 42.5%
Analysis of Variance
Source DF SS MS F P
Regression 1 3446933715 3446933715 92.59 0.000
Residual Error 123 4579114499 37228573
Total 124 8026048215
The trend-only model ignores the seasonal variation in the retail sales time series. Notice that thevalue for the trend-only model is 42.9% or 0.429.
2R
Case 13.1 of PBS discusses the sales of DVD players since the introduction of the DVD format
in March 1997. At the end of June 2002, nearly 33 million DVD players had been sold in the U.S. withover 18,000 titles available in the DVD format. The Consumers Electronic Association tracks monthly
sales of DVD players. The data are provided in CA13_001.MTW. Select Stat h Time Series h TimeSeries Plot from the menu to plot the DVD sales data.
The pattern of increasing growth in this plot is an example of an exponential trend. Minitab
can be used to estimate the exponential trend. Select Stat h Time Series h Trend Analysis from themenu. In the dialog box, enter Sales as the Variable. Under Model Type, choose Exponential growth.
As shown in the trend analysis, Minitab estimates the exponential trend to be
)07137.1(6.29523t
tY =
7/31/2019 Time Series Analysis With Minitab13
6/19
208 Chapter 13
where t is the number of months elapsed, beginning with the first month of the time series. Since1.07137 is equal to e
0.06894, this is equivalent to the model given in Case 13.1 of PBS.
Trend Analysis
Data SalesLength 63.0000
NMissing 0
Fitted Trend Equation
Yt = 29523.6*(1.07137**t)
Accuracy Measures
MAPE: 40.6388
MAD: 224482
MSD: 129023909665
The graphic display plot illustrates the exponential growth together with the raw data.
Seasonal Patterns
A trend equation may be a good description of the long run behavior of the data, but we need to accountfor short run phenomena like seasonal variation to improve the accuracy of our forecasts. As in Exam-ple 13.3 of PBS, we can use indicator variables to add the seasonal pattern to the trend model for the
monthly retail sales data. First, select Calc h Make Patterned Data h Simple Set of Numbers fromthe menu to create a new variable Month that takes the value 1 for each January, 2 for each February,. and 12 for each December in the data set. Next select
Calc hMake Indicator Variables
from the menu. In the dialog box, enter Month under Indicator variables for, and specify 12 new col-umns in the Store results in textbox. This will create 12 indicator variables, one for each month. Name
the indicator variables X1, X2,,X12. Select Stat h Regression h Regression from the menu and
7/31/2019 Time Series Analysis With Minitab13
7/19
Time Series Forecasting 209
enter Sales as the response variable. Enterx and all 12 indicator variables as the predictor variables andclick OK. (Recall that we defined the variable x in the previous section as the number of monthselapsed beginning with the first month of the time series). We get the following output from Minitab:
Regression Analysis: Sales versus x, X1, ...
* X12 is highly correlated with other X variables
* X12 has been removed from the equation
The regression equation is
Sales = 37473 + 140 x - 24276 X1 - 23749 X2 - 20271 X3 - 20250 X4 - 18518 X5
- 19575 X6 - 20324 X7 - 18627 X8 - 20878 X9 - 18933 X10 - 13842 X11
Predictor Coef SE Coef T P
Constant 37472.7 343.4 109.14 0.000
x 140.130 2.393 58.57 0.000
X1 -24276.2 421.4 -57.61 0.000
X2 -23748.7 421.4 -56.36 0.000
X3 -20271.2 421.3 -48.11 0.000
X4 -20250.5 421.3 -48.07 0.000X5 -18518.0 421.3 -43.96 0.000
X6 -19574.5 431.4 -45.37 0.000
X7 -20323.6 431.3 -47.12 0.000
X8 -18626.9 431.3 -43.19 0.000
X9 -20878.1 431.2 -48.42 0.000
X10 -18933.0 431.2 -43.91 0.000
X11 -13842.2 431.2 -32.10 0.000
S = 964.1 R-Sq = 98.7% R-Sq(adj) = 98.6%
Analysis of Variance
Source DF SS MS F P
Regression 12 7921942577 660161881 710.22 0.000
Residual Error 112 104105638 929515
Total 124 8026048215
Minitab automatically removes the last indicator variable from the equation because it is highly
correlated with the first 11 indicator variables. The value for the trend-and-season model is 98.7%
which is a dramatic improvement over the trend-only model. Recall that the value for the trend-only model was 42.9%.
2R2R
Decomposition
Another approach to accounting for seasonal variation is to calculate an adjustment factor for each sea-son. The trend is adjusted each particular season by multiplying it by the appropriate seasonality factor.Using seasonality factors views the model as a trend component times a seasonal component.
Y = TREND SEASONExample 13.4 of PBS calculates the seasonality factors for the retail sales data. Minitab can be used tocalculate seasonality factors by selecting
Stat h Time Series h Decomposition
from the menu. You can use decomposition to separate the time series into linear trend and seasonalcomponents. You can choose whether the seasonal component is additive or multiplicative with thetrend.
7/31/2019 Time Series Analysis With Minitab13
8/19
210 Chapter 13
In the dialog box, enter the column containing the time series under Variable, and a positive in-teger as the Seasonal length. Since the retail sales data is monthly data, we use a seasonal length of 12.Under Model Type choose Multiplicative, and under Model Components choose Seasonal only. Bydefault the first observation is in seasonal period one because Minitab assumes that the first data valuein the series corresponds to the first seasonal period. Enter a different number to specify a differentstarting value. Check Generate forecasts if you want to generate forecasts.
Minitab calculates the following seasonality factors for the retail sales data:
Time Series Decomposition
Data Sales(NSA)
Length 125.000
NMissing 0
Seasonal Indices
Period Index
1 0.781569
2 0.805703
3 0.919066
4 0.930090
5 0.988080
6 0.958632
7 0.931024
8 0.984559
9 0.910419
10 0.982894
11 1.15661
12 1.65135
These seasonal indices (or seasonality factors) differ slightly from the indices in Example 13.4 of PBS.This is because in Minitab the data is smoothed before the seasonal indices are found.
7/31/2019 Time Series Analysis With Minitab13
9/19
Time Series Forecasting 211
Autocorrelation
The residuals from a regression model that uses time as an explanatory variable should be examined forsigns of autocorrelation. Examples 13.7 and 13.8 of PBS examine the residuals that result from fitting
an exponential trend to the DVD player sales data. The data are provided in CA13_001.MTW. First,select Calc h Calculator from the menu and calculate loge(Sales). Name this column lnSales. Next,
select Stat h Regression h Regression from the menu and regress lnSales on the predictor variablex,wherex is the number of months elapsed beginning with the first month of the time series. In the dialogbox, click on the Storage button and check Residuals to obtain the residuals from the exponential trend
model. Finally, select Graph h Plot from the menu and plot the residuals versus x, i.e., in time order.
The pattern in the plot indicates positive autocorrelation among the residuals. An alternative plot for
detecting autocorrelation is a lagged residual plot. Select
Stat h Time Series h Lag
from the menu. In the dialog box, enter the column containing the variable that you want to lag underSeries. Under Store lags in, select the storage column for the lags and then specify the value for the lag.To lag the residuals of the DVD Sales data, specify a lag of one and name the output column lag_RES.
7/31/2019 Time Series Analysis With Minitab13
10/19
212 Chapter 13
Since the lag selected is one, Minitab moves the row elements of a column down one row. There willbe one missing value symbol (*) at the top of the output column. The output column has the samenumber of rows as the input column, so the last value from the input column is not lagged.
Next, select Graph h Plot from the menu and plot the residuals versus the lagged residuals. The graphon the following page shows a linear pattern with positive slope. This indicates that the residuals may
have positive autocorrelation.
7/31/2019 Time Series Analysis With Minitab13
11/19
Time Series Forecasting 213
Minitab can be used to calculate the autocorrelation for the lagged residuals lagged. Select
Stat h Time Series h Autocorrelation
from the menu. In the dialog box, enter the column containing the residuals under Series. Specify oneas the number of lags to use instead of the default and check Nongraphical ACF.
Minitab calculates the autocorrelation to be 0.614.
Autocorrelation Function: RESI1
ACF of RESI1
-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0
+----+----+----+----+----+----+----+----+----+----+
1 0.614 XXXXXXXXXXXXXXXX
7/31/2019 Time Series Analysis With Minitab13
12/19
214 Chapter 13
Moving Average Models
Moving average models use the average of the last several values of the time series to forecast the nextvalue. Example 13.12 of PBS calculates moving averages for quarterly JCPenny sales data with the
moving average forecast model based on a span ofk= 4. The data are available in TA13_001.MTW.Select
Stat h Time Series hMoving Average
from the menu. In the dialog box, enter the column containing the sales data under Variable. In theMoving Average (MA) length box, enter the span k= 4. Check Generate forecasts and enter one forNumber of forecasts.
Minitab calculates the forecasted value for the first quarter of 2002 and generates a time series plot.
Moving average
Data Sales
Length 24.0000
NMissing 0
Moving Average
Length: 4
Accuracy Measures
MAPE: 10MAD: 809
MSD: 1072724
Row Period Forecast Lower Upper
1 25 8001 5970.98 10031.0
7/31/2019 Time Series Analysis With Minitab13
13/19
Time Series Forecasting 215
Actual
Predicted
Forecast
Actual
Predicted
Forecast
0 5 10 15 20 25
4200
5200
6200
7200
8200
9200
10200
Sales
Time
Moving Average
4
10
809
72724
Moving Average
.5.0=w
Length:
MAPE:
MAD:
MSD: 10
Exponential Smoothing Models
Example 13.15 of PBS uses an exponential smoothing model to forecast monthly returns on PhilipMorris stock. The data are available in TA01_010.MTW. In this example, we use the smoothing con-stant Select
Stat h Time Series h Single Exp Smoothing
from the menu. In the dialog box, enter the column containing the time series under Variable. UnderWeight to Use in Smoothing, choose Use to enter a specific weight, then type 0.5 in the text box.
7/31/2019 Time Series Analysis With Minitab13
14/19
216 Chapter 13
With the Use option, Minitab uses the average of the first six observations for the initial smoothed valueby default. You can change this default by specifying a different value in the Single ExponentialSmoothing - Options sub-dialog box.
Minitab forecasts a 0.1939% return for Philip Morris stock in August 2001.
Single Exponential Smoothing
** Note ** Zero values of Yt exist; MAPE calculated only for non-zero Yt
Data Percent retu
Length 134.000
NMissing 0
Smoothing Constant
Alpha: 0.5
Accuracy MeasuresMAPE: 226.740
MAD: 7.288
MSD: 81.604
Row Period Forecast Lower Upper
1 135 0.193989 -17.6624 18.0504
7/31/2019 Time Series Analysis With Minitab13
15/19
Time Series Forecasting 217
100500
Actual
Predicted
Forecast
Actual
Predicted
Forecast
20
0
-20
Percentretu
Time
MSD:
MAD:
MAPE:
Alpha:
Smoothing Constant
81.604
7.288
226.740
0.500
Single Exponential Smoothing
To calculate all past forecasts as shown in Example 13.15 of PBS, click on the storage button and selectFits (one-period-ahead-forecasts).
7/31/2019 Time Series Analysis With Minitab13
16/19
218 Chapter 13
EXERCISES
13.1 Table 13.1 of PBS and TA13_001.MTW contain retail sales for JCPenney in millions of dol-lars. The data are quarterly beginning with the first quarter of 1996 and ending with the fourthquarter of 2001.
(a) Before plotting these data, inspect the values in the table. Do you see any interestingfeatures of JCPenney quarterly sales?
(b) Now, select Stat h Time Series h Time Series Plot from the menu to make a timeplot of the data. Be sure to connect the points in your plot to highlight patterns.
(c) Is there an obvious trend in JCPenney quarterly sales? If so, is the trend positive ornegative?
(d) Is there an obvious repeating pattern in the data? If so, clearly describe the repeatingpattern.
13.3 In Exercise 13.1, you took a first look at the data in Table 13.1 of PBS and TA13_001.MTW.Use Minitab to further investigate the JCPenney sales data.
(a) Select Stat h Regression h Regression from the menu and find the least-squares linefor the sales data. Use as the values for the explanatory variable with X = 1
corresponding to the first quarter of 1996, X = 2 corresponding to the second quarter of1996, etc.
K,3,2,1
(b) The intercept is a prediction of sales for what quarter?
(c) Interpret the slope in the context of JCPenney quarterly sales.
(d) Using the equation of least-squares line, forecast sales for the first quarter of 2002 andfor the fourth quarter of 2002.
(e) Which forecast in part (d) do you believe will be more accurate when compared to ac-tual JCPenney sales? Why?
13.4 Table 13.2 of PBS and TA13_002.MTW display the time series of number of Macintosh com-puters shipped in each of eight consecutive fiscal quarters. Select Stat h Time Series h TimeSeries Plot from the menu to make a time plot of the data. With only eight quarters, a strong
quarterly pattern is hard to detect. Select Stat h Regression h Regression from the menu andcalculate the least-squares regression line for predicting the number of Macs shipped (in thou-
sands of units). The explanatory variable Time simply takes on the values 1 in time
order. Next, add indicator variables for first, second, and third quarters to the linear trend
model. Call these indicator variables X1, X2, and X3, respectively. Select Stat h Regression
h Regression from the menu to fit this multiple regression model.
8,,3,2, K
(a) Write down the estimated trend-and-season model.
(b) Explain why no indicator variable is needed for fourth quarters.
(c) What does the ANOVA Ftest indicate about this model?
13.5 In Exercise 13.1, you made a time plot of the JCPenney sales data in Table 13.1 of PBS andTA13_001.MTW. Sales seem to follow a pattern of ups and downs that repeats every fourquarters. Add indicator variables for first, second, and third quarters to the linear trend model.
Call these indicator variables X1, X2, and X3, respectively. Select Stat h Regression h Re-gression from the menu to fit this multiple regression model.
(a) Write down the estimated trend-and-season model.
(b) Explain why no indicator variable is needed for fourth quarters.
7/31/2019 Time Series Analysis With Minitab13
17/19
Time Series Forecasting 218a
(c) Does the intercept still predict sales for a specific quarter? If so, what quarter? Com-pare the estimated intercept of this model with that of the trend-only model. Given thepattern of seasonal variation, which appears to be the better estimate?
(d) Using the equation of the trend-and-season model, forecast sales for the first quarter of
2002 and for the fourth quarter of 2002.(e) Compare your forecasts to the same forecasts based on the trend-only model of Exer-
cise 13.3.
13.6 In Exercise 13.4, you fit a linear trend-only model to the Macs shipped time series inTA13_002.MTW. Starting with this trend-only model, incorporate seasonality factors for eachquarter.
(a) Select Stat h Time Series h Decomposition from the menu to calculate the seasonal-ity factor for each quarter. Since the data is quarterly data, use a seasonal length of 4 inthe dialog box.
(b) Average the four seasonality factors. Is this average close to one? If so, interpret theseasonality factor for first quarters.
(c) Select Graph h Plot from the menu and make a scatterplot of seasonality factor versusquarter. Connect the points to see the general pattern of seasonal variation. Also, drawa horizontal line at the average of the four seasonality factors.
13.7 In Exercise 13.3, you fit a linear trend-only model to the JCPenney sales data. Starting withthis trend model, we want to incorporate seasonality factors to account for the pattern that re-peats every four quarters.
(a) Select Stat h Time Series h Decomposition from the menu to calculate the seasonal-ity factor for each quarter. Since the data is quarterly data, use a seasonal length of 4 inthe dialog box.
(b) Average the four seasonality factors. Is this average close to one? If so, interpret theseasonality factor for fourth quarters.
(c) Select Graph h Plot from the menu and make a scatterplot of seasonality factor versusquarter. Connect the points to see the general pattern of seasonal variation. Also, drawa horizontal line at the average of the four seasonality factors.
(d) Using the linear trend-only model and the seasonality factors, forecast sales for the firstquarter of 2002 and for the fourth quarter of 2002.
(e) Compare your forecasts to the same forecasts based on the trend-only model of Exer-cise 13.3.
(f) Compare your forecasts to the same forecasts based on the trend-and-season model ofExercise 13.5.
13.16 Select Stat h Time Series h Decomposition from the menu to calculate the seasonality factor
for each quarterfor the JCPenney sales data. (Since the data is quarterly data, use a seasonallength of four).
(a) In the dialog box, click on the Storage button and check Seasonally adjusted data tocalculate the seasonally adjusted JCPenney sales time series.
(b) Select Stat h Time Series h Time Series Plot from the menu to make a time plot ofthe original sales data with the seasonally-adjusted sales data superimposed. In the dia-log box, fill in two rows as the Graph variables: the original time series and the season-ally adjusted time series. Click on the Frame button and choose Multiple Graphs. In thesub-dialog box, choose Overlay graphs on the same page and click OK.
7/31/2019 Time Series Analysis With Minitab13
18/19
218b Chapter 13
(c) Did seasonally-adjusting JCPenneys sales data smooth the time series to the degreethat seasonally-adjusting the sales data in Figure 13.7 of PBS did? What does this im-ply about the strength of the seasonal pattern in these two time series?
13.17 In Exercise 13.3, a linear trend-only model was fit to the JCPenney sales data. Using the re-siduals from this model, look for evidence of autocorrelation.
(a) Select Stat h Time Series h Time Series Plot from the menu and make a time plot ofthe residuals. Describe any pattern you see in this plot.
(b) Select Stat h Time Series h Lag from the menu and calculate the lagged residuals.
Select Graph h Plot from the menu and plot the residuals versus the lagged residuals.
Select Stat h Time Series h Autocorrelation from the menu and calculate the corre-lation between successive residuals. Do we have evidence of autocorrelation?
13.18 In Exercise 13.5, a trend-and-season model was fit to the JCPenney sales data. Using the re-siduals from this model, look for evidence of autocorrelation.
(a) Select Stat h Time Series h Time Series Plot from the menu and make a time plot of
the residuals. Describe any pattern you see in this plot.(b) Select Stat h Time Series h Lag from the menu and calculate the lagged residuals.
Select Graph h Plot from the menu and plot the residuals versus the lagged residuals.
Select Stat h Time Series h Autocorrelation from the menu and calculate the corre-lation between successive residuals. Do we have evidence of autocorrelation?
13.22 The United States Department of Agriculture (USDA) tracks prices received by Montana farm-ers for winter wheat crops. The prices are tracked monthly in dollars per bushel.EX13_022.MTW has the wheat prices time series beginning in July 1929 and ending with Oc-tober 2002 (880 months). Use Minitab to analyze this time series.
(a) Select Stat h Time Series h Time Series Plot from the menu and make a time plot ofthe wheat prices time series.
(b) Describe any important features of the time series. Be sure to comment on trend, sea-sonal patterns, and significant shifts in the series.
(c) Select Stat h Time Series h Moving Average from the menu to calculate 12-monthmoving averages and generate a time series plot. In the dialog box, enter the MovingAverage (MA) length = 12.
(d) Select Stat h Time Series h Moving Average from the menu to calculate 120-monthmoving averages and generate a time series plot. In the dialog box, enter the MovingAverage (MA) length = 120.
(e) Compare the 12-month and 120-month moving averages. Which features of the wheatprices time series does each capture? Which features does each smooth?
13.29 Example 1.7 of PBS looked at the trend and seasonal variation in the average monthly price oforanges. Figure 1.7 of PBS is a time series plot of the data. The data is found inFG01_007.MTW.
(a) Select Stat h Time Series h Single Exp Smoothing from the menu to calculate expo-nential smoothing models using smoothing constants ofw = 0.1, 0.5, and 0.9.
(b) Comment on the smoothness of each exponential smoothing model in part (a). Whichmodel would be best for forecasting monthly ups and downs in orange prices?
7/31/2019 Time Series Analysis With Minitab13
19/19
Time Series Forecasting 218c
(c) Select Stat h Time Series h Single Exp Smoothing from the menu to calculate andcompare forecasts for January 2001 orange prices for each of the models in part (a).Which model provided the most accurate forecast? (The actual value of the orangeprices time series for January 2001 is 224.2.)
(d) Update your data by appending the January 2001 observed value of 224.2. Now selectStat h Time Series h Single Exp Smoothing from the menu to forecast the February2001 orange price with each of the models from part (a). Which model provided themost accurate forecast? (The actual value of the orange prices time series for February2001 is 229.6.)