Time Series Part 2
Time Series Part 2
1
Regression
g models with independent
p error terms
• descriptive time series models: do not use probabilistic approach; uncertainties
handled by judgement
• regression time series models: formal statistical models permitting statistical
inferences/predictions
• Regression model: independent variables Î trend, cyclical & seasonal effects, in
an additive manner
Yt= β0+β1 Xt 1+β Xt 2+…+β
+ +βp-11 Xt ,p-11 + εt
where
t = period 1,2,…,n
εt ~ N (0, σ) Î random (irregular) component, time-independent
2
Trend component model
• Example: annual time series without cycles, plus additive trend & random effects
Yt= β0+β1 Xt + εt ; Xt = t
where β1 Xt Î linear trend effect
Trend and seasonal components models
• Example:
E l titime series
i without
ith t cycles,
l plus
l additive
dditi trend,
t d seasonall & random
d
effects
Yt= β0+β1 Xt1 +β2 Xt 2+β Xt 3 +β4 Xt4 + εt
where
Xt = t; β1 Xt Î linear trend effect
Qtr X2 X3 X4
β2 Xt 2+β Xt 3 +β4 Xt4 Î seasonal effect First 0 0 0
Second 1 0 0
Xt 2 = 1 if period is second qtr, 0 otherwise Third 0 1 0
Xt 3 = 1 if period is third qtr, 0 otherwise Fourth 0 0 1
3
R
Regression
i models
d l with
ith indicator
i di t series
i as independent
i d d t variables
i bl
• Indicator series (e.g. cyclical indicator series in Table 24.5) that can serve to
Î supplement independent variables for trend/seasonal effects, and/or
Î represent time series component
• Coincident independent variables: dependent variable series and indicator series
in same time period
Yt= β0+β1 Xt1 +β2 Xt 2 + εt
Xt1, Xt 2 are indep. variables (of indicator time series) in same period as Yt
• Lagged independent variables: some or all indicator series are lagged
Yt= β0+β1 Xt-5 + εt ; Xt-5 is a lagged indicator time series
Yt= β0+β1 Xt-1 +β2 Xt-2 + εt (with distributed time lag)
• Indicator series and time series components
Yt= β0+β1 Xt1 +β2 Xt2+β3Xt 3 +β4 Xt4 +β5 Xt-1,5 + εt
where
h
Xt1 = t; β1 Xt1 Î linear trend effect
Xt2, Xt3 , Xt4 are indicator var; β2 Xt 2+β Xt 3 +β4 Xt4 Î quarterly seasonal effect
Xt-1,5 is a cyclical indicator series lagged one quarter Î cyclical effect
4
25.2 Regression models auto-correlated error terms
• errors in different time period may be correlated Î auto-correlated (or serially
correlated)
• auto-correlation due to omission of key variable(s) or persistence of major
random effects
• first-order autoregressive error model (error comprising preceding and present
random disturbances)
εt= ρεt-1 +ut
where
ρ = autocorrelation parameter (correlation between εt & εt-1); -1<ρ<1
ut ~ N(0, σ)
• if autocorrelations existent,
existent and is ignored Î inefficient LS regression coefficient;
severe underestimation of variances by MSE; statistical procedures/tests no
longer applicable
5
• detection of existence of autocorrelation e.g. test for ρ>0 using Durbin-Watson
test in first
st order
o de auto
autoregressive
eg ess e eerror
o model;
ode ; runs
u s test (when
( e number
u be of
o residuals
es dua s
is large)
• dealing with autocorrelated series Î for large, positively autocorrelated error
terms (ρÎ1), transform the variables by Method of first differences
Y’t= β1 X’t + ut when ρ=1 (linear regression through origin)
where
Y’t = Yt - Yt-1
X’t = Xt - Xt-1
ut ~ N(0, σ)
6
25 1
25.1 E
Exponential
ti l smoothing
thi for
f stationary
t ti time
ti series
i
• Techniques for handling forecasting applications that require forecasts for a large
number of time series on a frequent basis
• Based on Holt-Winters exponential smoothing system
Stationary time series (no T,S,C components)
• Stationary
y series Î consecutive Y1, …,Y
, i,,,…,, Yn observations are outcomes of
random variables that have the same probability distribution
• Exponential smoothing procedure for stationary time series (starting value A0)
Update smoothed estimate: At = aYt+(1-a)A
+(1 a)At-1
where:
At is smoothed estimate for current period t
At-1is smoothed estimate for period (t-1)
Yt is observation for current period t
‘a’ is smoothing constant, 0<a<1
7
• Forecasting procedure for stationary time series
F
Forecast
t for
f period
i d t+k:
t k Ft+k= At k 12
k=1,2,…
where:
Ft+k is forecast for k periods ahead
At is smoothed estimate for current period t
8
(1) (2)
A0=4000;;
a=0.10
Week, t Yt At
1 3169 3917
2 3682 3893
. . .
16 3719 4224
17 5707 4372
18 4580 4393
Week, t Ft+k
+k
19 4393
20 4393
21 4393
9
Properties of exponential smoothing model
• Weighting of observations, with geometrically declining weights for observations
further back into the past
At = aYt+(1-a)At-1 ; At-1 = aYt-1+(1-a)At-2
Î At= aYt+(1
+(1-a)[aY
a)[aYt-1
t 1+(1
+(1-a)A
a)At-2
t 2] = aYt+a(1
+a(1-a)Y
a)Yt-1
t 1+(1 a)2At-2
+(1-a) t2
generalised function
At= aYt+a(1-a)Yt-1+a(1-a)2Yt-2+… + a(1-a)t-1Y1 + a(1-a)tA0
• Responsive adaptive capability, whereby weighted moving average property (with
declining weight for older observations) permits responding effectively to changes
along the series
• Economical data storage, as only At-1 is required to be stored for updating At in
the next period
10
Selection of starting value (A0) and smoothing constant (‘a’)
• A0 may be set equal to mean of a few observations from immediate past, or
based on an informed judgement
• Value of smoothing constant (‘a’) a trade-off between responsiveness (overly
small ‘a’ gives sluggish adaptability) versus undue influence by recent/current
values (overly large ‘a’ gives excessive responses)
• Test different ‘a’ values Î smallest forecasting errors; ‘a’ can be varied for
different periods, as situation changes; commonly used value: 0.10-0.30
11
25.1 Exponential smoothing for time series with trend component
• Requires two steps for each observation: one for smoothed estimate, one for
trend estimate
Step 1: update smoothed estimate: At = aYt+(1-a)(At-1+Bt-1)
Step 2: update trend estimate: Bt = b(At - At-1)+(1-b) Bt-1
where:
Bt is trend estimate for current period t
Bt-1 is trend estimate for period (t-1)
b is
‘b’ s trend
e d adjus
adjustment
e coconstant
sa ,0 0<b<1
b
• Forecasting
Forecast for period t+k: Ft+k= At + kBt
where:
Ft+k is forecast for k periods ahead
At is smoothed estimate for current period t
Bt is trend estimate for current period t
12
(1) (2) ( 3) B0=-
A0=6.7758;
=6 7758; 0 0692;
0.0692;
a=0.10 b=0.20
Year, t Yt At Bt
1 6.63 6.6989 -0.0707
0.0707
2 6.59 6.6244 -0.0715
. . . .
28 4.79 4.8354 -0.0759
29 4.73 4.7566 -0.0765
30 4.76 4.6881 -0.0749
A1 0.10(6.63)+0.90(6.7758
A1=0 10(6 63)+0 90(6 7758-0
0.0692)
0692)=6
6.6989
6989
B1=0.20(6.6989-6.7758)+0.80(-0.0692)=-0.0707
F35=4.6881+5(-0.0749)=4.314
13
Selection of starting value (B0) and weighting constant (‘b’)
• Same considerations as discussed in preceding section
• slope of fitted trend line on past observations can be used as B0
• ‘a’ and ‘b’ need not be the same; commonly used value: 0.10-0.30
14
25.1 Exponential smoothing for time series with trend and seasonal
components
• Requires three steps for each observation: one for smoothed estimate, one for
trend estimate
Step 1: update smoothed estimate: At = a(Yt –C
Ct-p
t p) + (1-a)
(1 a) (At-1
t 1 +Bt-1
t 1)
15
• Forecasting
Forecast for period t+k: Ft+k= At + k Bt + C
where:
Ft+k is forecast for k periods ahead
At is smoothed estimate for current p
period t
Bt is trend estimate for current period t
C is the current seasonal component estimate corresponding to seasonal
phase
h off period
i d (t+k)
16