第 14章 时间序列分析
Time-Series Analysis
本章概要
? Component Factors of the Time-Series Model
? Smoothing of Data Series
? Moving Averages
? Exponential Smoothing
? Least Square Trend Fitting and Forecasting
? Linear,Quadratic and Exponential Models
? Autoregressive Models
? Choosing Appropriate Models
? Monthly or Quarterly Data
What Is Time-Series
? A Quantitative Forecasting Method to
Predict Future Values
? Numerical Data Obtained at Regular Time
Intervals
? Projections Based on Past and Present
Observations
? Example:
Year,1994 1995 1996 1997 1998
Sales,75.3 74.2 78.5 79.7 80.2
Time-Series Components
时间序列的组成
Time-Series
Cyclical
Random
Trend
Seasonal
Trend Component
趋势项
? Overall Upward or Downward Movement
? Data Taken Over a Period of Years
Sales
Time
Cyclical Component
周期项
? Upward or Downward Swings
? May Vary in Length
? Usually Lasts 2 - 10 Years
Sales
Time
Seasonal Component
季节项
? Upward or Downward Swings
? Regular Patterns
? Observed Within 1 Year
Sales
Time (Monthly or Quarterly)
Random or Irregular Component
随机项
? Erratic,Nonsystematic,Random,慠
esidual?Fluctuations
? Due to Random Variations of
? Nature
? Accidents
? Short Duration and Non-repeating
Multiplicative Time-Series Model
相乘时间序列模型
?Used Primarily for Forecasting
?Observed Value in Time Series is the product
of Components
?For Annual Data:
?For Quarterly or Monthly Data:
iiii ICTY ???
iiiii ICSTY ????
Ti = Trend
Ci = Cyclical
Ii = Irregular
Si = Seasonal
Moving Averages
移动平均
? Used for Smoothing
? Series of Arithmetic Means Over Time
? Result Dependent Upon Choice of L,Length of
Period for Computing Means
? For Annual Time-Series,L Should be Odd
? Example,3-year Moving Average
? First Average:
? Second Average:
33
321 YYY)(MA ???
33
432 YYY)(MA ???
Moving Average Example
Year Units Moving
Ave
1994 2 NA
1995 5 3
1996 2 3
1997 2 3.67
1998 7 5
1999 6 NA
John is a building contractor with a record of a total of 24 single
family homes constructed over a 6 year period,Provide John with
a Moving Average Graph.
Moving Average Example Solution
Year Response Moving
Ave
1994 2 NA
1995 5 3
1996 2 3
1997 2 3.67
1998 7 5
1999 6 NA 94 95 96 97 98 99
8
6
4
2
0
Sales
Exponential Smoothing
指数平滑
? Weighted Moving Average
? Weights Decline Exponentially
? Most Recent Observation Weighted Most
? Used for Smoothing and Short Term
Forecasting
? Weights Are:
? Subjectively Chosen
? Ranges from 0 to 1
? Close to 0 for Smoothing
? Close to 1 for Forecasting
Exponential Weight,Example
Year Response Smoothing Value Forecast
(W =,2) 1994 2
2 NA
1995 5 (.2)(5) + (.8)(2) = 2.6 2
1996 2 (.2)(2) + (.8)(2.6) = 2.48 2.6
1997 2 (.2)(2) + (.8)(2.48) = 2.384 2.48
1998 7 (.2)(7) + (.8)(2.384) = 3.307 2.384
1999 6 (.2)(6) + (.8)(3.307) = 3.846 3.307
11 ???? iii E)W(WYE
Exponential Weight,Example Graph
94 95 96 97 98 99
8
6
4
2
0
Sales
Year
Data
Smoothed
The Linear Trend Model
iii X..XbbY ? 743143210 ????Year Coded Sales
94 0 2
95 1 5
96 2 2
97 3 2
98 4 7
99 5 6
0
1
2
3
4
5
6
7
8
1993 1994 1995 1996 1997 1998 1999 2000
Projected to
year 2000
C o e f f i c i e n t s
I n t e r c e p t 2, 1 4 2 8 5 7 1 4
X V a r i a b l e 1 0, 7 4 2 8 5 7 1 4
Excel Output
The Quadratic Trend Model
二次趋势模型
2
210 iii XbXbbY ? ???
22 1 43308 5 72
iii X.X..Y ? ???
Excel Output
Year Coded Sales
94 0 2
95 1 5
96 2 2
97 3 2
98 4 7
99 5 6
C o e f f i c i e n t s
I n t e r c e p t 2, 8 5 7 1 4 2 8 6
X V a r i a b l e 1 - 0, 3 2 8 5 7 1 4
X V a r i a b l e 2 0, 2 1 4 2 8 5 7 1
C o e f f i c i e n t s
I n t e r c e p t 0, 3 3 5 8 3 7 9 5
X V a r i a b l e 1 0, 0 8 0 6 8 5 4 4
The Exponential Trend Model
指数趋势模型
iXi bbY? 10? or 110 bl o gXbl o gY ?l o g i ??
Excel Output of Values in logs
iXi ).)(.(Y ? 21172?
Year Coded Sales
94 0 2
95 1 5
96 2 2
97 3 2
98 4 7
99 5 6
a n t i l o g (, 3 3 5 8 3 7 9 5 ) = 2, 1 7
a n t i l o g (, 0 8 0 6 8 5 4 4 ) = 1, 2
Autogregressive Modeling
自回归建模
? Used for Forecasting
? Takes Advantage of Autocorrelation
? 1st order - correlation between consecutive
values
? 2nd order - correlation between values 2
periods apart
? Autoregressive Model for pth order:
ipipiii YAYAYAAY ?????????? ??? 22110
Random
Error
Autoregressive Model,Example
The Office Concept Corp,has acquired a number of office units (in
thousands of square feet) over the last 8 years,Develop the 2nd
order Autoregressive models.
Year Units
92 4
93 3
94 2
95 3
96 2
97 2
98 4
99 6
Autoregressive Model,
Example Solution
Year Yi Yi-1 Yi-2
92 4 --- ---
93 3 4 ---
94 2 3 4
95 3 2 3
96 2 3 2
97 2 2 3
98 4 2 2
99 6 4 2
C o e f f i c i e n t s
I n t e r c e p t 3, 5
X V a r i a b l e 1 0, 8 1 2 5
X V a r i a b l e 2 - 0, 9 3 7 5
Excel Output
21 9 3 7 58 1 2 553 ?? ??? iii Y.Y..Y
?Develop the 2nd order
table
?Use Excel to run a
regression model
Autoregressive Model Example,Forecasting
21 9 3 7 58 1 2 553 ?? ??? iii Y.Y..Y
Use the 2nd order model to forecast number of units
for 2000:
6254
4937 56812 553
937 5812 553 199819992000
.
...
Y.Y..Y
?
?????
???
Autoregressive Modeling Steps
自回归建模步骤
1,Choose p,Note that df = n - 2p - 1
2,Form a series of 搇 ag predictor?variables
Yi-1,Yi-2,?Yi-p
3,Use Excel to run regression model using all p
variables
4,Test significance of Ap
? If null hypothesis rejected,this model is selected
? If null hypothesis not rejected,decrease p by 1 and
repeat
Selecting A Forecasting Model
筛选预测模型
? Perform A Residual Analysis
? Look for pattern or direction
? Measure Sum Square Errors - SSE (residual
errors)
? Measure Residual Errors Using MAD
? Use Simplest Model
? Principle of Parsimony
Residual Analysis
残差分析
Random errors
Trend not accounted for
Cyclical effects not accounted for
Seasonal effects not accounted for
T T
T T
e e
e e
0 0
0 0
Measuring Errors
? Sum Square Error (SSE)
? Mean Absolute Deviation (MAD)
? ??
?
n
i
ii )Y?Y(S S E
1
2
n
Y ?Y
M A D
n
i
ii? ?
? ? 1
Principal of Parsimony
? Suppose 2 or more models provide good fit
for data
? Select the Simplest Model
? Simplest model types:
? least-squares linear
? least-square quadratic
? 1st order autoregressive
? More complex types:
? 2nd and 3rd order autoregressive
? least-squares exponential
Forecasting With Seasonal Data
季节性数据的预测
? Use Categorical Predictor Variables with Least-
Square Trending Fitting
? Exponential Model with Quarterly Data:
? The bi provides the multiplier for the ith quarter
relative to the 4th quarter.
? Qi = 1 if ith quarter and 0 if not
? Xj = the coded variable denoting the time period
321
43210
QQQX bbbbbY ? i?
Forecasting With Quarterly Data,Example
4 4 5, 7 7
4 4 4, 2 7
4 6 2, 6 9
4 5 9, 2 7
5 0 0, 7 1
5 4 4, 7 5
5 8 4, 4 1
6 1 5, 9 3
6 4 5, 5
6 7 0, 6 3
6 8 7, 3 1
7 4 0, 7 4
7 5 7, 1 2
8 8 5, 1 4
9 4 7, 2 8
9 7 0, 4 3
I
2
3
4
Quarter 1994 1995 1996 1997
Standards and Poor 500 Composite Stock Price Index:R e g r e s s i o n S t a t i s t i c s
M u l t i p l e R 0, 9 9 0 0 5 2 4 5
R S q u a r e 0, 9 8 0 2 0 3 8 5 4
A d j u s t e d R S q u a r e 0, 9 7 3 0 0 5 2 5 6
S t a n d a r d E r r o r 0, 0 4 3 6 1 5 5 8
O b s e r v a t i o n s 16
Excel Output
Appears to be an
excellent fit.
r2 is,98
Quarterly Data,Example
C o e f f i c i e n t s
I n t e r c e p t 6, 0 2 9 4 0 3 3 8 6
X V a r i a b l e ( T r e n d ) 0, 0 5 5 2 2 2 2 6 1
X V a r i a b l e ( Q 1 ) - 0, 0 0 6 8 9 2 6 5 6
X V a r i a b l e ( Q 2 ) 0, 0 1 1 5 6 6 5 0 5
X V a r i a b l e ( Q 3 ) - 0, 0 1 9 3 8 0 0 2 2
Excel Output
2110 blnQblnXblnY ?ln ii ???
Regression Equation for the first quarter:
10 0 6 90 5 50 2 96 Q.X.,i ???
Time-Series Analysis
本章概要
? Component Factors of the Time-Series Model
? Smoothing of Data Series
? Moving Averages
? Exponential Smoothing
? Least Square Trend Fitting and Forecasting
? Linear,Quadratic and Exponential Models
? Autoregressive Models
? Choosing Appropriate Models
? Monthly or Quarterly Data
What Is Time-Series
? A Quantitative Forecasting Method to
Predict Future Values
? Numerical Data Obtained at Regular Time
Intervals
? Projections Based on Past and Present
Observations
? Example:
Year,1994 1995 1996 1997 1998
Sales,75.3 74.2 78.5 79.7 80.2
Time-Series Components
时间序列的组成
Time-Series
Cyclical
Random
Trend
Seasonal
Trend Component
趋势项
? Overall Upward or Downward Movement
? Data Taken Over a Period of Years
Sales
Time
Cyclical Component
周期项
? Upward or Downward Swings
? May Vary in Length
? Usually Lasts 2 - 10 Years
Sales
Time
Seasonal Component
季节项
? Upward or Downward Swings
? Regular Patterns
? Observed Within 1 Year
Sales
Time (Monthly or Quarterly)
Random or Irregular Component
随机项
? Erratic,Nonsystematic,Random,慠
esidual?Fluctuations
? Due to Random Variations of
? Nature
? Accidents
? Short Duration and Non-repeating
Multiplicative Time-Series Model
相乘时间序列模型
?Used Primarily for Forecasting
?Observed Value in Time Series is the product
of Components
?For Annual Data:
?For Quarterly or Monthly Data:
iiii ICTY ???
iiiii ICSTY ????
Ti = Trend
Ci = Cyclical
Ii = Irregular
Si = Seasonal
Moving Averages
移动平均
? Used for Smoothing
? Series of Arithmetic Means Over Time
? Result Dependent Upon Choice of L,Length of
Period for Computing Means
? For Annual Time-Series,L Should be Odd
? Example,3-year Moving Average
? First Average:
? Second Average:
33
321 YYY)(MA ???
33
432 YYY)(MA ???
Moving Average Example
Year Units Moving
Ave
1994 2 NA
1995 5 3
1996 2 3
1997 2 3.67
1998 7 5
1999 6 NA
John is a building contractor with a record of a total of 24 single
family homes constructed over a 6 year period,Provide John with
a Moving Average Graph.
Moving Average Example Solution
Year Response Moving
Ave
1994 2 NA
1995 5 3
1996 2 3
1997 2 3.67
1998 7 5
1999 6 NA 94 95 96 97 98 99
8
6
4
2
0
Sales
Exponential Smoothing
指数平滑
? Weighted Moving Average
? Weights Decline Exponentially
? Most Recent Observation Weighted Most
? Used for Smoothing and Short Term
Forecasting
? Weights Are:
? Subjectively Chosen
? Ranges from 0 to 1
? Close to 0 for Smoothing
? Close to 1 for Forecasting
Exponential Weight,Example
Year Response Smoothing Value Forecast
(W =,2) 1994 2
2 NA
1995 5 (.2)(5) + (.8)(2) = 2.6 2
1996 2 (.2)(2) + (.8)(2.6) = 2.48 2.6
1997 2 (.2)(2) + (.8)(2.48) = 2.384 2.48
1998 7 (.2)(7) + (.8)(2.384) = 3.307 2.384
1999 6 (.2)(6) + (.8)(3.307) = 3.846 3.307
11 ???? iii E)W(WYE
Exponential Weight,Example Graph
94 95 96 97 98 99
8
6
4
2
0
Sales
Year
Data
Smoothed
The Linear Trend Model
iii X..XbbY ? 743143210 ????Year Coded Sales
94 0 2
95 1 5
96 2 2
97 3 2
98 4 7
99 5 6
0
1
2
3
4
5
6
7
8
1993 1994 1995 1996 1997 1998 1999 2000
Projected to
year 2000
C o e f f i c i e n t s
I n t e r c e p t 2, 1 4 2 8 5 7 1 4
X V a r i a b l e 1 0, 7 4 2 8 5 7 1 4
Excel Output
The Quadratic Trend Model
二次趋势模型
2
210 iii XbXbbY ? ???
22 1 43308 5 72
iii X.X..Y ? ???
Excel Output
Year Coded Sales
94 0 2
95 1 5
96 2 2
97 3 2
98 4 7
99 5 6
C o e f f i c i e n t s
I n t e r c e p t 2, 8 5 7 1 4 2 8 6
X V a r i a b l e 1 - 0, 3 2 8 5 7 1 4
X V a r i a b l e 2 0, 2 1 4 2 8 5 7 1
C o e f f i c i e n t s
I n t e r c e p t 0, 3 3 5 8 3 7 9 5
X V a r i a b l e 1 0, 0 8 0 6 8 5 4 4
The Exponential Trend Model
指数趋势模型
iXi bbY? 10? or 110 bl o gXbl o gY ?l o g i ??
Excel Output of Values in logs
iXi ).)(.(Y ? 21172?
Year Coded Sales
94 0 2
95 1 5
96 2 2
97 3 2
98 4 7
99 5 6
a n t i l o g (, 3 3 5 8 3 7 9 5 ) = 2, 1 7
a n t i l o g (, 0 8 0 6 8 5 4 4 ) = 1, 2
Autogregressive Modeling
自回归建模
? Used for Forecasting
? Takes Advantage of Autocorrelation
? 1st order - correlation between consecutive
values
? 2nd order - correlation between values 2
periods apart
? Autoregressive Model for pth order:
ipipiii YAYAYAAY ?????????? ??? 22110
Random
Error
Autoregressive Model,Example
The Office Concept Corp,has acquired a number of office units (in
thousands of square feet) over the last 8 years,Develop the 2nd
order Autoregressive models.
Year Units
92 4
93 3
94 2
95 3
96 2
97 2
98 4
99 6
Autoregressive Model,
Example Solution
Year Yi Yi-1 Yi-2
92 4 --- ---
93 3 4 ---
94 2 3 4
95 3 2 3
96 2 3 2
97 2 2 3
98 4 2 2
99 6 4 2
C o e f f i c i e n t s
I n t e r c e p t 3, 5
X V a r i a b l e 1 0, 8 1 2 5
X V a r i a b l e 2 - 0, 9 3 7 5
Excel Output
21 9 3 7 58 1 2 553 ?? ??? iii Y.Y..Y
?Develop the 2nd order
table
?Use Excel to run a
regression model
Autoregressive Model Example,Forecasting
21 9 3 7 58 1 2 553 ?? ??? iii Y.Y..Y
Use the 2nd order model to forecast number of units
for 2000:
6254
4937 56812 553
937 5812 553 199819992000
.
...
Y.Y..Y
?
?????
???
Autoregressive Modeling Steps
自回归建模步骤
1,Choose p,Note that df = n - 2p - 1
2,Form a series of 搇 ag predictor?variables
Yi-1,Yi-2,?Yi-p
3,Use Excel to run regression model using all p
variables
4,Test significance of Ap
? If null hypothesis rejected,this model is selected
? If null hypothesis not rejected,decrease p by 1 and
repeat
Selecting A Forecasting Model
筛选预测模型
? Perform A Residual Analysis
? Look for pattern or direction
? Measure Sum Square Errors - SSE (residual
errors)
? Measure Residual Errors Using MAD
? Use Simplest Model
? Principle of Parsimony
Residual Analysis
残差分析
Random errors
Trend not accounted for
Cyclical effects not accounted for
Seasonal effects not accounted for
T T
T T
e e
e e
0 0
0 0
Measuring Errors
? Sum Square Error (SSE)
? Mean Absolute Deviation (MAD)
? ??
?
n
i
ii )Y?Y(S S E
1
2
n
Y ?Y
M A D
n
i
ii? ?
? ? 1
Principal of Parsimony
? Suppose 2 or more models provide good fit
for data
? Select the Simplest Model
? Simplest model types:
? least-squares linear
? least-square quadratic
? 1st order autoregressive
? More complex types:
? 2nd and 3rd order autoregressive
? least-squares exponential
Forecasting With Seasonal Data
季节性数据的预测
? Use Categorical Predictor Variables with Least-
Square Trending Fitting
? Exponential Model with Quarterly Data:
? The bi provides the multiplier for the ith quarter
relative to the 4th quarter.
? Qi = 1 if ith quarter and 0 if not
? Xj = the coded variable denoting the time period
321
43210
QQQX bbbbbY ? i?
Forecasting With Quarterly Data,Example
4 4 5, 7 7
4 4 4, 2 7
4 6 2, 6 9
4 5 9, 2 7
5 0 0, 7 1
5 4 4, 7 5
5 8 4, 4 1
6 1 5, 9 3
6 4 5, 5
6 7 0, 6 3
6 8 7, 3 1
7 4 0, 7 4
7 5 7, 1 2
8 8 5, 1 4
9 4 7, 2 8
9 7 0, 4 3
I
2
3
4
Quarter 1994 1995 1996 1997
Standards and Poor 500 Composite Stock Price Index:R e g r e s s i o n S t a t i s t i c s
M u l t i p l e R 0, 9 9 0 0 5 2 4 5
R S q u a r e 0, 9 8 0 2 0 3 8 5 4
A d j u s t e d R S q u a r e 0, 9 7 3 0 0 5 2 5 6
S t a n d a r d E r r o r 0, 0 4 3 6 1 5 5 8
O b s e r v a t i o n s 16
Excel Output
Appears to be an
excellent fit.
r2 is,98
Quarterly Data,Example
C o e f f i c i e n t s
I n t e r c e p t 6, 0 2 9 4 0 3 3 8 6
X V a r i a b l e ( T r e n d ) 0, 0 5 5 2 2 2 2 6 1
X V a r i a b l e ( Q 1 ) - 0, 0 0 6 8 9 2 6 5 6
X V a r i a b l e ( Q 2 ) 0, 0 1 1 5 6 6 5 0 5
X V a r i a b l e ( Q 3 ) - 0, 0 1 9 3 8 0 0 2 2
Excel Output
2110 blnQblnXblnY ?ln ii ???
Regression Equation for the first quarter:
10 0 6 90 5 50 2 96 Q.X.,i ???