You are on page 1of 34

Forecasting

Models
With
Trend and Seasonal Effects
Types of Seasonal Models
• Two possible models are:

Additive Model Multiplicative Model


yt = Tt + St + εt yt = TtStεt

Trend Effects
Seasonal Effects
Random Effects
Additive Model
Regression Forecasting Procedure
• Suppose a time series is modeled as having k seasons
(Here we illustrate k = 4 quarters)
– The following 4 equations represent time series value of 4
seasons

Season 1: yt = β0 + β1t + β2 + εt
Tt St εt

Season 2: yt = β0 + β1t + β3 + εt

Season 3: yt = β0 + β1t + β4 + εt

Season 4: yt = β0 + β1t + β5 + εt
Additive Model
Regression Forecasting Procedure
• Combining the 4 equations into one, we can use 4 dummy
variables, S1, S2, S3 and S4 corresponding to seasons 1, 2,
3 and 4 respectively:

yt = β0 + β1t + β2S1 + β3S2 + β4S3 + β5S4 + εt

Tt St εt
The combination of 0’s and 1’s for each of the dummy variables at each
period indicate the season corresponding to the time series value.
– Season 1: S1 = 1, S2 = 0, S3 = 0, S4 = 0
– Season 2: S1 = 0, S2 = 1, S3 = 0 ,S4 = 0
– Season 3: S1 = 0, S2 = 0, S3 = 1, S4 = 0
– Season 4: S1 = 0, S2 = 0, S3 = 0, S4 = 0

• We can simplified the above equation by removing β5S4


Additive Model
Regression Forecasting Procedure
– Season 1: S1 = 1, S2 = 0, S3 = 0
– Season 2: S1 = 0, S2 = 1, S3 = 0
– Season 3: S1 = 0, S2 = 0, S3 = 1
– Season 4: S1 = 0, S2 = 0, S3 = 0

yt = β0 + β1t + β2S1 + β3S2 + β4S3 + εt


Tt St εt

The combination of 0’s and 1’s for each of the dummy variables at each
period indicate the season corresponding to the time series value.

• Multiple regression is then done on with t, S1, S2, and S3 as


the independent variables and the time series values yt as
the dependent variable.
Example
Troy’s Mobil Station
• Troy owns a gas station in a vacation resort city
that has many spring and summer visitors.
– Due to a steady increase in population Troy feels that
average sales experience long term trend.
– Troy also knows that sales vary by season due to the
vacationers.
• Based on the last 5 years data below with sales in
1000’s of gallons per season, Troy needs to
predict total sales for next year (periods 21, 22, 23,
and 24). YEAR
SEASON 1 2 3 4 5
FALL 3497 3726 3989 4248 4443
WINTER 3484 3589 3870 4105 4307
SPRING 3553 3742 3996 4263 4466
SUMMER 3837 4050 4327 4544 4795
Scatterplot of Time Series
Gasoline Sales Over Five Year Period
5000

4800 Summer
4600
Fall
(1000's gallons)
Gasoline Sales

4400

4200

4000

3800

3600

3400

Spring
3200
Winter
3000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Period

General Pattern: Winter less than Fall, Spring more than


Winter, Summer more than Spring, Fall less than Summer
The Model
• There is also apparent long term trend.

• The form of the model then is:

yt = β0 + β1t + β2F + β3W + β4S + εt

Fall Winter Spring


The Excel Input
Add Dummy Variables

In Fall, not Winter, not Spring

Not Fall, In Winter, not Spring


Not Fall, not Winter, In Spring
Not Fall, not Winter, not Spring

Pattern Repeats
Regression Intput
Regression Output

Low p-value for F-test

Low p-values for all t-tests

Conclusion
Good model – all factors significant
Troy’s Mobil Station –
Performing the forecast
• The forecasting additive model is:
Ft = 3610.625 + 58.33t – 155F – 323W –
248.27S

• Forecasts for year 6 are produced as follows:


• F(Year 6, Fall) = 3610.625+58.33(21) – 155(1) – 323(0) –
248.27(0)
• F(Year 6, Winter) = 3610.625+58.33(22) – 155(0) – 323(1) –
248.27(0)
• F(Year 6, Spring) = 3610.625+58.33(23) – 155(0) – 323(0) –
248.27(1)
• F(Year 6, Summer) = 3610.625+58.33(24) – 155(0) – 323(0)
– 248.27(0)
The Forecasts

=$G$17+$G$18*B22+$G$19*C22+$G$20*D22+$G$21*E22

=SUM(F22:F25)
Drag F22 down to F25
Multiplicative Model
Classical Decomposition Approach
• The time series is first decomposed into
its components (trend, seasonal
variation).
• After these components have been
determined, the series is re-composed by
multiplying the components.
Classical Decomposition
• Smooth the time series to • Calculate moving averages to
remove random effects and get values for Tt for each
seasonality and isolate trend. period t.

• Determine “period factors” to • Calculate the ratio yt/Tt.


isolate the (seasonal)(error)
factors.

• Determine the “unadjusted • Average all the yt/Tt that


seasonal factors” to eliminate correspond to the same season.
the random component from the
period factors
Classical Decomposition (Cont’d)

Calculate:
• Determine the “adjusted [Unadjusted seasonal factor]
seasonal factors”. [Average seasonal factor]

• Determine “Deseasonalized data Calculate:


values”. yt
[Adjusted seasonal factors]t

• Determine a deseasonalized Use linear regression on the


trend forecast. deseasonalized time series.

• Determine an “adjusted Calculate:


seasonal forecast”. (Desesonalized values) 
[Adjusted seasonal factors]).
CANADIAN FACULTY
ASSOCIATION (CFA)
• The CFA is the exclusive bargaining agent
for public Canadian college faculty.
• Membership in the organization has grown
over the years, but in the summer months
there was always a decline.
• To prepare the budget for the 2001 fiscal
year, a forecast of the average quarterly
membership covering the year 2001 was
required.
CFA - Solution
• Membership records from 1997 through 2000
were collected and graphed.
AVERAGE
YEAR PERIOD QUARTER MEMBERSHIP
1997 1 1 7130
2 2 6940
3 3 7354 The graph exhibits long term trend
4 4 7556
1998 5 1 7673 The graph exhibits seasonality pattern
6 2 7332
7 3 7662
8 4 7809
1999 9 1 7872
10 2 7551
11 3 7989
12 4 8143
2000 13 1 8167
14
15
2
3
7902
8268
1997 1998 1999 2000
16 4 8436
Step 1:
Isolating the Trend Component

• Smooth the time series to


remove random effects and Calculate moving averages.
seasonality.
Average membership for the first 4 periods First moving average period is
= [7130+6940+7354+7556]/4 = 7245.01 centered at quarter (1+4)/ 2 = 2.5

Average membership for periods [2, 5] Second moving average period


= [6940+7354+7556+7673]/4 = 7380.75 is centered at quarter (2+5)/ 2 = 3.5

Centered moving average of the first


two moving averages is Centered location is t = 3
[7245.01 + 7380.75]/2 = 7312.875 Trend value at period 3, T3
=AVERAGE(C3:C6,C4:C7)
Drag down to D16
Step 2
Determining the Period Factors

• Determine “period factors”


to isolate the Calculate the ratio yt/Tt.
(Seasonal)(Random error)
factor.
Since yt =TtStεt, then the period factor, Stεt is given by

Stet = yt/Tt
Example:
In period 7 (3rd quarter of 1998):
S7ε7= y7/T7 = 7662/7643.875 = 1.002371
=C5/D5
Drag down to E16
Step 3
Unadjusted Seasonal Factors

• Determine the “unadjusted Average all the yt/Tt that


seasonal factors” to eliminate correspond to the same
the random component from season.
the period factors

This eliminates the random factor from the period factors, Stεt This
leaves us with only the seasonality component for each season.

Example: Unadjusted Seasonal Factor for the third quarter.


S3 = {S3,97 e3,97 + S3,98 e3,98 + S3,99 e3,99}/3 = {1.0056+1.0024+1.0079}/3 = 1.0053
=AVERAGE(E3,E7,E11,E15)
Drag down to F6

Copy F3:F6

Paste Special(Values)
Step 4
Adjusted Seasonal Factors
• Determine the “adjusted Calculate:
seasonal factors” so that Unadjusted seasonal factors
average adjusted factor is 1 Average seasonal factor
Average seasonal factor =
(1.01490+.96580+1.00533+1.01624)/4=1.00057
Unadjusted Adjusted
Quarter Seasonal Factor Seasonal Factor
1 1.01490 1.014325
2 .96580 .965252
3 1.00533 1.004759
4 1.01624 1.015663

Unadjusted Seasonal Factors/1.00057


F3/AVERAGE($F$3:$F$6)
Drag down to G18
Step 5
The Deseasonalized Time Series

• Determine “Deseasonalized Calculate:


data values”. yt
[Adjusted seasonal factors]t

Deseasonalized series value for Period 6


(2nd quarter, 1998)

y6/(Quarter 2 Adjusted Seasonal Factor) =


7332/0.965252 = 7595.94
=C3/G3
Drag to cell H18
Step 6
The Time Series Trend Component
• Regress on the Deseasonalized Time Series
• Determine a deseasonalized forecast from
the resulting regression equation
(Unadjusted Forecast)t = 7069.6677 + 78.4046t

Period (t) Unadjusted Forecast (t)


17 8402.55
18 8480.95
19 8559.36
20 8637.76
Run regression
Deseason vs. Period

=$L$18+$L$19*B19
Drag to cell I22
Step 7
The Forecast
Re-seasonalize the forecast by multiplying
the unadjusted forecast by the adjusted
seasonal factor for each period.
Unadjusted Adjusted Adjusted
Period Forecast (t) Seasonal Factor Forecast (t)
17 8402.55 1.014325 8522.92
18 8480.95 .965252 8186.26
19 8559.36 1.004759 8600.09
20 8637.76 1.015663 8773.06
Seasonally
=I19*G3
Adjusted
Drag down to J22
Forecasts
Review
• Additive Model for Time Series with Trend and
Seasonal Effects
– Use of Dummy Variables
• 1 less than the number of seasons
– Use of Regression
• Modified F test if all p-values not < .05

• Multiplicative Model for Time Series with Trend


and Seasonal Effects
– Determine a set of adjusted period factors to
deseasonalize data
– Do regression to obtain unadjusted forecasts
– Reseasonalize results to give seasonally adjusted
forecasts.

• Excel

You might also like