Professional Documents
Culture Documents
Examples:
The constant mean model: zt = + t
The linear trend model: zt = 0 + 1t + t
Trigonometric models for seasonal time series
zt = 0 + 1 sin
2
2
t + 2 cos t + t
12
12
j=1
t=1
1X
= z =
zt
n t=1
The l-step-ahead forecast of zn+l from time origin n by
n
X
1
zn(l) = z,
2 =
(zt z)2
n 1 t=1
2
E[zn+l zn(l)] = 0, E
= , E[zn+1 zn(l)] =
1+
1
n
Updating Forecasts
1
1
(z1 + z2 + + zn + zn+1) =
[zn+1 + n
zn(1)]
n+1
n+1
n
1
=
zn(1) +
zn+1
n+1
n+1
1
(zn+1 zn(1))
= zn(1) +
n+1
zn+1 =
rk =
(zt z)(ztk z)
t=k+1
n
P
k = 1, 2, . . .
(zt z)2
t=1
If
36,762
36,742
33,385
34,171
36,124
38,658
32,901
36,356
32,926
35,697
34,548
32,087
38,902
37,858
32,926
35,697
34,548
32,087
37,515
38,629
32,019
35,710
36,693
37,153
Figure 3.1: Annual U.S. lumber production from 1947 to 1976(in millions of
board feet)
4
x 10
3.9
3.8
3.7
3.6
3.5
3.4
3.3
3.2
3.1
3
1950
1955
1960
1965
Year
1970
1975
1980
1
.20
2
-.05
3
.13
4
.14
5
.04
6
-.17
The forecast from the constant mean model are the same for all forecast lead
times and are given by
z1976(l) = z = 35, 652
The standard error of these forecast is given by
p
1 + 1/n = 2071
A 95 percent prediction interval is given by
[35, 652 (2.045)(2071)] or
If new observation become available, the forecasts are easily updated. For
example if Lumber production in 1977 was 37,520 million board feet. Then
the revised forecasts are given by
1
z1977(l) = z1976(1) +
[z1977 z1976(1)]
n+1
1
= 35, 652 + [37, 520 35, 652]
31
10
= 35, 712
n1
X
t=0
11
12
,
Sj = (1 w)zj + wSj+1
= zn ,
Sn+1
S0 = z0 = S1 = (1 w)z1 + wS2
Choice of the Smoothing Constant: = 1 w
et1(1) = zt zt1(1) = zt St1,
Then minimize
SSE() =
e2t1(1).
13
14
It+1 It
It+1
100 100 log
It
It
1
.25
2
.32
3
.18
4
.35
5
.18
6
.22
15
6000
5000
4000
3000
2000
1000
1950
1955
1960
1965
Year
1970
1975
1980
16
Growth rates of Iowa nonfarm income, second quarter 1948 to fourth quarter 1979
5
1950
1955
1960
1965
Year
1970
1975
1980
17
t=1
rk =
t=k
n1
P
n1
,
[et(1) e]2
1X
e =
et(1).
n t=0
t=0
1X
2
s =
[et(1) e]2
n t=0
18
19
20
21
22
m
X
i=1
m
X
i=1
f (n + j) = Lnf (j) = Ln .
Examples: Constant Mean Model, Linear Trend Model, Quadratic Trend
Model, k th order Polynomial Trend Model, 12-point Sinusoidal Model
23
Pn
n1
X
X0 = (f (n + 1), . . . , f (0))
f (j)f 0(j)=F
n,
X0 y =
j=0
n1
X
f (j)znj =h
n
j=0
= F1hn.
n
n
Prediction
, Var(en(l)) = 2[1 + f 0(l)F1f (l)],
zn(l) = f 0(l)
n
n
n1
X
1
2
)2.
=
(znj f 0(j)
n
n m j=0
100(1 )% CI :
zn(l) t/2(n m)
[1 + f (l)F
1
2
f (l)] .
24
=
F
n+1
n+1 hn+1 .
hn+1 =
n
X
f (j)zn+1j = f (0)zn+1 +
j=0
n1
X
f (j 1)znj
j=0
= f (0)zn+1 +
n1
X
j=0
zn+1(l) = f 0(l)
n+1 .
25
wj [znj f 0(j)]2
j=0
The constant w(|w| < 1) is a discount factor the discount past observation
exponentially.
Define
W = diag(wn1 wn2 w 1);
n1
X
0
Fn=X
WX =
wj f (j)f 0(j)
j=0
hn=X
0Wy =
n1
X
j=0
wj f (j)znj
26
n
n
.
zn(l) = f 0(l)
n
hn+1 =
n
X
j=0
=
F
f
(0)z
+
[L
F
f
(0)f
(0)L
] n
n+1
n+1
zn+1(l) = f 0(l)
n+1 .
27
F =
1 0
.
1 1
P j "
P 2jwj
=
j w
f (j) = [1 j]0, L =
wj f (j)f 0(j) =
P j
Pw j
jw
n1
P
1
1w
w
(1w)2
w
(1w)2
w(1+w)
(1w)2
j=1
"
= F1hn =
1w
2
2
(1 w)
(1 w)
(1w)3
w
#
P j
Pw zjnj
jw znj
28
Thus
0,n = (1 w )
1,n = (1 w)2
w znj (1 w)
jwj znj
3X
(1
w)
wj znj
jwj znj
w
In terms of smoothing
Sn[1]
= (1 w)zn +
[1]
wSn1
wj znj ,
X
2
= (1 w)
(j + 1)wj znj ,
= (1 w)
[2]
[k]
29
Updating:
0,n+1 = 0,n + 1,n + (1 w2)[zn+1 zn(1)],
1,n+1 = 1,n + (1 w)2[zn+1 zn(1)];
Or in another combination form:
0,n+1 = (1 w2)zn+1 + w2(0,n + 1,n),
1w
2w
1,n+1 =
(0,n+1 0,n) +
1,n.
1+w
1+w
1
zn+1 zn(1) =
(0,n+1 0,n 1,n).
2
1w
30
Implementation
[2]
[1]
S0
[2]
S1
w
1,0,
1w
2w
1,0;
= 0,0
1w
= 0,0
where the (0,0, 1,0) are usually obtained by considering a subset of the
data fitted by the standard model
zt = 0 + 1t + t.
Choice of the Smoothing Constant = 1 w The smoothing constant
is chosen to minimize the SSE:
X
SSE() =
(zt zt1)2
2
X
[1]
[2]
=
zt 2 +
St1 + 1 +
St1 .
1
1
31
32
33
400
Thermostat Sales
350
300
250
200
150
100
0
10
15
20
25
30
Week
35
40
45
50
55
34
35
36
37
38
40
41
42
s
X
iINDti
i=1
2i
St =
Ai sin(
t + i).
s
i=1
where Ai and i are amplitude and the phase shift of the sine function with
frequency fi = 2i/s.
44
ti X
zt = 0 +
i +
iINDti + t.
i!
i=1
i=1
Since it uses s + 1 parameters ( 0 and s seasonal indicators) to model s
seasonal intercepts, restrictions have to be imposed before the parameters can
be estimated. Several equivalent parameterizations are possible
Omit the intercept: 0 = 0.
Restrict
Ps
i=1 i
= 0.
45
s1
ti X
zt = 0 +
i +
iINDti + t.
i!
i=1
i=1
0 = (0, 1, . . . , k , 1, . . . , s1);
Hence
= (XX0)1X0y,
zn(l) = f 0(n + l)
100(1 )% prediction interval
0
0 1
zn(l) t/2(n k s)
[1 + f (n + l)(XX )
where
n
X
1
2.
2 =
(zt f 0(t))
n k s t=1
1
2
f (n + l)] ,
46
Fn =
n1
X
f (j)f 0(j),
, hn =
j=0
n1
X
f (j)znj .
j=0
zn(l) = f 0(l)
100(1 )% prediction interval
1
2
zn(l) t/2(n k s)
[1 + f 0(l)F1
n f (l)] ,
47
It can be shown that the forecast or fitting functions follow the difference
equation f (j) = Lf (j 1), where L is a (k + s) (k + s) transition matrix
L=
L11 0
L21 L22
zn+j
j2 X
= 0 + 1 + 2 +
iINDji + n+j
2
i=1
Then the transition matrix L and the initial vector f (0) are given by
L11
1 0 0
= 1 1 0
1/2 1 1
L21
1 0 0
= 0 0 0
0 0 0
L22
1 1 1
0
0
= 1
0
1
0
m
ti X
2i
zt = Tt + St + t = 0 +
i +
Ai sin
t + i + t,
i!
s
i=1
i=1
where the number of harmonics m should not goes beyond s/2, i.e. half the
seasonality. Monthly, quarterly data; s/2 harmonics are usually not necessary
This is illustrated in Figure, where we plot
E(zt) =
2
X
i=1
Ai sin
2i
t + i
12
49
50
2j
2j
+ 21 cos
+ n+j
12
12
In this case:
1 0
0
3/2 1/2 ,
L= 0
0 1/2
3/2
1
f (0) = 0
1
2j
2j
4j
4j
= 0 +1j +11 sin
+21 cos
+12 sin
+22 cos
+n+j
12
12
12
12
51
S(, n) =
n1
X
wj [znj f 0(j)]2
j=0
updating:
0
n+1 = L n + F
f (0)[zn+1 zn(1)],
(F =
wj f 0(j)f (j))
j0
53
n
X
[zt zt1(1)]2
t=1
After estimating the smoothing constant , one should always check the
adequacy of the model. The sample autocorrelation function of the onestep-ahead forecast errors should be calculated . Significant autocorrelations
indicate that the particular forecast model is not appropriate.
54
zn+j = 0 + 1j +
3
X
i=1
L=
1
1
1
0
0
0 0
0
0
1 0
0
0
0 1 1 1
0 1
0
0
0 0
1
0
=
L
+
F
f (0)[zn+1 zn(1)]
n+1
n
1
1w
F=
w3
1w4
w3 (3+w4 )
(1w4 )2
w3
1w4
w
(1w)2
w(1+w)
(1w)3
symmetric
w2
1w4
w2 (2+2w4 )
(1w4 )2
w
1w4
w(1+3w4 )
(1w4 )2
w2
1w4
0
w
1w4
Implications of 1
In this situation F singular as w 0. But we have that
1
lim F
w0
= f =
s1
1 1 2
1, , , , ,
s s s
s
0
;
n(1)];
n+1 = L n + f [zn+1 z
zt = 0 + 1t +
11
X
iINDti + t.
i=1
57
30
25
20
15
10
0
1960
1961
1962
1963
58
59
60
61
62
63
64
zt = ln yt = 0 + 1 +
3
X
iINDti + t
i=1
65
40
35
30
25
20
15
10
5
0
1964
1966
1968
1970
1972
1974
1976
Year
Figure: Quarterly new plant and equipment expenditure in U.S. industries (in billions
of dollars), first quarter 1 to fourth quarter 1976
66
3.4
3.2
3
2.8
2.6
2.4
2.2
1964
1966
1968
1970
1972
1974
1976
Year
Logarithm of quarterly new plant and equipment expenditures,
frist quarter 1964 to fourth quarter 1976
67
68
69
70
71
72
73
74