Professional Documents
Culture Documents
Session 18 Time Series Forecasting
Session 18 Time Series Forecasting
TIME SERIES
FORECASTING
1977
1979
1983
1987
1991
1993
1995
1999
1981
1985
1989
1997
2001
Y ear
Time-Series Components
Time Series
rd trend
Sales Upwa
Time
Trend Component
• Trend can be upward or downward
• Trend can be linear or non-linear
Sales Sales
Time Time
Downward linear trend Upward nonlinear trend
Seasonal Component
• Short-term regular wave-like patterns
• Observed within 1 year
• Often monthly or quarterly
Sales
Summer
Winter
Summer
Winter Spring Fall
Spring Fall
Time (Quarterly)
Cyclical Component
• Long-term wave-like patterns
• Regularly occur but may vary in length
• Often measured peak to peak or valley to
valley 1 Cycle
Sales
Year
Irregular Component
• Unpredictable, random, “residual”
fluctuations
• Due to random variations of
– Nature
– Accidents or unusual events
• “Noise” in the time series
Multiplicative Time-Series Model with a
Seasonal Component
• Used primarily for forecasting
• Allows consideration of seasonal variation
Yi Ti Si Ci Ii
where Ti = Trend value at time i
Si = Seasonal value at time i
Ci = Cyclical value at time i
Ii = Irregular (random) value at time i
Multiplicative Time-Series Model for Annual
Data
Yi Ti Ci Ii
where Ti = Trend value at year i
Ci = Cyclical value at year i
Ii = Irregular (random) value at year i
Smoothing the
Annual Time Series
– First average:
Y1 Y2 Y3 Y4 Y5
MA(5)
5
– Second average:
Y2 Y3 Y4 Y5 Y6
MA(5)
5
– etc.
Example: Annual Data
Year Sales Annual Sales
1 23
60
2 40
50
3 25
4 27 40 …
5 32 Sales 30
6 48
20
7 33
8 37 10
9 37 0
1 2 3 4 5 6 7 8 9 10 11
…
10 50
11 40 Year
etc… etc…
Calculating Moving Averages
5-Year
Average Moving
Year Sales Year Average
1 23 1 2 3 4 5
3 29.4 3
2 40 5
4 34.4
3 25 5 33.0 23 40 25 27 32
29.4
4 27 6 35.4 5
5 32 7 37.4
6 48 8 41.0
7 33 9 39.4
8 37 … …
9 37 etc…
10 50
• Each moving average is for a consecutive
11 40
block of 5 years
Annual vs. Moving Average
moving average 60
smoothes the 50
data and shows 40
the underlying
Sales
30
trend 20
10
0
1 2 3 4 5 6 7 8 9 10 11
Year
Fi 1 WDi (1 W ) Fi
For i = 2, 3, 4, …
where:
Fi+1 = exponentially smoothed forecast value for period i+1
Fi = exponentially smoothed value already
computed for period i
Di = actual observed value in period i
W = weight (smoothing coefficient), 0 < W < 1
Exponential Smoothing Example
• Suppose we use weight W = .2
Time Forecast
Sales Exponentially Smoothed
Period from prior
(Yi) Value for this period (Ei)
(i) period (Fi-1)
1 23 -- 23 F1 = Y1 since
2 40 23 (.2)(40)+(.8)(23)=26.4 no prior
information
3 25 26.4 (.2)(25)+(.8)(26.4)=26.12
exists
4 27 26.12 (.2)(27)+(.8)(26.12)=26.296
5 32 26.296 (.2)(32)+(.8)(26.296)=27.437
6 48 27.437 (.2)(48)+(.8)(27.437)=31.549 Ei
7 33 31.549 (.2)(48)+(.8)(31.549)=31.840 WYi (1 W )Ei1
8 37 31.840 (.2)(33)+(.8)(31.840)=32.872
9 37 32.872 (.2)(37)+(.8)(32.872)=33.697
10 50 33.697 (.2)(50)+(.8)(33.697)=36.958
etc. etc. etc. etc.
Sales vs. Smoothed Sales
Fluctuations have been smoothed
60
50
40
Sales
30
20
10
0
1 2 3 4 5 6 7 8 9 10
Time Period
Sales Smoothed
Trend-Based Forecasting
• Estimate a trend line using regression analysis
Time Use time (X) as the
Year Period Sales independent variable:
(X) (Y)
1999 0 20
2000 1 40 Ŷ b0 b1X
2001 2 30
2002 3 50
2003 4 70
2004 5 65
Trend-Based Forecasting
• The linear trend forecasting equation is:
Time
Year Period Sales Ŷi 21.905 9.5714 Xi
(X) (Y) Sales trend
1999 0 20
80
2000 1 40 70
60
2001 2 30 50
sales
2002 3 50 40
30
2003 4 70 20
10
2004 5 65 0
0 1 2 3 4 5 6
Year
Trend-Based Forecasting
(continued)
• Forecast for time period 6:
Time
Period
Ŷ 21.905 9.5714 (6)
Year Sales
(X) (y) 79.33
1999 0 20
2000 1 40
80
2001 2 30 70
2002 3 50 60
50
sales
2003 4 70 40
30
2004 5 65 20
10
2005 6 ?? 0
0 1 2 3 4 5 6
Year
Nonlinear Trend Forecasting
• A nonlinear regression model can be used when the
time series exhibits a nonlinear trend
• Quadratic form is one type of a nonlinear model:
Yi 0 1Xi 2 X i2
i