Download presentation
Presentation is loading. Please wait.
Published byOctavia Bradford Modified over 8 years ago
1
Time Series and Forecasting BIA 674 SUPPLY CHAIN ANALYTICS Additional Material
2
Stationarity
3
We know that not all time series are stationary. However, it is easy to convert a trend or a seasonal time series to a stationary time series. Simply use the concept of “Differencing.” Differencing
4
Convert a trend time series to stationary time series using the differencing method
5
Convert a seasonal time series to stationary time series
6
Converting a time series to a stationary Non-constant variance can be removed by performing a natural log transformation http://www.itl.nist.gov/div898/handbook/pmc/section4/pmc44a.htm
7
Autocorrelation
8
The Problem Stereo sales data suggests that the pattern of sales is not completely random. Large values tend to follow large values, and small values tend to follow small values. The time series may be autocorrelated, i.e., successive observations are correlated with one other Do autocorrelations support this conclusion?
9
Autocorrelations Recall that successive observations in a random series are probabilistically independent of one another. Many time series violate this property and are instead autocorrelated. Correlation coefficient is a summary statistic that measures the extent of linear relationship between two variables. As such they can be used to identify explanatory relationships. The “auto” means that successive observations are correlated with one other. To understand autocorrelations it is first necessary to understand what it means to lag a time series.
10
Autocorrelations in Excel To lag by 1 month, we simply “push down” the series by one row. Lags are simply previous observations, removed by a certain number of periods from the present time.
11
Lags and Autocorrelations for Stereo Sales
12
Autocorrelation In evaluating time series data, it is useful to look at the correlation between successive observations over time. This measure of correlation is called autocorrelation and may be calculated as follows: r k = autocorrelation coefficient for a k period lag. mean of the time series. y t = Value of the time series at period t. y t-k = Value of time series k periods before period t.
13
Correlograms: An Alternative Method of Data Exploration The plot of the autocorrelation Function (ACF) versus time lag is called Correlogram. The horizontal scale is the time lag The vertical axis is the autocorrelation coefficient. Patterns in a Correlogram are used to analyze key features of data.
14
AUTOCORRELATION
15
Example Autocorrelation.xls
16
Autocorrelation Autocorrelation coefficient for different time lags can be used to answer the following questions about a time series data. Are the data random? If the autocorrelations between y t and y t-k for any lag are close to zero, then the successive values of a time series are not related to each other.
17
Correlograms: An Alternative Method of Data Exploration Is there a trend? If the series has a trend, y t and y t-k are highly correlated The autocorrelation coefficients are significantly different from zero for the first few lags and then gradually drops toward zero. The autocorrelation coefficient for the lag 1 is often very large (close to 1). A series that contains a trend is said to be non- stationary.
18
Example:Mobil Home Shipment Correlograms for the mobile home shipment Note that this is quarterly data
19
Correlograms: An Alternative Method of Data Exploration Is there seasonal pattern? If a series has a seasonal pattern, there will be a significant autocorrelation coefficient at the seasonal time lag or multiples of the seasonal lag. The seasonal lag is 4 for quarterly data and 12 for monthly data.
20
Correlograms: An Alternative Method of Data Exploration Is it stationary? A stationary time series is one whose basic statistical properties, such as the mean and variance, remain constant over time. Autocorrelation coefficients for a stationary series decline to zero fairly rapidly, generally after the second or third time lag.
21
Correlograms: An Alternative Method of Data Exploration To determine whether the autocorrelation at lag k is significantly different from zero, the following hypothesis and rule of thumb may be used. H 0 : k = 0,H a : k 0 For any k, reject H 0 if Where n is the number of observations. This rule of thumb is for = 5%
22
Correlograms: An Alternative Method of Data Exploration The hypothesis test developed to determine whether a particular autocorrelation coefficient is significantly different from zero is: Hypotheses H 0 : k = 0,H a : k 0 Test Statistic: Reject H 0 if
23
Example:Japanese exchange Rate As the world’s economy becomes increasingly interdependent, various exchange rates between currencies have become important in making business decisions. For many U.S. businesses, The Japanese exchange rate (in yen per U.S. dollar) is an important decision variable. A time series plot of the Japanese-yen U.S.-dollar exchange rate is shown below. On the basis of this plot, would you say the data is stationary? Is there any seasonal component to this time series plot?
24
Example:Japanese exchange Rate
25
Here is the autocorrelation structure for EXRJ. With a sample size of 12, the critical value is This is the approximate 95% critical value for rejecting the null hypothesis of zero autocorrelation at lag K.
26
Example:Japanese exchange Rate The Correlograms for EXRJ is given below
27
Example:Japanese exchange Rate Since the autocorrelation coefficients fall to below the critical value after just two periods, we can conclude that there is no trend in the data. No seasonality is observed
28
Example:Japanese exchange Rate To check for seasonality at =.05 The hypotheses are: H 0 ; 12 = 0H a : 12 0 Test statistic is: Reject H 0 if
29
Example:Japanese exchange Rate Since We do not reject H 0, therefore seasonality does not appear to be an attribute of the data.
30
ACF of Forecast Error The autocorrelation function of the forecast errors is very useful in determining if there is any remaining pattern in the errors (residuals) after a forecasting model has been applied. This is not a measure of accuracy, but rather can be used to indicate if the forecasting method could be improved.
31
Random Series
32
Time Series Plot of Demand for Parts
33
Visual Inspection Demands vary randomly around the sample mean of $247.54 (shown as the horizontal centerline). The variance appears to be constant through time, and there are no obvious time series patterns. To check formally whether this apparent randomness holds, we calculate the first 10 autocorrelations.
34
Findings None of the autocorrelations is significantly large. These findings are consistent with randomness. For all practical purposes there is no time series pattern to these demand data.
35
AUTOCORRELATION (a) (quite) Stationary(b) (rather) Non-stationary (c) Trend(d) Seasonality (quarterly)
36
The Random Walk Model
37
Random Walk Model Random series are sometimes building blocks for other time series models. The random walk model is an example of this. In the random walk model the series itself is not random. However, its differences - that is the changes from one period to the next - are random. This type of behavior is typical of stock price data.
38
Solution The Dow Jones series itself is not random, due to upward trend, so we form the differences in Column C with the formula =B7-B6 which is copied down column C. The difference can be seen on the next slide. A graph of the differences (see graph following data) show the series to be a much more random series, varying around the mean difference 26.00. The runs test appears in column H and shows that there is absolutely no evidence of nonrandom differences; the observed number of runs is almost identical to the expected number.
39
Differences for Dow Jones Data
40
Time Series Plot of Dow Differences
41
Solution -- continued Similarly, the autocorrelations are all small except for a random “blip” at lag 11. Because the values are 11 months apart we would tend to ignore this autocorrelation. Assuming the random walk model is adequate, the forecast of April 1992 made in March 1992 is the observed March value, 3247.42, plus the mean difference, 26.00 or 3273.42. A measure of the forecast accuracy is the standard deviation of 84.65. We can be 95% certain that our forecast will be within the standard deviations.
42
Additional Forecasting If we wanted to forecast further into the future, say 3 months, based on the data through March 1992, we would add the most recent value, 3247.42, to three times the mean difference, 26.00. That is, we just project the trend that far into the future. We caution about forecasting too far into the future for such a volatile series as the Dow.
43
Autoregressive Models
44
A retailer has recorded its weekly sales of hammers (units purchased) for the past 42 weeks. The data are found in the file. The graph of this time series appears below and reveals a “meandering” behavior. Plot and Data
45
The Plot and Data The values begin high and stay high awhile, then get lower and stay lower awhile, then get higher again. This behavior could be caused by any number of things. How useful is autoregression for modeling these data and how would it be used for forecasting?
46
Autocorrelations A good place to start is with the autocorrelations of the series. These indicate whether the Sales variable is linearly related to any of its lags. The first six autocorrelations are shown below.
47
Autocorrelations -- continued The first three of them are significantly positive, and then they decrease. Based on this information, we create three lags of Sales and run a regression of Sales versus these three lags. Here is the output from this regression
48
Autoregression Output with Three Lagged Variables
49
Autocorrelations -- continued We see that R 2 is fairly high, about 57%, and that s e is about 15.7. However, the p-values for lags 2 and 3 are both quite large. It appears that once the first lag is included in the regression equation, the other two are not really needed. Therefore we reran the regression with only the first lag include.
50
Autoregression Output with a Single Lagged Variable
51
Forecasts from Aggression This graph shows the original Sales variable and its forecasts
52
Regression Equation The estimated regression equation is Forecasted Sales t = 13.763 + 0.793Sales t-1 The associated R 2 and s e values are approximately 65% and 155.4. The R 2 is a measure of the reasonably good fit we see in the previous graph, whereas the s e is a measure of the likely forecast error for short-term forecasts. It implies that a short-term forecast could easily be off by as much as two standard errors, or about 31 hammers.
53
Regression Equation -- continued To use the regression equation for forecasting future sales values, we substitute known or forecasted sales values in the right hand side of the equation. Specifically, the forecast for week 43, the first week after the data period, is approximately 98.6 using the equation ForecastedSales 43 = 13.763 + 0.793Sales 42 The forecast for week 44 is approximately 92.0 and requires the forecasted value of sales in week 43 in the equation: ForecastedSales 44 = 13.763 + 0.793ForecastedSales 43
54
Forecasts Perhaps these two forecasts of future sales are on the mark and perhaps they are not. The only way to know for certain is to observe future sales values. However, it is interesting that in spite of the upward movement in the series, the forecasts for weeks 43 and 44 are downward movements.
55
Regression Equation Properties The downward trend is caused by a combination of the two properties of the regression equation. First, the coefficient of Sales t-1, 0.793, is positive. Therefore the equation forecasts that large sales will be followed by large sales (that is, positive autocorrelation). Second, however, this coefficient is less than 1, and this provides a dampening effect. The equation forecasts that a large will follow a large, but not that large.
56
Seasonality Indexes Ratio-to-moving-Average Monthly seasonality indexes Use smoothing averages to smooth data and eliminate seasonality
57
57 Seasonal Variation One of the components of a time series Seasonal variations are fluctuations that coincide with certain seasons and are repeated year after year Understanding seasonal fluctuations help plan for sufficient goods and materials on hand to meet varying seasonal demand Analysis of seasonal fluctuations over a period of years help in evaluating current sales
58
Seasonal Component PERIOD LENGTH“SEASON” LENGTHNUMBER OF “SEASONS” IN PATTERN WeekDay7 MonthWeek4 – 4.5 MonthDay28 – 31 YearQuarter4 YearMonth12 YearWeek52
59
59 Seasonal Index A number, usually expressed in percent, that expresses the relative value of a season with respect to the average for the year (100%) Ratio-to-moving-average method The method most commonly used to compute the typical seasonal pattern It eliminates the trend (T), cyclical (C), and irregular (I) components from the time series
60
60 The table below shows the quarterly sales for Toys International for the years 2001 through 2006. The sales are reported in millions of dollars. Determine a quarterly seasonal index using the ratio-to-moving-average method. Ratio-to-moving Average - Example 1
61
61 Step (1) – Organize time series data in column form Step (2) Compute the 4-quarter moving totals Step (3) Compute the 4-quarter moving averages Step (4) Compute the centered moving averages by getting the average of two 4-quarter moving averages Step (5) Compute ratio by dividing actual sales by the centered moving averages
62
62 Ratio-to-moving Average - Example 1
63
63 Ratio-to-moving Average - Example 1 Deseasonalized Sales = Sales / Seasonal Index
64
64 Ratio-to-moving Average - Example 1
65
65 Ratio-to-moving Average - Example 1
66
66 Ratio-to-moving Average - Example 1
67
67 Ratio-to-moving Average - Example 1 Given the deseasonalized linear equation for Toys International sales as Ŷ=8.109 + 0.0899t, generate the seasonally adjusted forecast for the each of the quarters of 2007 Quartert Ŷ (unadjusted forecast) Seasonal Index Quarterly Forecast (seasonally adjusted forecast) Winter2510.356750.7657.923 Spring2610.446660.5756.007 Summer2710.536571.14112.022 Fall2810.626481.51916.142 Ŷ = 8.109 + 0.0899(28) Ŷ X SI = 10.62648 X 1.519
68
Monthly seasons - Example 2 1.Find average historical demand for each month 2.Compute the average demand over all months 3.Compute a seasonal index for each month 4.Estimate next year’s total demand 5.Divide this estimate of total demand by the number of months, then multiply it by the seasonal index for that month Steps in the process for monthly seasons:
69
Seasonal Index Example DEMAND MONTHYEAR 1YEAR 2YEAR 3 AVERAGE YEARLY DEMAND AVERAGE MONTHLY DEMAND SEASONAL INDEX Jan8085105 Feb7085 Mar809382 Apr9095115 May113125131 June110115120 July100102113 Aug88102110 Sept859095 Oct777885 Nov758283 Dec827880 90 80 85 100 123 115 105 100 90 80 Total average annual demand = 1,128
70
Seasonal Index Example 2 DEMAND MONTHYEAR 1YEAR 2YEAR 3 AVERAGE YEARLY DEMAND AVERAGE MONTHLY DEMAND SEASONAL INDEX Jan80851059094 Feb7085 8094 Mar8093828594 Apr909511510094 May11312513112394 June11011512011594 July10010211310594 Aug8810211010094 Sept8590959094 Oct7778858094 Nov7582838094 Dec827880 94 Total average annual demand =1,128 Average monthly demand
71
Seasonal Index Example 2 DEMAND MONTHYEAR 1YEAR 2YEAR 3 AVERAGE YEARLY DEMAND AVERAGE MONTHLY DEMAND SEASONAL INDEX Jan80851059094 Feb7085 8094 Mar8093828594 Apr909511510094 May11312513112394 June11011512011594 July10010211310594 Aug8810211010094 Sept8590959094 Oct7778858094 Nov7582838094 Dec827880 94 Total average annual demand =1,128 Seasonal index.957( = 90/94)
72
Seasonal Index Example 2 DEMAND MONTHYEAR 1YEAR 2YEAR 3 AVERAGE YEARLY DEMAND AVERAGE MONTHLY DEMAND SEASONAL INDEX Jan80851059094.957( = 90/94) Feb7085 8094.851( = 80/94) Mar8093828594.904( = 85/94) Apr9095115100941.064( = 100/94) May113125131123941.309( = 123/94) June110115120115941.223( = 115/94) July100102113105941.117( = 105/94) Aug88102110100941.064( = 100/94) Sept8590959094.957( = 90/94) Oct7778858094.851( = 80/94) Nov7582838094.851( = 80/94) Dec827880 94.851( = 80/94) Total average annual demand =1,128
73
Seasonal Index Example 2 MONTHDEMANDMONTHDEMAND Jan 1,200 x.957 = 96 July 1,200 x 1.117 = 112 12 Feb 1,200 x.851 = 85 Aug 1,200 x 1.064 = 106 12 Mar 1,200 x.904 = 90 Sept 1,200 x.957 = 96 12 Apr 1,200 x 1.064 = 106 Oct 1,200 x.851 = 85 12 May 1,200 x 1.309 = 131 Nov 1,200 x.851 = 85 12 June 1,200 x 1.223 = 122 Dec 1,200 x.851 = 85 12 Seasonal forecast for Year 4
74
Seasonal Index Example 2 140 – 130 – 120 – 110 – 100 – 90 – 80 – 70 – ||||||||||||JFMAMJJASOND||||||||||||JFMAMJJASOND Time Demand Year 4 Forecast Year 3 Demand Year 2 Demand Year 1 Demand
75
Eliminate seasonality using moving averages Moving averages smooth out noise in the data For example, each January sales are less than December sales. The unsuspected analyst will think that there is downward trend in the trend!
76
Outliers
77
Outliers in regression are data points where the absolute value of the error (actual value of y – predicted value of y) exceeds two standard errors. Europe.xls
78
Nonlinearities
79
Outliers Independent variables can interact with or influence a dependent variable in nonlinear ways. Priceandads.xls
80
Mixed Models
81
MOVING AVERAGE (MA) METHOD
82
WEIGHTED MA METHOD
83
WEIGHTED MA METHOD
84
AUTOREGRESSION Obtained via least-squares or regression
85
MIXED MODELS
86
MIXED MODELS
87
MIXED MODELS
88
Data Patterns
89
Data Pattern A time series is likely to contain some or all of the following components: Trend Seasonal Cyclical Irregular
90
Data Pattern Trend in a time series is the long-term change in the level of the data i.e. observations grow or decline over an extended period of time. Positive trend When the series move upward over an extended period of time Negative trend When the series move downward over an extended period of time Stationary When there is neither positive or negative trend.
91
Data Pattern Seasonal pattern in time series is a regular variation in the level of data that repeats itself at the same time every year. Examples: Retail sales for many products tend to peak in November and December. Housing starts are stronger in spring and summer than fall and winter.
92
Data Pattern Cyclical patterns in a time series is presented by wavelike upward and downward movements of the data around the long-term trend. They are of longer duration and are less regular than seasonal fluctuations. The causes of cyclical fluctuations are usually less apparent than seasonal variations.
93
Data Pattern Irregular pattern in a time series data are the fluctuations that are not part of the other three components These are the most difficult to capture in a forecasting model
94
No Trend—Stationary demand seems to cluster around a specific level.
95
Demand consistently increases or decreases over time. Time Trend
96
Seasonality
97
Cyclical
98
Data Patterns & Model Selection
99
Data Patterns and Model Selection Forecasting techniques used for stationary time series data are: Naive methods Simple averaging methods, Moving averages Simple exponential smoothing Autoregressive moving average (ARMA)
100
Data Patterns and Model Selection Methods used for time series data with trend are: Moving averages Holt’s linear exponential smoothing Simple regression Growth curve Exponential models Time series decomposition Autoregressive integrated moving average (ARIMA)
101
Data Patterns and Model Selection For time series data with seasonal component the goal is to estimate seasonal indexes from historical data. These indexes are used to include seasonality in forecast or remove such effect from the observed value. Forecasting methods to be considered for these type of data are: Winter’s exponential smoothing Time series multiple regression Autoregressive integrated moving average (ARIMA)
102
Example: GDP, in 1996 Dollars For GDP, which has a trend and a cycle but no seasonality, the following might be appropriate: Holt’s exponential smoothing Linear regression trend Causal regression Time series decomposition
103
Example:Quarterly data on private housing starts Private housing starts have a trend, seasonality, and a cycle. The likely forecasting models are: Winter’s exponential smoothing Linear regression trend with seasonal adjustment Causal regression Time series decomposition
104
Example:U.S. billings of the Leo Burnet advertising agency For U.S. billings of Leo Burnett advertising, There is a non-linear trend, with no seasonality and no cycle, therefore the models appropriate for this data set are: Non-linear regression trend Causal regression
105
http://www.itl.nist.gov/div898/ handbook/index.htm
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.