Professional Documents
Culture Documents
INTRODUCTION
This document contains images of all slides in a course module about the use of time
series techniques for truck forecasting. The techniques are illustrated with data from the Blue
Water Bridge between Michigan and Ontario. This presentation is available upon request to
Alan Horowitz, horowitz@uwm.edu.
12/22/2011
Prepared by
Jing Mao
Alan J. Horowitz
Outline
Introduction
Data Collection
Methodology
Conclusion
1
12/22/2011
Lane characteristics
The original Blue Water Bridge, opened in 1938 and
renovated in 1999, is a three-lane westbound bridge.
The second Blue Water Bridge, which carries three lanes
of eastbound traffic, is an impressive modern bridge
opened in 1997.
2
12/22/2011
Data Source
Dependent variables
Blue water bridge eastbound/ westbound truck volume
Independent variables
o Michigan population (why freight moves)
o Ontario population (why freight moves)
o U.S. GDP and population (why freight moves)
o Approximate Michigan GDP (derived from U.S. GDP
by the proportion of Michigan population and U.S.
population)
o U.S. all grades all formulations retail gasoline fuel
price (major cost of freight)
o North American Free Trade Agreement (NAFTA)
(why freight moves)
o September 11 attacks (why freight does not move)
3
12/22/2011
Westbound Eastbound
30000 30000
25000
25000
20000
20000
15000
15000
10000 Westbound
10000 Eastbound
5000
5000
0
0
Nov-84
Dec-86
Oct-87
Jan-84
Jun-84
Apr-85
Sep-85
May-87
Feb-86
Jul-86
Nov-84
Dec-86
Oct-87
Jan-84
Jun-84
Apr-85
Sep-85
May-87
Feb-86
Jul-86
Westbound truck volume Eastbound truck volume
from Jan 1984 to Dec 1987 from Jan 1984 to Dec 1987
Jan-84
Jan-86
Jan-88
Jan-90
Jan-92
Jan-94
Jan-96
Jan-98
Jan-00
Jan-02
Jan-04
Jan-06
Jan-08
Jan-10
4
12/22/2011
US GDP(billion)
6000.000
U.S. Population (million)
5000.000 350
300
4000.000
US GDP
250
3000.000
200
2000.000 US GDP(billion) Population
150
1000.000 100
0.000 50
Mar-90
Jan-84
Feb-87
Apr-93
May-96
Jun-99
Jul-02
Aug-05
Sep-08
1984
1986
1988
1990
1992
1994
1996
1998
2000
2002
2004
2006
2008
2010
5
12/22/2011
120 3.500
100 3.000
Fuel price
2.500 U.S. All Grades
80 Michigan
GDP(billion) 2.000 All Formulations
60 Retail Gasoline
1.500
40 fuel Price
1.000
20
0.500
0
0.000
Jan-84
Jan-89
Jan-
Sep
May
Mar
Jan-
Sep
May
Mar
Jan-
Sep
Jul-86
Jul-91
Jan-94
Jul-96
Jan-99
Jul-01
Jan-04
Jul-06
Jan-09
Nov
Jul-
Nov
Jul-
Nov
Other Data
NAFTA
o The North American Free Trade Agreement or NAFTA is
an agreement signed by the governments
of Canada, Mexico, and the United States, creating a
trilateral trade bloc in North America. The agreement
came into force on January 1, 1994. It superseded
the Canada United States Free Trade
Agreement between the U.S. and Canada.
September 11
o The September 11 attacks could also be a factor to
influence the truck volume within that month.
6
12/22/2011
Exponential Smoothing
Linear Regression Growth Factor
ARIMA
o Box-Cox Transformation Exponential
Smoothing
Linear Regression
ARIMA
7
12/22/2011
Truck Volume
Truck Volume
70000 60000
60000 50000
50000 40000 Series1
40000 Series1
30000 Series2
30000 Series2
20000 20000
10000 10000
0
0
Mar-96
Dec-04
Nov-07
Jun-87
May-90
Jul-84
Apr-93
Feb-99
Jan-02
Dec-86
Oct-91
Mar-94
Nov-03
May-89
Jul-84
Aug-96
Jan-99
Jun-01
Apr-06
Sep-08
R square 0.956 R square 0.971
8
12/22/2011
Growth Factor
Linear growth:
Growth Factor
Determination of constant and AGF from the linear
regression
o Tools / Add-ins / Analysis Tool Park
o Tools / Data Analysis / Regression
o Independent variable: month
o Dependent variable: westbound truck volume (partial
initial data)
Constant:13767
AGF: 119
9
12/22/2011
80000
60000
0
Mar-84
Dec-85
Dec-99
Dec-06
Sep-87
Jun-89
Mar-91
Dec-92
Sep-94
Jun-96
Mar-98
Sep-01
Jun-03
Mar-05
Sep-08
Jun-10
Eastbound Forecasting
90000
80000
Truck Volume
70000
60000
50000 R Square 0.919
40000 Actual data
30000
20000 Forecasted data
10000
0
Mar-84
Dec-85
Dec-92
Dec-99
Dec-06
Sep-87
Jun-89
Mar-91
Sep-94
Jun-96
Mar-98
Sep-01
Jun-03
Mar-05
Sep-08
Jun-10
10
12/22/2011
80000
60000 R Square 0.935
40000 Moving Average
20000 Forecasting
0
Sep-84
Dec-88
Oct-91
Mar-93
Feb-86
Jul-87
Jun-97
Nov-98
Apr-00
Oct-08
Sep-01
Dec-05
Mar-10
Feb-03
Jul-04
May-90
Aug-94
Jan-96
May-07
Aug-11
Eastbound Forecasting
80000
70000
R Square 0.940
Truck Volume
60000
50000
40000
30000 Moving Average
20000 Forecasting
10000
0
Sep-84
Jan-86
May-87
Sep-88
Jan-90
May-91
Sep-92
Jan-94
May-95
Sep-96
Jan-98
May-99
Sep-00
Jan-02
May-03
Sep-04
Jan-06
May-07
Sep-08
Jan-10
May-11
11
12/22/2011
Comparison
Growth Factor
Compound growth
F(n)=Constant*AGF(n)
o If there are two years
1
AGF = F2
Y2 Y1
F1
Where F1 is the freight flow in year Y1, F2 is the
freight flow in year Y2
o If there are more than two years, AGF can be found
from the linear regression
12
12/22/2011
Growth Factor
Determination of constant and AGF
from the linear regression
o Tools / Add-ins / Analysis Tool Park
o Tools / Data Analysis / Regression
o Independent variable: month
o Dependent variable: westbound truck
volume expressed as natural logarithm
(partial initial data)
o Constant = EXP (intercept)
AGF = EXP (x-variable coefficient)
Constant:13745
AGF: 1.008
13
12/22/2011
Exponential Smoothing
Model formulation:
where
St: exponentially smoothed value for time period t
St-1: exponentially smoothed value for time period t-1
xt-1 : actual time series value for time period t
: the smoothing factor, and 0 < < 1
Example
= 0.7
St = 0.7xt-1 + (1-0.7)St-1
0.7*12878+0.3*13253
14
12/22/2011
Exponential Smoothing
Smoothing factor
o The larger is, the closer the smoothed value will
track the original data value. The smaller is, the
more fluctuation is smoothed out.
The determination of smoothing factor
o Graph fitting
o Mean squared error (MSE)
Smoothing factor assumed (0.3, 0.5, 0.7)
100000
80000
60000
Initial data
Alpha=0.3 40000
20000 Exponential
0 smoothing(alpha=0.3)
May-85
Feb-84
Aug-86
Nov-87
May-90
Feb-89
Aug-91
Nov-92
May-95
May-00
Feb-94
Aug-96
Nov-97
Feb-99
Aug-01
Nov-02
May-05
Feb-04
Aug-06
Nov-07
May-10
Feb-09
MSE=27875534
100000
80000
Alpha=0.5 60000
40000
Initial data
20000
0
Oct-86
Oct-90
Oct-94
Oct-98
Oct-02
Oct-06
Oct-10
Feb-84
Jun-85
Feb-88
Jun-89
Feb-92
Jun-93
Feb-96
Jun-97
Feb-00
Jun-01
Feb-04
Jun-05
Feb-08
Jun-09
MSE=25483163
100000
80000
Alpha=0.7 60000
Initial data
40000
20000
Exponential
0 smoothing(alpha=0.7)
May-85
May-90
Feb-84
Aug-86
Nov-87
Feb-89
Aug-91
Nov-92
May-95
May-00
Feb-94
Aug-96
Nov-97
Feb-99
Aug-01
Nov-02
May-05
Feb-04
Aug-06
Nov-07
May-10
Feb-09
MSE=24306420
15
12/22/2011
Oct-95
Dec-96
Oct-02
Dec-03
Oct-09
Dec-10
Feb-84
Apr-85
Jun-86
Aug-87
Feb-91
Apr-92
Jun-93
Aug-94
Feb-98
Apr-99
Jun-00
Aug-01
Feb-05
Apr-06
Jun-07
Aug-08
Linear Regression
Model
Y = f(x1,x2,,xn) = b0 + b1x1 + b2x2 + + bnxn
Dataset with initial truck volume(partial):
16
12/22/2011
Initial Analysis
17
12/22/2011
Select Stepwise as
analysis mode
Click OK
18
12/22/2011
Results Analysis
US GDP NAFTA,
Sep.11
The order of
regression equation
Common Statistic
19
12/22/2011
Analysis of Coefficients
Regression equation:
Y=652201.511+83171.959x110177.394x2+4889.856x3
x1: Michigan population(million)
x2: Ontario population(million)
x3: Fuel price(current dollar)
Dec-07
Feb-01
Jul-04
2
0
Oct-86
Oct-97
Oct-08
Jan-84
Jul-89
Apr-92
Jan-95
Jul-00
Apr-03
Jan-06
Mar-93
Nov-96
Mar-04
Nov-07
Jan-84
Sep-87
May-91
Jul-89
Jan-95
Sep-98
May-02
Jul-00
Jan-06
Sep-09
20
12/22/2011
=9.88*0.94
21
12/22/2011
Regression Forecasting
Westbound truck forecasting results from Feb
2011 to Dec 2013 with the multilinear regression
model
22
12/22/2011
Forecasting Results
100000
90000
80000
70000
60000
50000
Initial data
40000
Forecasting
30000
20000
10000
0
Mar-86
Oct-93
Nov-94
Dec-95
Mar-99
Oct-06
Nov-07
Dec-08
Jan-84
Feb-85
Apr-87
May-88
Jun-89
Jul-90
Aug-91
Sep-92
Jan-97
May-01
Feb-98
Apr-00
Jun-02
Jul-03
Aug-04
Sep-05
Jan-10
Feb-11
Select Stepwise
as analysis mode
Click OK
23
12/22/2011
24
12/22/2011
80000
70000
60000
50000
40000 Westbound
30000 Forecasting
20000
10000
0
Nov-86
Mar-89
Nov-93
Mar-96
Nov-00
Mar-03
Nov-07
Mar-10
Jul-84
Sep-85
Jan-88
May-90
Jul-91
Sep-92
Jan-95
May-97
Jul-98
Sep-99
Jan-02
May-04
Jul-05
Sep-06
Jan-09
May-11
Seasonal adjustment
factor data is derived
from central moving
average series
25
12/22/2011
Comparison
R Square
Regression with 0.942
unsmoothed data
Regression with smoothed 0.984
data
Linear Regression
Michigan GDP as one of the independent
variables instead of Michigan population and
U.S. GDP
26
12/22/2011
Forecasting
Y=155753-20609*Ontario population(million) -13133*Fuel
price+13033*NAFTA+1294*Michigan GDP(billion)
R Square: 0.989
Comparison
Comparing R Square of linear regression with
the independent variable of Michigan GDP and
the independent variables without Michigan GDP
R Square
Regression with Michigan 0.984
GDP
Regression without 0.989
Michigan GDP
27
12/22/2011
ARIMA
ARIMA(p,d,q)
o Auto-regressive model
p is the number of autoregressive terms
o Integrated model
d is the number of nonseasonal differences
o Moving average model
q is the number of lagged forecast errors in the
prediction equation
Auto-Regressive Model
Random Error
28
12/22/2011
Excel Output
Coefficients
Intercept 13273 Yi = 13273 0.25Yi 1 +0.128Yi 2
X Variable 1 -0.25
X Variable 2 0.128
=
(Y Y )(Y Y )
t t +k
(Y Y )
t
2
PACF
o The Partial Autocorrelation Function (PACF) is similar to the
ACF, however it measures correlation between observations
that are k time periods apart, after controlling for correlations
at intermediate lags.
29
12/22/2011
Autocorrelation
Using initial truck series to make autocorrelation
with SPSS
o Putting transformed data as variable
o Click Autocorrelation and Partial autocorrelation
and input maximum number of lags as 24
o Click OK
30
12/22/2011
70000
60000
Nonstationary
50000 The variability is changing
40000
Series1
30000
20000
10000
0
Mar-87
Oct-88
Dec-91
Oct-07
Nov-99
Mar-06
Dec-10
Jan-84
Aug-85
May-90
Feb-95
Jan-03
Jul-93
Sep-96
Apr-98
Jun-01
Aug-04
May-09
20000
15000
10000
Truck Volume
5000
Series1
0
Nov-87
Nov-92
Nov-97
Nov-02
Nov-07
May-85
May-00
May-05
May-10
Feb-84
Aug-86
May-90
Feb-89
Aug-91
May-95
Feb-94
Aug-96
Feb-99
Aug-01
Feb-04
Aug-06
Feb-09
5000
10000
15000
20000
31
12/22/2011
Box-Cox Transformation
Transformation formulation
32
12/22/2011
Identifying Lambda
Lambda=-0.7 Lambda=-0.5 Lambda=-0.3
0.0003 0.006
Stand Deviation
Stand Deviation
Stand Deviation
0.0015
0.0002 0.004
0.001
0.0001 Series1 0.002 Series1
0.0005 Series1
0 0
0
1 2 3 1 2 3
1 2 3
Lambda=0.5 Lambda=0.1
Lambda=0.3 26
0.1
Stand Deviation
Stand Deviation
2.5 25
Stand Deviation
2 0.08
24
1.5 0.06
23
Series1 0.04 Series1
1 Series1 22
0.5 21 0.02
0 20 0
1 2 3 1 2 3 1 2 3
33
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
Feb-84
Jan-85
Dec-85
Nov-86 Truck Volume
Oct-87
0
5
10
15
20
25
30
35
Sep-88 Jan-84
Aug-89 May-85
Jul-90 Sep-86
Jun-91 Jan-88
May-92 May-89
Apr-93 Sep-90
Mar-94 Jan-92
Feb-95 May-93
Jan-96 Sep-94
Dec-96 Jan-96
Nov-97 May-97
Oct-98 Sep-98
Jan-00
Sep-99
Seasonal
May-01
Stationary
Aug-00
Sep-02
Jul-01
Jan-04
Jun-02
Transformed data
May-05
May-03
Sep-06
Apr-04
Jan-08
Mar-05
May-09
Feb-06 Sep-10
Jan-07
Sep-10
Series1
Transforming with Differenced Data
Transforming with Undifferenced Data
34
12/22/2011
12/22/2011
Identifying AR(p)
Identify the numbers of AR by looking at the
autocorrelation function (ACF) and partial
autocorrelation (PACF) plots of differenced series
AR(p)
ACF Tails off
PACF Cuts after p
35
12/22/2011
MA(q)
ACF Cuts after q
PACF Tails off
Differencing=0
36
12/22/2011
Differencing=1
Identification of ARIMA(p,d,q)
P=0, d=1,q=1
(1B)Yt=(11B)at
t: indexes time
B: the backshift operator, BYt= BYt-1
1: the nonseasonal moving average coefficient
at: the random error
37
12/22/2011
Seasonal model:
Identification of P,D,Q
Differencing: 0
38
12/22/2011
p=0,d=1,q=1
P=0,D=1,Q=0
ARIMA(0,1,1)(0,1,0)12
(1B)(1B12)Yt=(11B)at
t: indexes time
B: the backshift operator, BYt= BYt-1
B12: the seasonal backshift operator, B12Yt= BYt-12
1: the nonseasonal moving average coefficient
at: the random error
39
12/22/2011
R square : 0.971
Residual Graph
40
12/22/2011
Forecasting
41
12/22/2011
Conclusions
Growth factor
Exponential smoothing
Linear regression
ARIMA
Conclusions (contd)
Growth factor
o Advantages
Simple and easy to understand
Considering the linear and nonlinear trend of the
historical data
o Disadvantages
Neglecting the effects of cyclical or seasonal
components
Increasing the time
42
12/22/2011
Conclusions (contd)
Exponential smoothing
o Advantages
Including both linear and nonlinear
Structural view of the data that include level, trend,
seasonality, and events
o Disadvantage
The forecast is constant for all future values
Conclusions (contd)
Linear regression
o Advantage
Considering the characteristic of independent
variables and the relationship between independent
variables(economical and political factors) and
dependent variables
o Disadvantage
Difficult to determine the trends of every
independent variable
43
12/22/2011
Conclusions (contd)
ARIMA
o Advantage
The comprehensiveness of the family of models
o Disadvantages
ARIMA identification is difficult and time consuming
ARIMA may be difficult to explain to others
Models that perform similarly on the historical data
may yield quite different forecasts
Empirical
o Although there are more disadvantages than
advantages, the advantages may still outweigh
the disadvantages.
Reference
44