Professional Documents
Culture Documents
1 / 36
Outline of the lecture
2 / 36
Predictions In Time Series
3 / 36
Exponential smoothing
The constant c is chosen so that the weights sum to one, which implies
that c = (1 − λ)/(1 − λN ).
When N is large c ≈ 1 − λ:
4 / 36
Exponential Smoothing and prediction
Y
bN +`|N = µ̂N
bN +`+1|N +1 = (1 − λ)YN +1 + λY
Y bN +`|N
5 / 36
Simple Exponential Smoothing
For large N :
µ̂N +1 = (1 − λ)YN +1 + λµ̂N
SN = (1 − λ)YN + λSN −1
is called the simple exponential smoothing or first order exponential
smoothing of the time series Y.
I The smoothing constant α = 1 − λ (or the forgetting factor λ)
determines how much the latest observation influence the prediction.
6 / 36
Choice of smoothing constant α = 1 − λ
7 / 36
Example – wind speed 76 m a.g.l. at DTU Risø
I Measurements of wind speed every 10th minute
I Task: Forecast up to approximately 3 hours ahead using exponential
smoothing
25
10min. avg. of wind speed (m/s)
20
15
10
5
Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar Apr May Jun Jul Aug Sep
2002 2003
8 / 36
S (α) for horizons 10 and 70 minutes
10 minutes 70 minutes
50000
100000
40000 95000
SSE
SSE
90000
30000
85000
20000
80000
9 / 36
S (α) for horizons 130 and 190 minutes
145000 186000
184000
140000 182000
SSE
SSE
180000
135000 178000
176000
130000
174000
10 / 36
Example of forecasts with optimal α
Measurements
10 minute forecast
190 minute forecast
14
12
10
8
6
4
12:00 14:00 16:00 18:00 20:00 22:00 0:00 2:00 4:00 6:00 8:00 10:00 12:00
Jan 11 2003 Jan 12 2003 11 / 36
From global to local trend models
YN +j = f T (j )θ + εN +j
F N +1 = F N + f (−N )f T (−N )
h N +1 = L−1 h N + f (0)YN +1
θbN +1 = F −1
N +1 h N +1
12 / 36
Local trend models
j =0
Weight
0.4
0.0
0 5 10 15 20 25 30
j (age of observation)
13 / 36
WLS formulation
The criterion:
N
X −1
S (θ; N ) = λj [YN −j − f T (−j )θ]2
j =0
14 / 36
WLS solution
−1 −1
θbN = (x T
NΣ x N )−1 x T
NΣ Y
or
θbN = F −1
N hN
N
X −1
FN = λj f (−j )f T (−j )
j =0
N
X −1
hN = λj f (−j )YN −j
j =0
15 / 36
Updating the estimates when YN +1 is available
F N +1 = F N + λN f (−N )f T (−N )
h N +1 = λL−1 h N + f (0)YN +1
θbN +1 = F −1
N +1 h N +1
16 / 36
Variance estimation in local trend models
Define the total memory
N −1
X 1 − λN
T = λj =
j =0
1−λ
17 / 36
Global and Local Trend Models - an Example
6 observations (N = 6):
4.0
3.5
3.0
y
2.5
2.0
1 2 3 4 5 6
18 / 36
Global Linear Trend:
T
YN +j = θ0 + θ1 j + εN +j ⇒ f (j ) = 1 j
Linear Model form:
2.0 1 −5
ε1
2.5 1 −4 ε2
3.5 1 −3 θ0 + ε3 ⇔ y = x 6 θ + ε
=
3.0 1 −2 θ1
ε4
4.0 1 −1 ε5
3.5 1 0 ε6
19 / 36
Global linear trend: Estimation
6 −15
F6 = xT
6 x6 =
−15 55
18.5
h6 = xT
6 y =
−40.5
0.5238 0.1429 18.5 3.905
θb6 = F −1
6 h6 = =
0.1429 0.0571 −40.5 0.329
20 / 36
Global linear trend: Prediction
Linear predictor:
Prediction error:
ε6 (`) = Y6+` − Y
b6+`|6
b2 1 + f T (`)F −1
Var(ε
d 6 (`)) = σ 6 f (`)
For example,
d 6 (1)) = 0.6192 .
b7|6 = 4.234 with Var(ε
Y
21 / 36
Global linear trend: Estimation - global linear trend
5.5
5.0
4.5
4.0
y
3.5
3.0
2.5
2.0
1 2 3 4 5 6 7
22 / 36
Global linear trend: Updating the parameters
F7 = F 6 + f T (−6)f (−6)
6 −15 1 7 −21
= + 1 −6 = ,
−15 55 −6 −21 91
h7 = L−1 h 6 + f (0)y 7
−1
1 0 18.5 1 22
= + 3.5 = ,
1 1 −40.5 0 −59
0.4643 0.1071 22 3.896
θb7 = = .
0.1071 0.0357 −59 0.250
23 / 36
Global linear trend: Updating - global linear trend
5.5
3.5
3.0
2.5
2.0
1 2 3 4 5 6 7
24 / 36
Local linear trend: Estimation
b2 1 + f T (1)F −1
2
Var(ε
d 6 (1)) = σ 6 f (1) = 0.697
25 / 36
Local linear trend: Predicting for t = 7
5.5
Global trend
Local trend
5.0
4.5
4.0
y
3.5
3.0
2.5
2.0
1 2 3 4 5 6 7
26 / 36
Local linear trend: Estimating σ̂ 2
I We can use the WLS estimator for θ̂N
I but not for σ̂ 2 !?!
I Reason: Local trend models assume that t are i.i.d.
I The proposed estimator:
I Note that the first n predictions are ignored to stabilize the estimator
I Note that the prediction errors are normed.
27 / 36
Local linear trend: Estimation
4.0
2.5
2.0
1 2 3 4 5 6 7
29 / 36
The forward shift F and difference ∇
30 / 36
The summation S
32 / 36
Examples of combined operators
I ∇−1 :
∞ ∞
1 X
−1 1 X
= zi so ∇ = = Bi = S
1−z i=0
1−B i=0
I Operator polynomial of order q:
q
X
θ(z ) = θi z i
i=0
θ(B ) = (1 + θ1 B + · · · + θq B q )
where θ0 is chosen to be 1
33 / 36
The Cauchy product (discrete convolution)
The equation
π0 = λ0 ψ0
π1 = λ1 ψ0 + λ0 ψ1
..
.
πi = λi ψ0 + λi−1 ψ1 + . . . + λ0 ψi
..
.
34 / 36
Multiplying combined operators
Theorem 4.13
35 / 36
Highlights
PN −1
I Local trend model: S (θ; N ) = j =0 λj [YN −j − f T (−j )θ]2
I Iterative updates
N
X −1
FN = λj f (−j )f T (−j )
j =0
N
X −1
hN = λj f (−j )YN −j
j =0
θbN = F −1
N hN
36 / 36