Presentation is loading. Please wait.

Presentation is loading. Please wait.

Time Series Analysis and Forecasting

Similar presentations


Presentation on theme: "Time Series Analysis and Forecasting"— Presentation transcript:

1 Time Series Analysis and Forecasting
Chapter 20 Time Series Analysis and Forecasting

2

3 Chapter 20 Introduction Any variable that is measured over time in sequential order is called a time series. We analyze time series to detect patterns. The patterns help in forecasting future values of the time series. Predicted value The time series exhibit a downward trend pattern.

4 20.1 Components of a Time Series
A time series can consist of four components. Long - term trend (T). Cyclical effect (C). Seasonal effect (S). Random variation (R). A trend is a long term relatively smooth pattern or direction, that persists usually for more than one year.

5 Components of a Time Series
A time series can consists of four components. Long - term trend (T) Cyclical variation (C) Seasonal variation (S) Random variation (R) 6/90 6/93 6/96 6/99 6/02 A cycle is a wavelike pattern describing a long term behavior (for more than one year). Cycles are seldom regular, and often appear in combination with other components.

6 Components of a Time Series
A time series can consists of four components. Long - term trend (T). Cyclical effect (C). Seasonal effect (S). Random variation (R). 6/ /97 6/ /98 6/99 The seasonal component of the time series exhibits a short term (less than one year) calendar repetitive behavior.

7 Components of a Time Series
A time series can consists of four components. Long - term trend (T). Cyclical effect (C). Seasonal effect (S). Random variation (R). We try to remove random variation thereby, identify the other components. Random variation comprises the irregular unpredictable changes in the time series. It tends to hide the other (more predictable) components.

8 20.2 Smoothing Techniques To produce a better forecast we need to determine which components are present in a time series. To identify the components present in the time series, we need first to remove the random variation. This can be done by smoothing techniques.

9 Moving Averages A k-period moving average for time period t is the arithmetic average of the time series values around period t. For example: A 3-period moving average at period t is calculated by (yt-1 + yt + yt+1)/3

10 Moving Average: Example
To forecast future gasoline sales, the last four years quarterly sales were recorded. Calculate the three-quarter and five-quarter moving average. Show the relevant graphs. Xm20-01

11 Moving Average: Example
Solution Solving by hand * * * ( )/5= ( )/3= ( )/3=

12 Moving Average: Smoothing effect
3-period moving average Comment: We can identify a trend component . Notice how the averaging process removes some of the random variation.

13 Moving Average: Smoothing effect
3-period moving average The 5-period moving average removes more variation than the 3-period moving average. 5-period moving average

14 Centered Moving Average
With an even number of observations included in the moving average, the average is placed between the two periods in the middle. To place the moving average in an actual time period, we need to center it. Two consecutive moving averages are centered by taking their average, and placing it in the middle between them. (This is used to graph the points.)

15 Centered Moving Average: Example
Calculate the 4-period moving average and center it, for the data given below: Period Time series Moving Avg. Centerd Mov.Avg 3 20 4 14 5 25 6 11 19.0 (2.5) 20.25 (3.5) 21.5 19.50 (4.5) 17.5

16 Exponential Smoothing
The exponential smoothing method provides smoothed values for all the time periods observed. When smoothing the time series at time t, the exponential smoothing method considers all the data available at t (yt, yt-1,…) The moving average method does not provide smoothed values (moving average values) for the first and last set of periods. the moving average method considers only the observations included in the calculation of the average value, and “forgets” the rest.

17 Exponentially Smoothed Time Series
St = wyt + (1-w)St-1 St = exponentially smoothed time series at time t. yt = time series at time t. St-1 = exponentially smoothed time series at time t-1. w = smoothing constant, where 0 £ w £ 1.

18 The Exponentially Smoothed Process
Example 20.2 (Xm20-01) Calculate the gasoline sale smoothed time series using exponential smoothing with w = .2, and w = .7. Set S1 = y1 S1 = 39 S2 = wy2 + (1-w)S1 S2 = (.2)(37) + (1-.2)(39) = 38.6 S3 = wy3 + (1-w)S2 S3 = (.2)(61) + (1-.2)(38.6) = 43.1

19 The Exponentially Smoothed Process
Example 20.2-continued Small ‘w’ provides a lot of smoothing Neither value of ‘w’ reveals the seasonality.

20 The Exponentially Smoothed Process
We will let Minitab do our exponential smoothing Stat>Time Series > Single Exp Smoothing This will give us the smoothed graph

21 20.3 Trend and Seasonal Effects Trend Analysis
The trend component of a time series can be linear or non-linear. It is easy to isolate the trend component using linear regression. For linear trend use the model y = b0 + b1t + e. For non-linear trend with one (major) change in slope use the quadratic model y = b0 + b1t + b2t2 + e

22 Seasonal Analysis Seasonal variation may occur within a year or within a shorter period (month, week) To measure the seasonal effects we construct seasonal indexes. Seasonal indexes express the degree to which the seasons differ from the average time series value across all seasons.

23 Computing Seasonal Indexes
Remove the effects of the seasonal and random variations by regression analysis = b0 + b1t For each time period compute the ratio yt/yt which removes most of the trend variation > This is based on the Multiplicative Model. For each season calculate the average of yt/yt which provides the measure of seasonality. Adjust the average above so that the sum of averages of all seasons is 1 (if necessary) >

24 The additive and multiplicative models
There are two mostly used general models to describe the composition of a time series The multiplicative model The additive model yt = Tt + St + Rt In the seasonal index analysis performed here we use the multiplicative model because it is mathematically easier to handle. (Assuming no cyclical effects).

25 Seasonal indexes analysis
The multiplicative model The regression line represents trend. We see that the ratio represents the seasonality and the random effects. Averaging these ratios for each season type removes the random effects and leaves the seasonality.

26 Seasonal indexes analysis
The multiplicative model Note how no trend is observed, but seasonality and randomness still exist. Averaging the ratios for each season type removes the random effects and leaves the seasonality.

27 Computing Seasonal Indexes
Example 20.3 (Xm20-03) Calculate the quarterly seasonal indexes for hotel occupancy rate in order to measure seasonal variation. Data:

28 Computing Seasonal Indexes
Rationale for seasonal indexes Computing Seasonal Indexes Perform regression analysis for the model y = b0 + b1t + e where t represents the time, and y represents the occupancy rate. Time (t) Rate . . The regression line represents trend.

29 yt / yt The Ratios > t yt Ratio .561 .645 .561/.645=.870
/.645=.870 /.650=1.08 …………………………………………………. = (1) No trend is observed, but seasonality and randomness still exist.

30 The Average Ratios by Seasons
To remove most of the random variation but leave the seasonal effects,average the terms for each season. Average ratio for quarter 1: ( )/5 = .878 Average ratio for quarter 2: ( )/5 = 1.076 Average ratio for quarter 3: ( )/5 = 1.171 Average ratio for quarter 4: ( )/ 5 = .875

31 Adjusting the Average Ratios
In this example the sum of all the averaged ratios must be 4, such that the average ratio per season is equal to 1. If the sum of all the ratios is not 4, we need to adjust them proportionately. (Seasonal averaged ratio) (number of seasons) Sum of averaged ratios Seasonal index = Suppose the sum of ratios is equal to Then each ratio will be multiplied by 4/4.1. In our problem the sum of all the averaged ratios is equal to 4: = 4.0. No normalization is needed. These ratios become the seasonal indexes.

32 Interpreting the Seasonal Indexes
The seasonal indexes tell us what is the ratio between the time series value at a certain season, and the overall seasonal average. In our problem: 17.1% above the annual average Quarter 3 Quarter 3 87.8% 107.6% 117.1% 87.5% 7.6% above the annual average 12.5% below the annual average Annual average occupancy (100%) Quarter 2 Quarter 2 12.2% below the annual average Quarter 1 Quarter 1 Quarter 4 Quarter 4

33 The Smoothed Time Series
The trend component and the seasonality component are recomposed using the multiplicative model. In period #1 ( quarter 1): In period #2 ( quarter 2): Actual series Smoothed series The linear trend (regression) line

34 Deseasonalized Time Series
Seasonally adjusted time series = Actual time series Seasonal index By removing the seasonality, we can identify changes in the other components of the time series, that might have occurred over time.

35 Deseasonalized Time Series
In period #1 ( quarter 1): In period #2 ( quarter 2): In period #5 ( quarter 1): There was a gradual increase in occupancy rate

36 20.4 Introduction to Forecasting
There are many forecasting models available ? * o * o o o o o o o Model 1 Model 2 Which model performs better?

37 20.4 Introduction to Forecasting
A forecasting method can be selected by evaluating its forecast accuracy using the actual time series. The two most commonly used measures of forecast accuracy are: Mean Absolute Deviation Sum of Squares for Forecast Error

38 Measures of Forecast Accuracy
Choose SSE if it is important to avoid (even a few) large errors. Otherwise, use MAD. A useful procedure for model selection. Use some of the observations to develop several competing forecasting models. Run the models on the rest of the observations. Calculate the accuracy of each model (by comparing to actual data at a later time period). Select the model with the best (lowest) accuracy measure.

39 Selecting a Forecasting Model
Annual data from 1970 to 1996 were used to develop three forecasting models. Use MAD and SSE to determine which model performed best for 1997, 1998, 1999, and 2000.

40 Solution For model 1 Summary of results Actual y in 1991
Forecast for y in 1991 Summary of results

41 Selecting a Forecasting Model
In this case, Model 2 is inferior to both Models 1 and 3 Using MAD Model 3 is best Using SSE Model 1 is most accurate Choice – prefer model that consistently produces moderately accurate forecasts (Model 3) or one whose forecasts come quite close usually but misses badly in a small number of time periods (Model 1)

42 20.5 Forecasting Models The choice of a forecasting technique depends on the components identified in the time series. The techniques discussed next are: Exponential smoothing Seasonal indexes Autoregressive models (a brief discussion)

43 Forecasting with Exponential Smoothing
The exponential smoothing model can be used to produce forecasts when the time series… exhibits gradual(not a sharp) trend no cyclical effects no seasonal effects Forecast for period t+k is computed by Ft+k = St t is the current period; St = wyt + (1-w)St-1

44 Forecasting with Exponential Smoothing - Example
The quarterly sales (in $ millions) of a department store chain were recorded for the years 1997 – 2000

45 Forecasting with Exponential Smoothing - Example
Quarter 1997 1998 1999 2000 1 18 33 25 41 2 22 20 36 3 27 38 44 52 4 31 26 29 45

46 Forecasting with Exponential Smoothing - Example
Y16 = 45 S16 = 41.8

47 Forecasting with Exponential Smoothing - Example
Forecast for period t+k is computed by (t = 16) Ft+k = St t is the current period; St = wyt + (1-w)St-1 F17= S16 = 41.8 F18= S16 = 41.8 F19= S16 = 41.8 F20= S16 = 41.8

48 Computing Seasonal Indexes
Example 20.3 (Xm20-03) Calculate the quarterly seasonal indexes for hotel occupancy rate in order to measure seasonal variation. Data:

49 Forecasting with Seasonal Indexes; Example
Use the seasonal indexes calculated in Example 21.3 along with the trend line, to forecast each quarter occupancy rate in 2001. The solution procedure Use simple linear regression to find the trend line. Use the trend line to calculate the trend values. To calculate Ft multiply the trend value for period t by the seasonal index of period t.

50 Forecasting with Seasonal Indexes; Example
The solution procedure 1. Use simple linear regression to find the trend line. From Minitab (Using decomposition ) Yt = t

51 Forecasting with Seasonal Indexes; Example
The solution procedure: We previously used 20 time periods Quarter 1: (21) = 0.749 Quarter 2: (22) = 0.755 Quarter 3: (23) = 0.760 Quarter 4: (24) = 0.765 2. Use the trend line to calculate the trend values Yt = t

52 Forecasting with Seasonal Indexes; Example
The solution procedure 3. To calculate Ft multiply the trend value for period t by the seasonal index of period t. Quarter 1: X = 0.658 Quarter 2: X = 0.812 Quarter 3: X = 0.890 Quarter 4: X = 0.670 We forecast that the quarterly occupancy rates for the next year will be 65.8%, 81.2%, 89% and 67%.

53 Forecasting with Seasonal Indexes: Example (Summary)
Solution The trend line was obtained from the regression analysis. For the year 2001 we have: F21 = .749(.878) t Trend value Quarter SI Forecast

54 Problem 20-47 The revenues (in $millions) of a chain of ice-cream stores are listed for each quarter during the previous 5 years. Use the handout with the plots etc. to answer the questions.

55 Quarter 1996 1997 1998 1999 2000 1 16 14 17 18 21 2 25 27 31 29 30 3 32 40 45 52 4 24 23

56 20-47 1. Plot the time series. Is there a pattern? Does there appear to be A long term trend A cyclic effect A seasonal effect 2. Plot the 3-year moving balance. Does this change any of your answers from # 1?

57 20-47 - Answers Seems to be a long term trend – going upward.
Does not seem to be a cyclic effect. Because we know the data is in quarter years, this seems to be a strong seasonal effect. The three year moving average plot strengthens these observations.

58 20-47 Why is exponential smoothing not recommended as a forecasting tool in this problem? Look at the exponential smoothing plot (w = 0.3) Does this confirm your answer above?

59 Answers Exponential smoothing is not recommended as a forecasting tool for this problem because of the strong seasonal effect. The 0.3 gives a large smoothing effect, and the seasonality is no larger as evident.

60 20-47 Look at the trend analysis plots. Does the Linear or the Quadratic trend model seem to be better? Why? What is the equation of the trend line?

61 Answers The linear model seems to fit well. The quadratic model doesn’t show much of a curve. Checking the MAD for both models shows for the linear model and for the quadratic model. Since the linear model has a slightly smaller MAD we will use it. The equation of the trend line, then, is Y = t

62 20.47 Predict the sales for the next 4 quarters using the trend analysis line.

63 20-47 - Answer The next 4 quarters are numbers 21, 22, 23, 24
Y = t Y21 = [ (21)] = Y22 = [ (22)] = Y23 = [ (23)] = Y24 = [ (24)] =

64 20-47 Using the seasonal indexes and the trend line, forecast revenues for the next four quarters.

65 Answer The Fitted trend equation for the decomposition plot is Y = t The next time period is number 21. Y21 = [ (21)] * = Y22 = [ (22)] * = Y23 = [ (23)] * = Y24 = [ (24)] * =

66 20-47 (continued) If the actual sales numbers for the next four quarters were 24, 40, 48, 36. Calculate the MAD for the predictions from the trend line and seasonal indexes.

67 Answer MAD = | | + |36.21 – 40| + |47.46 – 48| + |33.2 – 36| / 4 = ( ) / 4 = 9.72/4 = 2.43

68 20-47 Go back to the linear trend equation forecasts. If the actual sales numbers for the next four quarters were 24, 40, 48, 36. Calculate the MAD. Which method of forecasting did a better job in this case?

69 20-47 Answers MAD = | | + |36.31 – 40| + |37.05 – 48| + |37.78 – 36| / 4 = ( ) / 4 = 28/4 = 7 This is the MAD for the trend analysis. The MAD for the seasonal trend analysis was 2.43. The seasonal trend analysis did the better job of forecasting.


Download ppt "Time Series Analysis and Forecasting"

Similar presentations


Ads by Google