Professional Documents
Culture Documents
1 / 18
Outline of the lecture
2 / 18
Trend models
3 / 18
Linear trend - A motivation
4 / 18
Linear trend in a general setting
5 / 18
Trend models in general
I Model: YN +j = f T (j )θ + εN +j
I Requirement: f (j + 1) = Lf (j )
I Initial value: f (0)
I In Section 3.4 some trend models which fulfill the requirement above are listed.
I Constant mean: YN +j = θ0 + εN +j
I Linear trend: YN +j = θ0 + θ1 j + εN +j
2
I Quadratic trend: YN +j = θ0 + θ1 j + θ2 j2 + εn+j
2 k
I k ’th order polynomial trend: Yn+j = θ0 + θ1 j + θ2 j2 + · · · + θk jk ! + εN +j
I Harmonic model with the period p: YN +j = θ0 + θ1 sin 2π 2π
p j + θ2 cos p j + εN +j
6 / 18
Estimation
I Model equations written for all observations Y1 , . . . , YN
YN = x N θN + ε
T
Y1 f (−N + 1) ε1
Y2 f T (−N + 2) ε2
.. = θN +
.. ..
. . .
YN f T (0) εN
I OLS-estimates:
−1 T −1
θbN = (x T
N x N ) x N Y N = F N hN
N
X −1
FN = xT
NxN = f (−j )f T (−j )
j =0
N
X −1
hN = x T
NY = f (−j )YN −j
j =0
7 / 18
`-step prediction
I Prediction:
bN +`|N = f T (`)θbN
Y
8 / 18
Updating the estimates when YN +1 is available
I Task:
I Going from estimates based on t = 1, . . . , N , i.e. θbN to
I estimates based on t = 1, . . . , N , N + 1, i.e. θbN +1
I without redoing everything. . .
I Solution:
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
9 / 18
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
10 / 18
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
11 / 18
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
12 / 18
Global linear trend: Estimation with R
F6 <- t(x)%*%x
h6 <- t(x)%*%y
(th.hat6 <- solve(F6, h6))
## [,1]
## [1,] 3.9047619
## [2,] 0.3285714
## check
(lm(y~0+x))
##
## Call:
## lm(formula = y ~ 0 + x)
##
## Coefficients:
## x1 x2
## 3.9048 0.3286
13 / 18
Global linear trend: Estimation - global linear trend
5.0
4.5
4.0
3.5
y
3.0
2.5
2.0
1 2 3 4 5 6 7
t
14 / 18
Global linear trend: Prediction
Linear predictor:
15 / 18
Global linear trend: Prediction Error
ε6 (`) = Y6+` − Y
b6+`|6
b2 1 + f T (`)F −1
Var(ε
d 6 (`)) = σ 6 f (`)
0.5238 0.1429 1
= 0.4532 1 + 1 `
0.1429 0.0571 `
= 0.4532 (1.5238 + 0.2858` + 0.0571`2 )
For example,
d 6 (1)) = 0.6192 .
b7|6 = 4.234 with Var(ε
Y
90% prediction interval:
q
b7|6 ± t0.05 (6 − 2) Var(ε
Y d 6 (1)) = 4.234 ± 1.320
16 / 18
Global linear trend: Estimation - global linear trend
5.0
4.5
4.0
3.5
y
3.0
2.5
2.0
1 2 3 4 5 6 7
t
17 / 18
Global linear trend: Updating the parameters
F7 = F 6 + f (−6)f T (−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
18 / 18