Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
APS 425 Fall 2015
Time Series Analysis:
Trend & Seasonality
Instructor: G. William Schwert
585-275-2470
[email protected] Topics
Deterministic trends & seasonality
Stochastic trends & seasonality
Differencing & seasonal differencing
(c) Prof. G. William Schwert, 2002-2015 1
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Time Trends
Linear
Zt = a + b t + et
do you really expect such a pattern to persist forever?
e.g., accumulated horse manure in the streets of
Philadelphia in the late 18th century
exponential (linear in logs)
log(Zt) = a + b t + et
Zt = exp{a + b t + et}
In Eviews, time = @trend(K) creates a time trend equal
to 0 in observation K
Linear Trend Example
25
Actual Fitted
20
15
10
0
0 10 20 30 40 50 60 70 80 90 100
(c) Prof. G. William Schwert, 2002-2015 2
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Exponential Trend Example
180
Actual Fitted
160
140
120
100
80
60
40
20
0
0 10 20 30 40 50 60 70 80 90 100
Polynomial Trends
Zt = a + b t + b t2 + e
1 2 t
parabola
if b2 < 0, then it eventually turns negative
if b2 > 0, then it eventually sky-rockets up
you can approximate most samples with polynomials,
but you wouldn't expect to do well forecasting out-of-
sample
(c) Prof. G. William Schwert, 2002-2015 3
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Quadratic Trend Example
18
16
14
12
10
6 Actual Fitted
0
0 10 20 30 40 50 60 70 80 90 100
Other Functions of Time
Cosine or Sine represent fixed cycles
S-curves (logistic) -- new product sales
log((L - Zt)/Zt) = a + b t + et
Zt = L / {1 + exp[ a + b t + et]}
L is the upper limit (asymptote) for sales
can iterate on this by trying different values to see which
fits best
(c) Prof. G. William Schwert, 2002-2015 4
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
S-Curve Trend Example
12000
Actual Fitted
10000
8000
6000
4000
2000
0
0 10 20 30 40 50 60 70 80 90 100
Other Types of
Stationarity-inducing Transformations
per capita
divide by population (if it is growing)
real
divide by price index (e.g., CPI)
market share
divide by industry sales
(c) Prof. G. William Schwert, 2002-2015 5
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Relation to Differencing
Linear Trend:
Zt = a + b t + et
(Zt - Zt-1) = [a + b t + et] - [a + b (t-1) + et-1]
= b + et - et-1
Random Walk with Drift:
Zt = b + et + Zt-1
(Zt - Zt-1) = b + et
The Level of a
Random Walk with Drift
Z =b+e +Z
t t t-1
=b+e + b+e +Z
t t-1 t-2
=b+e + b+e + b+e +Z
t t-1 t-2 t-3
...
=bt+e +e +e +... +e +Z
t t-1 t-2 1 0
which is the initial value of Z0,
plus b times t,
plus the sum of all the shocks from time 1 through t
so Z0 plays the role of a in the trend model, but the
errors follow a random walk
(c) Prof. G. William Schwert, 2002-2015 6
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Seasonality
Any type of predictable behavior that is a function of the
season
originally used for agricultural products
growing/harvests happen at the same time every
year
Also caused by conventions of holidays, etc.
e.g., more sales at Christmas
Can also reflect days of the week
e.g., Fed Funds rate
Seasonality
1) Fixed effects -- dummy variables
2) ARMA model at seasonal frequencies
(c) Prof. G. William Schwert, 2002-2015 7
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Seasonals (Fixed)
Monthly dummy variables
e.g., if Jan = 1; otherwise = 0
allows for different intercepts by month
Day-of-the-week dummy variables for daily data
also, for holidays
In Eviews
Jan = @seas(1) if the workfile is defined as being monthly
Seasonals (Fixed)
Monthly Example
define Jant = 1 if the observation occurs in January, and = 0, otherwise; and so
forth
Zt = 1 Jant + 2 Febt + . . . + 12 Dect + et
so 1 is the average value of Z in Januarys, etc.
This is equivalent to the model where any one of the monthly dummies is left
out (e.g., Jan)
Zt = + 2 Febt + . . . + 12 Dect + et
so 2 is the average difference between the mean in February and the mean in
January (which is )
(c) Prof. G. William Schwert, 2002-2015 8
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Seasonal Differencing
Similar to ordinary differences, except s periods apart (Zt - Zt-s):
note that seasonal differencing removes a linear trend
it also removes different fixed means
i.e., dummy variables
Relations Among Seasonal Variables
Suppose you have a regression model that relates sales to past
advertising for a product that has a seasonal sales cycle -- e.g.,
automobiles
it is easy to imagine that some types of advertising that are
specific to a particular model or new feature would have no
effect on sales beyond this model year
other types of advertising that highlighted general quality
characteristics of the brand might have effects that last beyond
the model year
when building a model you need to think about what effects
seasonality might have on the model
(c) Prof. G. William Schwert, 2002-2015 9
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Seasonal ARIMA(P,D,Q)s Models
Just like ARIMA(p,d,q) models, except the gap between
observations that affect one another is s periods, not 1 period
Example: ARIMA(1,0,0)12 model [monthly AR(1)]
Zt = + 1 Zt-12 + et
so the autocorrelations decay exponentially at lags 12, 24,
36, etc.
partial autocorrelation at lag 12 = 1
after lag 12, they equal 0
Seasonal ARIMA(0,1,1)s Models
This model occurs a lot in real data
note that seasonal differencing removes a linear trend
it also removes different fixed means
i.e., dummy variables
if the MA parameter is close to 1, this "exponential smoothing"
model implies a slowly wandering level for the series that is
different for each period of the year
(c) Prof. G. William Schwert, 2002-2015 10
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Seasonal Exponential
Smoothing Forecasts
ARIMA(0,1,1)12 model:
[Zt - Zt-12] = et - 1 et-12
^ ^
Zt-12(12) = Zt-12 - 1 et-12 = Zt-12 - 1 [Zt-12 - Zt-24(12)]
^
= (1 - 1) Zt-12 + 1 Zt-24(12)
so the forecast for next January is a weighted average of the most recent
observation and the forecast for that observation (for Januarys)
Seasonal Adjustment
The most common method is the X-11 technique developed at
the U.S. Bureau of the Census
a complex (two-sided) filter that involves ratios and moving
averages
I have seen cases (e.g., CPI) where it does not seem to work well
for forecasting purposes, it is difficult, since the final seasonally
adjusted figure will keep getting revised as new data comes in
it is a two-sided filter
(c) Prof. G. William Schwert, 2002-2015 11
Time Series - Trends & Seasonality APS 425 - Advanced Managerial Data
Analysis
Seasonality: Summary
1) If the most interesting variation in the data is at seasonal
lags, then you probably need more data to get a reliable
model
e.g., with monthly dummies, you are trying to estimate the
monthly averages with only T/12 observations per parameter
2) It is probably better to directly model seasonality, rather
than use seasonally adjusted data
mechanical adjustment procedures often don't work well
Links
Return to APS 425 Home Page:
http://schwert.ssb.rochester.edu/a425/a425main.htm
(c) Prof. G. William Schwert, 2002-2015 12