Sie sind auf Seite 1von 42

Further Time Series

4. Trends, Cycles and Seasonality


Time Series
Andrew Harvey
January 2014
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 1 / 84
Trend-cycle models
The trend plus cycle plus noise model is
y
t
=
t
+
t
+
t
, t = 1, ..., T
Fitting a trend plus cycle model provides more scope for identifying
turning points and assessing their signicance. Dierent denitions of
turning points- for example a change in sign of the cycle, a change in sign
of its slope or a change in sign of the slope of the cycle and the trend
together - see Harvey, Trimbur and van Dijk (JE, 2008).
Cyclical trend model incorporates the cycle into the slope by moving it to
the equation for the level:

t
=
t1
+
t1
+
t1
+
t
The reduced form is ARIMA(2,2,4).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 2 / 84
The NBER denes a turning point in the business cycle in terms of
negative growth rates. On the other hand, a turning point may be dened
with respect to the growth cycle or output gap. Growth cycles are
recurrent uctuations in the series of deviations from trend. Thus, growth
cycle contractions include slowdowns as well as absolute declines in
activity, whereas business cycles contractions includes only absolute
declines (recessions).
See
papers by Pagan and Harding and discussion in Kydland and Prescott (1990;
http://www.minneapolisfed.org/publications_papers/pub_display.cfm?id=225)
Correlated disturbances Oh, Zivot and Creal (JE, 2008) argue that
GDP is best modelled with cycle and level disturbances correlated. The
smoother will not be symmetric.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 3 / 84
Trend-cycle models :State space form
y
t
= [1 0 1 0 ]
t
+
t

t
=
_

+
t
_

_
=
_

_
1 1
0 1
0
0
cos
c
sin
c
sin
c
cos
c
_

_
_

t1

t1

t1

+
t1
_

_
+
_

+
t
_

_
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 4 / 84
Figure: Trend in US GDP
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 5 / 84
Figure: Cycle in US GDP
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 6 / 84
Trend-cycle models
Figure shows the annualised underlying growth rate (the estimate of the
slope times four) and the fourth dierences of the (logarithms of the)
series. The latter is fairly noisy, though much smoother than rst
dierences, and it includes the eect of temporary growth emanating from
the cycle. The growth rate from the model, on the other hand, shows the
long term growth rate and indicates how the prolonged upswings of the
1960s and 1990s are assigned to the trend rather than to the cycle.
(Indeed it might be interesting to consider tting a cyclical trend model
with an additive cycle). The estimate of the growth rate at the end of the
series is 2.5%, with a RMSE of 1.2%, and this is the growth rate that is
projected into the future.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 7 / 84
Figure: Smoothed estimates of slope of US per capita GDP and annual
dierences.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 8 / 84
Phillips curve
Resurgence of interest in the Phillips curve (1958).
Originally wages and unemployment, but now most often prices and the
output gap.
JME 2005, special issue.
Harvey, A.C. (2011) Modelling the Phillips curve with Unobserved
Components, Applied Financial Economics (21, 7-17).
Lee and Nelson (2007, JAE). Gordon (Economica, 2011).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 9 / 84
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 10 / 84
Preliminary modelling and stylised facts
Output is measured by the logarithm of quarterly real U.S. Gross Domestic
Product (GDP), denoted y
t
.
The (annualized) rate of ination,
t
, is measured as the rst dierences
of the quarterly CPI multiplied by four.
Begin with an exploration of the relationship between ination and output
based on tting univariate UC trend-cycle models
y
t
=
t
+
t
+
t
, t = 1, ..., T
The UC models yield a decomposition into persistent and transitory
movements.
For GDP trend is an integrated random walk.
For ination it is a random walk.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 11 / 84
Figure: Ination and its decomposition into stochastic level, cycle and seasonal
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 12 / 84
Figure: Smoothed estimates of the cycles obtained from the univariate models
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 13 / 84
Phillips Curve
Output gap obtained by extracting a cycle from a univariate model of
GDP. Then

t
=
t
+ x
t
+
t
,
t
~ NID
_
0,
2

_
, t = 1, ..., T
where
t
is an unobserved random walk.
Since x
t
is stationary, the long-run forecast is the current expected value of

t
and so is a measure of core ination.
Later will estimate Phillips curve from a bivariate system in which the
output gap and ination gap are modelled jointly.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 14 / 84
Weighting patterns in the local linear trend model
The local linear trend model is
y
t
=
t
+
t
, t = 1, ..., T

t
=
t1
+
t1
+
t

t
=
t1
+
t
where
t
,
t
and
t
are mutually uncorrelated white-noise disturbances
with variances
2

,
2

and
2

respectively.
The reduced form is ARIMA(0, 2, 2). For the IRW trend model,
2

= 0
(but
2

> 0 )
w(L) =

2

+[1 L[
4

=

2

2
[1 +
1
L +
2
L
2
[
2
. (1)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 15 / 84
Weighting patterns in the local linear trend model
By equating the autocovariances at lags one and two it can be shown that
the reduced form parameters satisfy
1
= 4
2
/(1 +
2
), with
0 _
2
< 1 and 2 <
1
_ 0. The roots of the polynomial
1 +
1
L +
2
L
2
are complex. Since 1/

1 +
1
L +
2
L
2

2
is the ACGF of
an AR(2) process, it follows that the weights decay according to a damped
sine wave with frequency cos
1
[
1
/2
_

2
]; see Box and Jenkins (1976,
p.59). The initial slow decline of the weights contrasts with the
exponential decline of the weights for a random walk trend.
The value of

= 0.025 corresponds to the lter proposed by Hodrick


and Prescott (1997) for quarterly observations. For this case Hodrick and
Prescott (1997) and Singleton (JME,1988) give weights
w
k
= 0.8941
k
(0.0562 cos 0.112k + 0.0558 sin 0.0112k)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 16 / 84
Figure: Local level weights
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 17 / 84
Figure: Local linear trend weights
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 18 / 84
Weighting patterns in the local linear trend model*
In the more general case when
2

is not necessarily zero


w(L) =

2

+[1 L[
2

+[1 L[
2

+[1 L[
4

=

2

1 +

2
[1 +
1
L +
2
L
2
[
2
where the numerator is obtained from the reduced form of the trend
component, which is such that
2

t
is an MA(1) with MA parameter

and disturbance variance


2

. The structural model with mutually


uncorrelated disturbances implies that only a small part of the invertibility
region of the reduced form ARIMA(0, 2, 2) parameter space is admissible;
see FSK p.69.
Weights sum to one as w(1) = 1.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 19 / 84
Moving averages
Economic time series very fragile - all operations have a potentially
distorting eect.
Moving averages Suppose a trend is constructed as a moving (rolling)
average of n = 2r + 1 consecutive data points, that is
m
t
= M
n
(L)y
t
=
r

j =r
w
j
y
tj
.
The sum of the weights is normally unity, ie M
n
(1) = 1, if the aim of the
lter is trend extraction.
The frequency response function is M
n
(e
i
). Its absolute value, the gain,
will be denoted as M
n
().
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 20 / 84
Moving averages
Consider a simple moving average with
w
j
= 1/n, j = r , ..., r . (2)
The gain is found to be
M
n
() =

1
n
+
2
n
r

j =1
cos j

sin(n/2)
n sin(/2)

(3)
where the last expression follows from standard trigonometric identities as
in Harvey (1993, pp 193-5); note that M
n
() = 1 at = 0. The lter will
remove a cycle of period n, together with its harmonics. Figure illustrates
this point for n = 7: the gain is zero at the fundamental frequency, 2/7,
and at its harmonics 4/7 and 6/7.
For future reference note that, for M
n
(L) in (2),
nM
n
(L)L
r
= S
n
(L) = 1 +L +L
2
+ ... +L
n1
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 21 / 84
Figure: Gain for 7 period moving average
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 22 / 84
Moving averages
Detrending
Weights in a trend extraction lter sum to one. Conversely, a detrending
lter has weights that sum to zero. The detrended series corresponding to
a trend extraction lter of the form M
n
(L) is
y
+
t
= y
t
M
n
(L)y
t
= [1 M
n
(L)]y
t
= M
+
n
(L)y
t
, r = 1, 2, ..
Thus the weights in M
+
n
(L) are w
+
0
= 1 w
0
and
w
+
j
= w
j
, j = 1, .., r .
Any symmetric detrending moving average with weights summing to zero,
that is M
+
n
(1) = 0, will give a stationary series provided the order of
integration, d, does not exceed two.
Proof. Since w
+
0
= 2

r
j =1
w
+
j
M
+
n
(L) = w
+
0
+
r

j =1
w
+
j
(L
j
+L
j
) =
r

j =1
w
+
j
(2 L
j
L
j
) (4)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 23 / 84
Moving averages
Detrending
(Proof contd) Now
2 L
j
L
j
= (1 L
j
)(1 L
j
)
and 1 L
j
= (1 L)S
j
(L), where S
j
(L) = 1 +L + ... +L
j 1
. Thus
M
+
n
(L) = (1 L)(1 L
1
)
r

j =1
w
+
j
S
j
(L)S
j
(L
1
), r = 1, 2, ..(5)
= (1 L)(1 L
1
)
r

j =1
w
+
j
j 1

h=(j 1)
(j [h[)L
h
.
See, for example, Baxter and King (1999, p592).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 24 / 84
Moving averages
Detrending
If y
t
is an I (d) process with d = 0, 1 or 2, the a.c.g.f. of y
+
t
is given by
g
+
(L) = [M
+
n
(L)[
2
[1 L[
2d
g
(d)
y
(L)
= [1 L[
2(2d)

j =1
w
+
j
j 1

h=(j 1)
(j [h[)L
h

2
g
(d)
y
(L)
where g
(d)
y
(L) is the a.c.g.f. of
d
y
t
. The term [1 L[
2d
is cancelled
out by the factor [1 L[
4
= (1 L)
2
(1 L
1
)
2
that appears in [M
+
n
(L)[
2
.
Term in summation is a nite MA polynomial.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 25 / 84
Moving averages
Detrending
The spectrum of the detrended series, corresponding to the acgf, g
+
n
(L) ,
is:
f
+
n
() = (2 2 cos )
2d

j =1
w
+
j
j + 2
r

j =1
w
+
j
j 1

h=1
(j h) cos h

2
f
(d)
y
() ,
for d = 0, 1, 2, where f
(d)
y
() is the spectrum of
d
y
t
.
1) The detrended series is strictly non-invertible for d = 1 or 0 because
there are unit roots in g
+
(L) .
2) The result continues to hold if there is a deterministic linear trend as
this is eliminated by the lter.
3) Detrending lters for d > 2 can be constructed.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 26 / 84
Moving averages
Detrending: FRF and gain
The frequency response function showing the eect of the lter on the
d th dierence of the series is real (since it is symmetric ) and when the
w
+/
j
s, j = 1, .., r are negative (as with a simple MA), so the corresponding
w
/
j
s are positive, it is everywhere non-negative - as is apparent from the
formula below, obtained from writing (4) as M
+
n
(L) =

r
j =1
w
+
j
[1 L[
2
- and so equal to the gain, denoted M
+
n
(; d) :
M
+
n
(; d) = M
+
n
(e
i
)/(2 2 cos )
d/2
=
r

j =1
w
+
j
(2 2 cos j )/(2 2 cos )
d/2
, d = 0, 1, 2.
The corresponding formula from (5) is
M
+
n
(; d) = (2 2 cos )
1d/2
_
r

j =1
w
+
j
j + 2
r

j =1
w
+
j
j 1

h=1
(j h) cos h
_
NB If d < 2, then M
+
n
(0; d) = 0 indicating noninvertibility.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 27 / 84
Simple moving average and its complement
For the detrending lter corresponding to the simple moving average,
w
j
= 1/n, j = r , ..., r ,
M
+
n
(; d) =
n sin(/2) sin(n/2)
2
d
n[sin(/2)]
d+1
d = 0, 1, 2.
Note that 2(1 cos ) = 4 sin
2
(/2). Figure shows the gain for a
stationary series when n = 13. The fact that for d = 0 the gain is zero at
zero frequency, and close to zero at frequencies nearby, is indicative of the
detrending nature of the lter.
The original moving average has the opposite eect in that it extracts the
trend; it also damps down high frequencies and removes power associated
with cyclical movements of period 13 because it is zero at = 2/13 and
at its harmonics = 2j /13, j = 2, ..., 6.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 28 / 84
Figure: Gain for thirteen period MA and corresponding detrending lter
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 29 / 84
Figure: Gains for thirteen period MA for d = 0 and d = 1 (dashed line)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 30 / 84
The gain for d = 1 is still zero at the origin, but the higher frequencies
present in the dierenced series are dampened down and there is a peak
located at a frequency that corresponds to a period of about 13. In fact
Osborn (1995) shows that for low frequencies the peak from a simple
moving average of length n is at a period of approximately n.
Osborn, D. R. (1995). Moving average detrending and the analysis of
business cycles. Oxford Bulletin of Economics and Statistics, 57, 547-58.
Example
The spectrum of a detrended random walk is
f
+
() =
1
2
_
n sin(/2) sin(n/2)
2n sin
2
(/2)
_
2

and there is the possibility of a spurious cycle. (The shape of the spectrum
is the same as that of the gain in the gure).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 31 / 84
Unobserved components*
Specifying a structural time series model gives further insight into the
eects of detrending, since if the components are driven by mutually
uncorrelated disturbances, their individual contributions to the overall
spectrum can be assessed. Writing the trend plus cycle plus irregular
model,
y
t
=
t
+
t
+
t
,
in the single equation form gives
y
t
=

t1

2
+

t

+
t
+
t
highlighting that it is the sum of I (2), I (1) and I (0) components. The
spectrum of the detrended series is:
2f
+
() =

M
+
n
(e
i
; 2)

M
+
n
(e
i
; 1)

M
+
n
(e
i
; 0)

2
g

() +
2

Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 32 / 84
One-sided lters: simple moving average
Instead of the two-sided MA, the trend may be extracted by a one sided
MA:
m
t
= M
r
(L)y
t
=
r

j =0
w
j
y
tj
.
Example
For constant weights:
m
t
=
1
r + 1
r

j =0
y
tj
= (r + 1)
1
S
r +1
(L)y
t
where S
n
(L) = 1 +L + .... +L
n1
,
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 33 / 84
One-sided lters: EWMA
The EWMA lter is
M

(L) =

1 (1 )L
, 0 _ < 1
This is also the lter for the local level model.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 34 / 84
One-sided lters: Detrending
The EWMA detrending lter
M
+

(L) = 1

1 (1 )L
=
(1 )(1 L)
1 (1 )L
, 0 _ < 1
contains a dierence operator and so removes a unit root.
More generally, a one-sided lter with weights that sum to zero will give a
stationary series for any original series that is integrated of order one.
This is in contrast to a two-sided symmetric detrending lter which gives a
stationary series for d = 2.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 35 / 84
One-sided lters: Detrending
Proof Let the weights be w
+
j
, j = 0, 1, ..., r . Since w
+
0
=

r
j =1
w
+
j
, we
have
M
+
r
(L) =
r

j =1
w
+
j
(1 L
j
) = (1 L)
r

j =1
w
+
j
S
j
(L)
so it follows immediately that a unit root in a series will be eliminated.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 36 / 84
One-sided lters: n-th dierence lter
The n th dierence lter,
n
= 1 L
n
, is a detrending lter. [Set
r = n and w
+
0
= 1 and w
+
r
= 1 in M
+
r
(L)]
It decomposes as 1 L
n
= (1 L)S
n
(L), and so removes a unit root.
The gain of
n
is

n
() =

1 e
in

=
_
(1 cos n)
2
+ (sin n)
2
= 2
1/2
(1 cos n)
1/2
This gain is zero at the same points as the simple moving average, (2), so
it will have a similar eect on cycles.
In addition it is zero at the origin because it is a detrending lter, and
there is no damping down of the high frequencies.
The detrending moving average is zero at the origin but leaves the cycle
more or less intact.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 37 / 84
Figure: Gain for seventh dierence,
7
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 38 / 84
Figure: Gain for 7 period moving average and corresponding detrending lter
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 39 / 84
One-sided lters: n-th dierence lter
The dierence lter also induces a phase shift, as it is asymmetric.
Specically,
Ph() = tan
1
[(sin n)/(1 cos n)] = (n )/2 (6)
A plot of Ph()/ shows a lead at low frequencies but a lag at higher
frequencies.
The shift in time units ( shown in gure for n=7) is
Ph()/ = n/2 /2
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 40 / 84
Figure: Gain (solid line) for
7
, together with phase shift Ph()/.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 41 / 84
Phase ambiguity and the rst dierence
Because of the ambiguity in the phase there is always the possibility of
Ph() = (n )/2 2h,
where h is an integer. To see why the solution is (n )/2, note that
S
n
(L) is an MA that induces a lag of (n 1)/2, ie Ph()/ = (n 1)/2
for n > 1.
NB. The phase shift in the rst dierence lter (n = 1) induces a time
shift of ( )/2 = 1/2 /2. This shift is a lead rather than a lag.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 42 / 84
Moving averages
Combinations of lters
The eect of a combination of lters can also be analysed, since the
overall eect is the product of the individual lters. Fishman (1969, p
45-9) describes a classic example where the application of an eleven year
dierence combined with a ve-year moving average yields a peak in the
gain
G() =

2 sin(5) sin(5/2)
5 sin(/2)

at a period of around twenty. When applied to annual data this could


induce a spurious long swing cycle in the data. The production of
spurious cycles in this way is often called the Yule-Slutsky eect.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 43 / 84
Figure: Transfer function for 11 year dierence and 5 year moving average
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 44 / 84
Hodrick-Prescott lter
The optimal lter for estimating the irregular
t
from a smooth trend
model gives the detrended observations, y
+
t
, for t not near the beginning
or end of the series. From the WK formula, as in (1), this is found to be
the doubly innite moving average:
y
+
t
=
_
(1 L)
2
_
1 L
1
_
2
q

+ (1 L)
2
(1 L
1
)
2
_
y
t
, q

> 0 (7)
where q

=
2

/
2

is a pre-specied value.
The lter proposed by Hodrick and Prescott (1997) is a special case in
which q

is set to 1/1600 = 0.000625 for quarterly data. This lter -


HP(1600) - has been taken as a standard by many researchers in
macroeconomics. Is this wise?
Hodrick and Prescott (1997). See also Kydland and Prescott (1990) and
Harvey and Jaeger (JAE, 1993).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 45 / 84
Hodrick-Prescott lter
The gain from the detrending lter is
G
+
() =
4 (1 cos )
2
q

+ 4 (1 cos )
2
=
16 sin
4
(/2)
q

+ 16 sin
4
(/2)
Low frequencies are removed, but frequencies corresponding to periods of
less than twenty are virtually unaected. The cut-o is the frequency at
which the gain equals one-half
= 2 sin
1
(q
1/4
/2)
This is about forty for q

= 0.000625.
The smaller is q

, the more the lter concentrates on removing very low


frequencies. The ripples in the gain of the simple moving average
detrending lter are avoided.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 46 / 84
Figure: Gain for HP lters with q

= 0.000625 and q

= 0.00625 (dashed)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 47 / 84
Hodrick-Prescott lter
As with the simple moving average, the eect of the HP lter can be very
dierent when it is applied to an integrated series.
If y
t
is an ARIMA(p, d, q) process, then
y
+
t
=
_
(1 L)
2d
(1 L
1
)
2
q

+ (1 L)
2
(1 L
1
)
2
_
(L)
(L)

t
(8)
King and Rebelo (1993) note that y
+
t
is a stationary process for d 6 4.
(But d 6 2 at the end). Its a.c.g.f. is given by
g
+
(L) =
_
(1 L)
4d
(1 L
1
)
4d
[ q

+ (1 L)
2
(1 L
1
)
2
]
2
_
g
(d)
y
(L)
where g
(d)
y
(L) is acgf of
d
y
t
.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 48 / 84
Hodrick-Prescott lter
Thus if y
t
is a random walk, the spectrum of the detrended series is
f
+
() =
1
2
8 (1 cos )
3
[ q

+ 4 (1 cos )
2
]
2

=
1
2
64 sin
6
(/2)
[q

+ 16 sin
4
(/2)]
2

This spectrum has a peak at


max
= cos
1
(1
_
0.75 q

) which for
q

= 0.000625 corresponds to a period of about thirty. (The maximum is


at = 0.208, corresponding to a period of 30.14.) Thus applying the
standard HP lter to a random walk produces detrended observations
which have the characteristics of a business cycle for quarterly
observations. Such cyclical behaviour is spurious and is a good example of
the Yule-Slutsky eect. (Cycles from noise - see TSM p 195-6)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 49 / 84
Figure: Spectrum of HP detrended random walk (
2

= 1 thick line) and


IRW(
2

= 0.015)).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 50 / 84
Hodrick-Prescott lter
For many series, detrending with an HP(1600) lter is inappropriate and
can produce spurious cycles; see Harvey and Jaeger (1993). Kydland and
Prescott (1990) apply HP to certain monetary series - in particular they
nd that the price level is countercyclical in the post-Korean war period.
But this nding can be partly explained by the eect of the HP lter.
i) When the rate of ination, y
t
, where y
t
is the log of the price level
(CPI), is a RW+noise, then the eect of HP on y
t
is to produce spurious
cycles at a period of between 30 and 40 quarters.
ii) When y
t
is a RW+cycle, the eect is to accentuate the cycle (if it is
around 30 quarters). There is also a phase shift.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 51 / 84
Hodrick-Prescott lter: phase shift*
Since y
t
=
t
+
t
+
t
, the detrended price series is, from (8),
y
+
t
=
_
(1 L)
_
1 L
1
_
q

+ (1 L)
2
(1 L
1
)
2
_
(1 L
1
)(
t
+
t
+
t
)
and so the frequency response function is:
_
2 (1 cos )
[ q

+ 4 (1 cos )
2
]
(1 e
i
)
_
The gain and TF for the cycle is as for an I (1) process. The phase is
Ph() = tan
1
_
sin
1 cos
_
=

2
compare (6).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 52 / 84
Hodrick-Prescott lter: phase shift*
The phase shift implies a lag of ( )/2. Consider = 2/15 =
0.419 and = 2/30 = 0.21 for which
Ph(0.419)/0.419 = 3.2, Ph(0.21)/0.21 = 7.0
Thus between 15 ( = 0.419) and 30 ( = 0.21) quarters a cycle from
level will lag cycle from dierence by between 3 and 7 periods. The graph
shows the cycle form RW+cycle tted to ination and the HP cycle tted
to the price level. There is a clear lag and this translates into a lag with
the GDP cycle. The ination cycle lags the GDP cycle, though this is
mainly in the 1970s.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 53 / 84
Phase/Frequency ( ) and spectrum of cycle of period 20 (thin line)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 54 / 84
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 55 / 84
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 56 / 84
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 57 / 84
Hodrick-Prescott lter
US GDP
For some real series, HP is reasonable. For quarterly US GDP, HP(1600)
gives a trend very similar to the trend produced by an UC trend-cycle
model. The gains are very similar - see Harvey and Jaeger (1993) and
Harvey and Trimbur (2008).
But although HP is very ecient in the middle (0.971), it is much less
ecient at the end (0.685) - see Harvey and Delle Monache (JEDC, 2009).
Also a model is needed to produce forecasts.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 58 / 84
Hodrick-Prescott lter
Investment
For real series other than US GDP, HP(1600) may be very inecient
compared with model-based trend extraction. (Kydland and Prescott
argue for the same smoothing constant for all series).
Consider co-integrated series exhibiting balanced growth. For example,
Investment and GDP are usually assumed to have a common trend, but it
is an established stylized fact (eg Kydland and Prescott,1990) that the
variance of the cycle in investment is around 20 to 30 greater than that of
GDP.
Thus the signal-noise ratios in the individual series must be dierent.
The gain of the detrending lter from a trend plus cycle model with the
signal-noise ratio appropriate for GDP divided by 30 is now approximated
quite well by HP(32000). The cut-o frequency in this case corresponds to
a period of 21 years rather than 10.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 59 / 84
Hodrick-Prescott lter
Investment
The eect is shown in gure which plots quarterly US investment, from
1947Q1 to 1997Q2, detrended by HP(32000) and HP(1600). As can be
seen, using HP(1600) gives a smaller standard deviation - about 80% of
that of HP(32000). The tendency for too small a smoothing constant to
diminish the standard deviation can be conrmed by plotting the spectrum
of a detrended trend plus cycle model.
From the practical point of view, an even more serious consequence of the
smoothing constant being too small is that the large gap at the end of the
series does not show up as it is absorbed within the trend. Harvey and
Delle Monache (JEDC, 2009) show that there is a much bigger increase in
MSE at the end of the series as compared with the middle.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 60 / 84
Figure: Detrended US investment using HP lters
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 61 / 84
Butterworth lters
The HP lter is a special case of a general class of low pass lters known
as Butterworth lters. They are widely used in engineering. In economics
see Gomez (2001) and Harvey and Trimbur (2003).
The low pass Butterworth lter depends on a positive parameter, q, and a
positive integer index m. It can be expressed as:
B
lp
m
(L) =
1
1 +q
1
m
(1 L)
m
(1 L
1
)
m
, m = 1, 2, 3, ..; .
The form of the lter is motivated by its frequency domain. Since the
lter is symmetric and the frequency response function, B
lp
m
(e
i
), is
nowhere negative, the gain is equal to the frequency response function.
Thus, writing the gain as B
lp
m
(), we have
B
lp
m
() =
1
1 +q
1
m
(2 2 cos )
m
(9)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 62 / 84
Butterworth lters
Since 1 cos = 2 sin
2
(/2),we can write
B
lp
m
() =
1
1 +q
1
m
2
2m
sin
2m
(/2)
=
_
1 + (
sin(/2)
sin(
h
/2)
)
2m
_
1
(10)
where
q
m
= [2 sin(
h
/2)]
2m
= [2 sin(/P
h
)]
2m
(11)
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 63 / 84
Figure: Gains for m-th order trends (Butterworth) with P=16 and m=1,3,10.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 64 / 84
Butterworth lters
In the second equation in (10),
h
is the frequency at which the gain
equals one-half. The low-pass lter focusses on uctuations with frequency
below
h
. The higher frequencies are cut o more sharply as m increases
and the lter becomes more rectangular.
The parameter q also inuences the sharpness and location; consistent
with the relationship in (11), according to which higher values of q
coincide with a larger index m, the Butterworth low pass lter becomes
sharper as q increases while
h
remains xed. On the other hand, if the
order m is xed, then higher values of q
m
are associated with increases in
the cuto frequency
h
.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 65 / 84
Butterworth lters
The low-pass Butterworth lter of order m is the optimal lter for
extracting a stochastic trend, (1 L)
m

m,t
=
(m)
t
, from white noise.
That is
y
t
=
m,t
+
t
,
t
~ WN(0,
2

)
with q =
2
(m)
/
2

. Having a model underpinning the lter not only


suggests when the lter might be appropriate but it also solves the
problem of how to compute the weights in nite samples ( since it can be
put in SSF).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 66 / 84
Ideal low-pass lter
The aim of a ideal low-pass lter is to remove all frequencies beyond a
given point,
L
, while leaving lower frequencies unaected. Thus the gain
should be one up to
L
and zero thereafter. Using standard results on
Fourier transforms, such a gain is found to be given by an innite moving
average in which the weights are
w
lp
0
= / and w
lp
j
= sin(
L
j )/j , j = 1, 2, ..;
see Baxter and King (1999, R E Stat). The corresponding detrending, or
high-pass, lter has w
hp
0
= 1 w
lp
0
, w
hp
j
= w
lp
j
, [j [ > 0.
Letting m in the Butterworth lter approximates an ideal lter and
so the higher is m in the stochastic trend, the nearer the implied weights
for the optimal estimator of trend are to an ideal lter. Whether such a
model is an attractive one is debateable. Note that since
P
h
= /(arcsin 0.5q
1/2m
m
),
letting m gives a value of P
h
= /(arcsin 0.5) = 6 for any q.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 67 / 84
Ideal band-pass lters
An ideal band-pass lter seeks to cut out all frequencies not lying between
two frequencies
1
and
2
,
2
>
1
, while leaving the frequencies between

1
and
2
intact. It can be constructed by subtracting low-pass lter
weights for
1
from those for
2
. Thus
w
ibp
0
= (
2

1
)/ and w
ibp
j
= [sin(
2
j ) sin(
1
j )]/j , j = 1, 2, ...
In the context of business cycle research,
1
and
2
typically correspond
to periods of six and thirty-two quarters.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 68 / 84
Ideal band-pass lter: Baxter-King
Application of the above lters in practice requires that the weights be
truncated, that is the weights are set to zero beyond truncation points of
k. In order for the band-pass lter to be a detrending lter (and hence
produce stationary series for d _ 2), the weights should be adjusted so as
to sum to zero. Baxter and King propose
w
ibp(k)
j
= w
ibp
j

h=k

h=k
w
ibp
h
/(2k + 1), j = k, .., 0, ..., k.
and explore the implications of dierent values of k.
A problem with the BK lter is that it does not produce estimates for the
last k time periods - just when they are needed ! But see Cristiano and
Fitzgerald (IER).
As with HP, the BK lter can produce misleading results if used for
inappropriate series, e.g. white noise or random walk - see gure.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 69 / 84
Figure: Gain of ideal band-pass lter for stationary and I(1) series.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 70 / 84
Seasonality
A seasonal component,
t
, may be added to a model consisting of a trend
and irregular to give
y
t
=
t
+
t
+
t
, t = 1, ..., T, (12)
A xed seasonal pattern may be modelled as

t
=
s

j =1

j
z
jt
where s is the number of seasons and the dummy variable z
jt
is one in
season j and zero otherwise. In order not to confound trend with
seasonality, the coecients,
j
, j = 1, ..., s, are constrained to sum to zero.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 71 / 84
Stochastic Seasonality
Let
jt
denote the eect of season j at time t and dene

t
= (
1t
, ...,
st
)
/
. Seasonals evolve as a multivariate RW

t
=
t1
+
t
, t = 1, ...., T,
where
t
= (
1t
, ...,
st
)
/
is a zero mean disturbance with
Var (
t
) =
2

_
I s
1
ii
/
_
, (13)
where
2

is a non-negative parameter. Although all s seasonal


components are continually changing, only one aects the observations at
any particular time, that is
t
=
jt
when season j is prevailing at time t.
The requirement that the seasonal components always sum to zero is
enforced by the restriction that the disturbances sum to zero at each t.
This restriction is implemented by the correlation structure in (13), where
Var (i
/

t
) = 0, coupled with initial conditions constraining the seasonals
to sum to zero at t = 0. Specically
0
has mean zero and a covariance
matrix proportional to (13). Hence E(i
/

0
) = Var (i
/

0
) = 0, and
thereafter i
/

t
= 0 ensures i
/

t
= 0.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 72 / 84
Basic structural model
In the basic structural model (BSM),
t
in (12) is a stochastic trend, the
irregular component,
t
, is assumed to be random, and the disturbances in
all three components are taken to be mutually uncorrelated. The signal
noise ratio associated with the seasonal, that is q

=
2

/
2

, determines
how rapidly the seasonal changes relative to the irregular. Figure shows
the forecasts for a quarterly series on the consumption of gas in the UK by
Other nal users. The forecasts for the seasonal component are made by
projecting the estimates of the
/
jT
s into the future. As can be seen, the
seasonal pattern repeats itself over a period of one year and sums to zero.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 73 / 84
Figure: Trend and forecasts for Other nal users of gas in the UK
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 74 / 84
Figure: Individual seasonals for ofuGAS
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 75 / 84
Basic structural model : reduced form
The reduced form of the dummy variable stochastic seasonal model is

t
=
s1

j =1

tj
+
t
(14)
with
t
following an MA(s 2) process. Thus the expected value of the
seasonal eects over the previous year is zero. The simplicity of a single
shock model, which is formulated directly as (14) with
t
white noise
with variance
2

, can be useful for pedagogic purposes, but it is usually


preferable to work with the balanced dummy variable model based on (13).
Given (14), which can be written as S (L)
t
=
t
, where
S (L) = 1 +L + .. +L
s1
is the seasonal summation operator, it can be seen that
2
S (L) y
t
is
stationary and that the reduced form of the BSM is
s
y
t
~ MA(s + 1) .
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 76 / 84
Trigonometric seasonal*
Instead of using dummy variables, a xed seasonal pattern may by
modelled by a set of trigonometric terms at the seasonal frequencies,

j
= 2j /s, j = 1, ..., [s/2] , where [.] denotes rounding down to the
nearest integer. The seasonal eect at time t is then

t
=
[s/2]

j =1
_

j
cos
j
t +
j
sin
j
t
_
When s is even, the sine term disappears for j = s/2 and so the number
of trigonometric parameters, the
j
s and
j
s, is always s 1. Provided
that the full set of trigonometric terms is included, the estimated seasonal
pattern is the same as the one obtained with dummy variables.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 77 / 84
Trigonometric stochastic seasonal*
The trigonometric components may be allowed to evolve over time in the
same way as the stochastic cycle. Thus

t
=
[s/2]

j =1

jt
with

jt
=
j ,t1
cos
j
+
+
j ,t1
sin
j
+
jt

+
jt
=
j ,t1
sin
j
+
+
j ,t1
cos
j
+
+
jt
_
, j = 1, ..., [(s 1) /2] ,
where
jt
and
+
jt
are zero mean white-noise processes which are mutually
uncorrelated with a common variance
2
j
. The larger these variances, the
more past observations are discounted in estimating the seasonal pattern.
When s is even,

s/2,t
=
j ,t1
+
s/2,t
.
If
2
j
=
2

for j = 1, ..., [(s 1) /2] and, for s even,


2
s/2
=
2

/2, the
model is identical to the dummy variable stochastic seasonal. See Proietti
(International Journal of Forecasting, 2000).
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 78 / 84
Seasonal ARIMA models
For modelling seasonal data, Box and Jenkins (1976, ch. 9) proposed a
class of multiplicative seasonal ARIMA models; see Ghysels, Osborn and
Rodrigues (Handbook of Economic Forecasting, 2006). The most
important model within this class has subsequently become known as the
airline model since it was originally tted to a monthly series on UK
airline passenger totals. The model is written as

s
y
t
= (1 + L) (1 +L
s
)
t
where
s
= 1 L
s
is the seasonal dierence operator and and are
MA parameters which, if the model is to be invertible, must have modulus
less than one. Box and Jenkins (1976, pp. 305-6) gave a rationale for the
airline model in terms of EWMAs at monthly and yearly intervals.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 79 / 84
Seasonal ARIMA models
Maravall (1985), compares the autocorrelation functions of
s
y
t
for the
BSM and airline model for some typical values of the parameters and nds
them to be quite similar, particularly when the seasonal MA parameter, ,
is close to minus one. In fact in the limiting case when is equal to
minus one, the airline model is equivalent to a BSM in which
2

and
2

are both zero. The airline model provides a good approximation to the
reduced form when the slope and seasonal are close to being deterministic.
If this is not the case the implicit link between the variability of the slope
and that of the seasonal component may be limiting.
Pure AR models can be very poor at dealing with seasonality since
seasonal patterns typically change rather slowly and this may necessitate
the use of long seasonal lags.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 80 / 84
Seasonal adjustment
Seasonal adjustment may be carried out by a procedure such as the
Bureau of the Census X-11, or X-12, which is based on a set of weights.
Model based seasonal adjustment - remove the seasonal component, by
smoothing, in a model. In a STM this is straightforward as the seasonal
component is modelled explicitly. In an ARIMA model, a UC form may be
derived, assuming that the model satises certain constraints eg
TRAMO-SEATS.
A seasonal adjustment lter, M
n
(L), should normally contain the S
s
(L)
polynomial as a factor in order to cancel out seasonal unit roots in the raw
series. A symmetric lter will usually contain S
s
(L)S
s
(L
1
). In both cases,
M
n
() =

M
n
(e
i
)

= 0 at
j
= 2j /s, j = 1, .., [s/2].
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 81 / 84
Seasonal adjustment
Example
In the BSM with a RW trend and a single shock seasonal component, the
seasonal adjustment lter, g
+
(L)/g
y
(L), is
w(L) =

2

/ [1 L[
2
+
2

/ [S(L)[
2
+
2

/ [1 L[
2
+
2

=
[S(L)[
2
(
2

+[1 L[
2

)
[1 L[
2

+[S(L)[
2

+[1 L
s
[
2

The weights sum to one, but only because of the integrated trend.
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 82 / 84
Figure: Seasonally adjusted ofuGAS
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 83 / 84
Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 84 / 84

Das könnte Ihnen auch gefallen