02 lent lecture 2 - tsfe4p ach34

Upload: rjt42

Post on 04-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    1/42

    Further Time Series

    4. Trends, Cycles and SeasonalityTime 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

    yt=t+t+t, t=1, ..., T

    Fitting a trend plus cycle model provides more scope for identifyingturning pointsand assessing their signicance. Dierent denitions ofturning points- for example a change in sign of the cycle, a change in signof its slope or a change in sign of the slope of the cycle and the trendtogether - see Harvey, Trimbur and van Dijk (JE, 2008).Cyclical trendmodel incorporates the cycle into the slope by moving it tothe equation for the level:

    t = t1+t1+t1+tThe reduced form is ARIMA(2,2,4).

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 2 / 84

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    2/42

    The NBER denes a turning point in the business cycle in terms ofnegative growth rates. On the other hand, a turning point may be denedwith respect to the growth cycle or output gap. Growth cycles arerecurrent uctuations in the series of deviations from trend. Thus, growth

    cycle contractions include slowdowns as well as absolute declines inactivity, whereas business cycles contractions includes only absolutedeclines (recessions).Seepapers 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. Thesmoother will not be symmetric.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 3 / 84

    Trend-cycle models :State space form

    yt=[1 0 1 0] t+t

    t=

    2664

    tttt

    3775 =

    2664

    1 10 1

    0

    0 cosc sinc sinc cosc

    37752664

    t1t1t1t1

    3775+

    2664

    tttt

    3775

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 4 / 84

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    3/42

    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

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    4/42

    Trend-cycle models

    Figure shows the annualised underlying growth rate (the estimate of theslope times four) and the fourth dierences of the (logarithms of the)series. The latter is fairly noisy, though much smoother than rstdierences, and it includes the eect of temporary growth emanating fromthe cycle. The growth rate from the model, on the other hand, shows thelong term growth rate and indicates how the prolonged upswings of the1960s and 1990s are assigned to the trend rather than to the cycle.(Indeed it might be interesting to consider tting a cyclical trend modelwith 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 isprojected 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 annualdierences.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality January 2014 8 / 84

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    5/42

    Phillips curve

    Resurgence of interest in the Phillips curve (1958).Originally wages and unemployment, but now most often prices and theoutput gap.JME 2005, special issue.Harvey, A.C. (2011) Modelling the Phillips curve with UnobservedComponents, 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 J anu ary 20 14 1 0 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    6/42

    Preliminary modelling and stylised facts

    Output is measured by the logarithm of quarterly real U.S. Gross DomesticProduct (GDP), denoted yt.

    The (annualized) rate of ination, t, is measured as the rst dierencesof the quarterly CPI multiplied by four.Begin with an exploration of the relationship between ination and outputbased on tting univariate UC trend-cycle models

    yt=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 J anu ary 20 14 1 1 / 8 4

    Figure: Ination and its decomposition into stochastic level, cycle and seasonal

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 1 2 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    7/42

    Figure: Smoothed estimates of the cycles obtained from the univariate models

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 1 3 / 8 4

    Phillips Curve

    Output gap obtained by extracting a cycle from a univariate model ofGDP. Then

    t=t+xt+t, t NID

    0, 2

    , t=1, ..., T

    wheret is an unobserved random walk.Sincextis stationary, the long-run forecast is the current expected value oftand so is a measure ofcore ination.Later will estimate Phillips curve from a bivariate system in which theoutput gap and ination gap are modelled jointly.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 1 4 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    8/42

    Weighting patterns in the local linear trend model

    The local linear trend model is

    yt=t+t, t=1, ..., T

    t=t1+t1+tt= t1+t

    wheret, t andtare mutually uncorrelated white-noise disturbanceswith 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

    2+ j1 Lj4 2=

    2

    2 j1+1L +2L2j2. (1)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 1 5 / 8 4

    Weighting patterns in the local linear trend model

    By equating the autocovariances at lags one and two it can be shown thatthe reduced form parameters satisfy 1 = 42/(1+2), with0 2 < 1 and2 < 1 0. The roots of the polynomial1+1L +2L2 are complex. Since 1/ 1+1L +2L22 is the ACGF ofan AR(2) process, it follows that the weights decay according to a dampedsine wave with frequency cos1[1/2

    p2]; see Box and Jenkins (1976,

    p.59). The initial slow decline of the weights contrasts with theexponential decline of the weights for a random walk trend.The value of/ =0.025 corresponds to the lter proposed by Hodrickand Prescott (1997) for quarterly observations. For this case Hodrick andPrescott (1997) and Singleton (JME,1988) give weights

    wk=0.8941k(0.0562cos0.112k+0.0558sin0.0112k)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 1 6 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    9/42

    Figure: Local level weights

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 1 7 / 8 4

    Figure: Local linear trend weights

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 1 8 / 8 4

    http://find/http://goback/http://find/http://goback/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    10/42

    Weighting patterns in the local linear trend model*

    In the more general case when 2 is not necessarily zero

    w(L) = 2+ j1 Lj

    2

    2

    2+ j1 Lj2 2+ j1 Lj4 2= 2

    2

    1+L

    2j1+1L +2L2j2

    where the numerator is obtained from the reduced form of the trendcomponent, which is such that 2t is an MA(1) with MAparameter and disturbance variance 2. The structural model with mutuallyuncorrelated disturbances implies that only a small part of the invertibilityregion 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 J anu ary 20 14 1 9 / 8 4

    Moving averages

    Economic time series very fragile - all operations have a potentiallydistorting eect.Moving averages Suppose a trend is constructed as a moving (rolling)

    average ofn=2r+1 consecutive data points, that is

    mt=Mn (L)yt=r

    j=r

    wjytj.

    The sum of the weights is normally unity, ie Mn (1) =1, if the aim of thelter is trend extraction.The frequency response function is Mn (ei). Its absolute value, the gain,

    will be denoted as Mn ().

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 0 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    11/42

    Moving averages

    Consider a simple moving average with

    wj=1/n, j= r, ..., r. (2)

    The gain is found to be

    Mn () =

    1n + 2nr

    j=1

    cosj

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

    (3)where the last expression follows from standard trigonometric identities asin Harvey (1993, pp 193-5); note that Mn () =1 at =0. The lter willremove 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 Mn (L) in (2),

    nMn (L)Lr =Sn (L) =1+ L + L

    2 + ...+ Ln1

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 1 / 8 4

    Figure: Gain for 7 period moving average

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 2 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    12/42

    Moving averagesDetrending

    Weights in a trend extraction lter sum to one. Conversely, a detrendinglter has weights that sum to zero. The detrended series corresponding toa trend extraction lter of the form Mn (L) is

    yt =ytMn (L)yt= [1Mn (L)]yt=Mn (L)yt, r=1, 2, ..

    Thus the weights in Mn (L) arew0 =1 w0 andwj = wj , j= 1, ..,r.Any symmetric detrending moving average with weights summing to zero,

    that is Mn (1) =0, will give a stationary series provided the order of integration, d, does not exceed two.

    Proof. Since w0 = 2rj=1wj

    Mn (L) =w0 +

    r

    j=1

    wj(Lj + Lj) =

    r

    j=1

    wj(2 Lj Lj) (4)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 3 / 8 4

    Moving averagesDetrending

    (Proof contd) Now

    2 Lj Lj = (1 Lj)(1 Lj)

    and 1 Lj = (1 L)Sj(L), where Sj(L) =1+ L + ...+ Lj1 . Thus

    Mn (L) = (1 L)(1 L1)r

    j=1

    wjSj(L)Sj(L1), r=1, 2, ..(5)

    = (1 L)(1 L1)r

    j=1

    wjj1

    h=(j1)(j jhj)Lh .

    See, for example, Baxter and King (1999, p592).

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 4 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    13/42

    Moving averagesDetrending

    Ifyt is an I(d) process with d=0, 1 or 2, the a.c.g.f. ofyt is given by

    g (L) = jMn (L)j2 j1 Lj2d g(d)y (L)

    = j1 Lj2(2d)

    r

    j=1

    wjj1

    h=(j1)(j jhj)Lh

    2

    g(d)y (L)

    where g(d)y (L) is the a.c.g.f. ofdyt. The term

    j1

    L

    j2d is cancelled

    out by the factorj1 Lj4 = (1 L)2(1 L1)2 that appears injMn (L)j2.Term in summation is a nite MA polynomial.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 5 / 8 4

    Moving averagesDetrending

    The spectrum of the detrended series, corresponding to the acgf, gn (L),is:

    fn ()= (2 2cos )2d rj=1

    wj j+2r

    j=1

    wjj1

    h=1

    (j h) cosh

    2

    f(d)y (),

    ford=0, 1, 2, where f(d)y () is the spectrum ofdyt.

    1) The detrended series is strictly non-invertible for d=1 or 0 becausethere 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 J anu ary 20 14 2 6 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    14/42

    Moving averagesDetrending: FRF and gain

    The frequency response function showing the eect of the lter on thed th dierence of the series is real (since it is symmetric ) and when thew0j s,j=1, .., rare negative (as with a simple MA), so the corresponding

    w0jsare positive, it is everywhere non-negative - as is apparent from theformula below, obtained from writing (4) as Mn (L) = rj=1wjj1 Lj2- and so equal to the gain, denoted Mn (; d) :

    Mn (; d) = Mn (e

    i)/(2 2cos )d/2

    = r

    j=1

    wj(2 2cos j)/(2 2cos )d/2 , d=0, 1, 2.

    The corresponding formula from (5) is

    Mn (; d) = (2 2cos)1d/2

    r

    j=1

    wj j+2r

    j=1

    wjj1

    h=1

    (j h) cosh!

    NB Ifd< 2, then Mn (0; d) =0 indicating noninvertibility.Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 7 / 8 4

    Simple moving average and its complement

    For the detrending lter corresponding to the simple moving average,wj=1/n,j= r, ..., r,

    Mn (; d) = n sin(/2) sin(n/2)

    2dn[sin(/2)]d+1 d=0, 1, 2.

    Note that 2(1 cos) = 4sin2(/2). Figure shows the gain for astationary series when n=13. The fact that for d=0 the gain is zero atzero frequency, and close to zero at frequencies nearby, is indicative of thedetrending nature of the lter.The original moving average hasthe opposite eect in that it extracts thetrend; it also damps down high frequencies and removes power associated

    with cyclical movements of period 13 because it is zero at = 2/13 andat its harmonics = 2j/13,j=2, ..., 6.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 8 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    15/42

    Figure: Gain for thirteen period MA and corresponding detrending lter

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 2 9 / 8 4

    Figure: Gains for thirteen period MA for d=0 and d=1 (dashed line)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 3 0 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    16/42

  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    17/42

    One-sided lters: simple moving average

    Instead of the two-sided MA, the trend may be extracted by a one sidedMA:

    mt=Mr(L)yt=

    r

    j=0 wjytj.

    Example

    For constant weights:

    mt= 1

    r+1

    r

    j=0

    ytj= (r+1)1Sr+1(L)yt

    where Sn (L) =1+ L + ....+ Ln1,

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 3 3 / 8 4

    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 J anu ary 20 14 3 4 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    18/42

    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 astationary 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 J anu ary 20 14 3 5 / 8 4

    One-sided lters: Detrending

    Proof Let the weights be wj , j=0, 1, ..., r. Since w0 =

    rj=1w

    j , we

    have

    Mr(L) = r

    j=1

    wj(1 Lj) = (1 L)r

    j=1

    wjSj(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 J anu ary 20 14 3 6 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    19/42

    One-sided lters: n-th dierence lter

    The n th dierence lter, n =1 Ln , is a detrending lter. [Setr=n and w0 =1 and wr = 1 in Mr(L)]It decomposes as 1 L

    n

    = (1 L)Sn (L),

    and so removes a unit root.The gain ofn is

    n () =1 ein = q(1 cos n)2 + (sin n)2 =21/2(1 cos n)1/2

    This gain is zero at the same points as the simple moving average, (2), soit 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 cyclemore or less intact.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 3 7 / 8 4

    Figure: Gain for seventh dierence, 7

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 3 8 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    20/42

    Figure: Gain for 7 period moving average and corresponding detrending lter

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 3 9 / 8 4

    One-sided lters: n-th dierence lter

    The dierence lter also induces a phase shift, as it is asymmetric.Specically,

    Ph() =tan1[( sin n)/(1 cos n)] = (n )/2 (6)A plot ofPh()/ shows a lead at low frequencies but a lag at higherfrequencies.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 J anu ary 20 14 4 0 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    21/42

    Figure: Gain (solid line) for 7 , together with phase shift Ph()/.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 1 / 8 4

    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 thatSn (L) is an MA that induces a lag of(n 1)/2, ie Ph()/= (n 1)/2forn > 1.NB. The phase shift in the rst dierence lter (n=1) induces a timeshift of( )/2=1/2 /2. This shift is a leadrather than a lag.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 2 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    22/42

    Moving averagesCombinations 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, p45-9) describes a classic example where the application of an eleven yeardierence combined with a ve-year moving average yields a peak in thegain

    G() =

    2sin(5) sin(5/2)5sin(/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 ofspurious cycles in this way is often called the Yule-Slutsky eect.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 3 / 8 4

    Figure: Transfer function for 11 year dierence and5yearmovingaverageAndrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 4 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    23/42

    Hodrick-Prescott lter

    The optimal lter for estimating the irregular tfrom a smooth trendmodel gives the detrended observations, yt, for tnot near the beginningor end of the series. From the WK formula, as in (1), this is found to be

    the doubly innite moving average:

    yt =

    " (1 L)2 1 L12

    q+(1 L)2 (1 L1)2#

    yt, q> 0 (7)

    where q=2/

    2 is a pre-specied value.

    The lter proposed by Hodrick and Prescott (1997) is a special case inwhich q is set to 1/1600= 0.000625 for quarterly data. This lter -

    HP(1600) - has been taken as a standard by many researchers inmacroeconomics. Is this wise?Hodrick and Prescott (1997). See also Kydland and Prescott (1990) andHarvey and Jaeger (JAE, 1993).

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 5 / 8 4

    Hodrick-Prescott lter

    The gain from the detrending lter is

    G() = 4 (1 cos)2

    q+4 (1 cos)2 =

    16 sin4(/2)

    q+16 sin4(/2)

    Low frequencies are removed, but frequencies corresponding to periods ofless than twenty are virtually unaected. The cut-o is the frequency atwhich the gain equals one-half

    = 2 sin1(q1/4/2)

    This is about forty for q=0.000625.

    The smaller isq

    ,

    the more the lter concentrates on removing very lowfrequencies. The ripples in the gain of the simple moving averagedetrending lter are avoided.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 6 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    24/42

    Figure: Gain for HP lters with q=0.000625 and q=0.00625 (dashed)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 7 / 8 4

    Hodrick-Prescott lter

    As with the simple moving average, the eect of the HP lter can be verydierent when it is applied to an integrated series.Ifyt is an ARIMA(p, d, q) process, then

    yt ="

    (1 L)2d(1 L1)2q+(1 L)2 (1 L1)2

    # (L) (L)

    t (8)

    King and Rebelo (1993) note that yt is a stationary process for d6 4.(But d6 2 at the end). Its a.c.g.f. is given by

    g (L)= (1 L)4d(1 L1)4d[q+ (1

    L)2(1

    L1)2]2

    g(d)y (L)

    where g(d)y (L) is acgf ofdyt.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 8 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    25/42

    Hodrick-Prescott lter

    Thus ifyt is a random walk, the spectrum of the detrended series is

    f() = 12

    8 (1 cos)3

    [q+4 (1 cos)2]22 = 12

    64 sin6

    (/2)[q+16 sin

    4(/2)]22

    This spectrum has a peak at max =cos1(1p

    0.75q) which forq=0.000625 corresponds to a period of about thirty. (The maximum isat =0.208, corresponding to a period of 30.14.) Thus applying thestandard HP lter to a random walk produces detrended observationswhich have the characteristics of a business cycle for quarterly

    observations. Such cyclical behaviour is spurious and is a good example ofthe Yule-Slutsky eect. (Cycles from noise - see TSM p 195-6)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 4 9 / 8 4

    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 J anu ary 20 14 5 0 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    26/42

    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 andPrescott (1990) apply HP to certain monetary series - in particular theynd that the price levelis 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, yt, where yt is the log of the price level(CPI), is a RW+noise, then the eect of HP on yt is to produce spuriouscycles at a period of between 30 and 40 quarters.ii) When ytis 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 J anu ary 20 14 5 1 / 8 4

    Hodrick-Prescott lter: phase shift*

    Since yt=t+t+t, the detrended price series is, from (8),

    yt =

    " (1 L) 1 L1

    q+(1 L)2 (1 L1)2#

    (1 L1)(t+t+t)

    and so the frequency response function is:" 2 (1 cos)

    [q+4 (1 cos)2](1 ei)

    #

    The gain and TF for the cycle is as for an I(1) process. The phase is

    Ph() =tan1 sin

    1 cos

    =

    2

    compare (6).

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 5 2 / 8 4

    http://find/http://goback/http://find/http://goback/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    27/42

    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 fromlevel will lag cycle from dierence by between 3 and 7 periods. The graphshows the cycle form RW+cycle tted to ination and the HP cycle ttedto 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 ismainly in the 1970s.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 5 3 / 8 4

    Phase/Frequency ( ) and spectrum of cycle of period 20 (thin line)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 5 4 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    28/42

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 5 5 / 8 4

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 5 6 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    29/42

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 5 7 / 8 4

    Hodrick-Prescott lterUS 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-cyclemodel. The gains are very similar - see Harvey and Jaeger (1993) andHarvey and Trimbur (2008).But although HP is very ecient in the middle (0.971), it is much lessecient 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 J anu ary 20 14 5 8 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    30/42

    Hodrick-Prescott lterInvestment

    For real series other than US GDP, HP(1600) may be very inecientcompared 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 itis an established stylized fact (eg Kydland and Prescott,1990) that thevariance of the cycle in investment is around 20 to 30 greater than that ofGDP.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 thesignal-noise ratio appropriate for GDP divided by 30 is now approximatedquite well by HP(32000). The cut-o frequency in this case corresponds toa period of 21 years rather than 10.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 5 9 / 8 4

    Hodrick-Prescott lterInvestment

    The eect is shown in gure which plots quarterly US investment, from1947Q1 to 1997Q2, detrended by HP(32000) and HP(1600). As can be

    seen, using HP(1600) gives a smaller standard deviation - about 80% ofthat of HP(32000). The tendency for too small a smoothing constant todiminish the standard deviation can be conrmed by plotting the spectrumof a detrended trend plus cycle model.From the practical point of view, an even more serious consequence of thesmoothing constant being too small is that the large gap at the end of theseries does not show up as it is absorbed within the trend. Harvey andDelle 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 J anu ary 20 14 6 0 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    31/42

    Figure: Detrended US investment using HP lters

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 6 1 / 8 4

    Butterworth lters

    The HP lter is a special case of a general class of low pass lters knownas Butterworth lters. They are widely used in engineering. In economicssee Gomez (2001) and Harvey and Trimbur (2003).The low pass Butterworth lter depends on a positive parameter, q, and apositive integer index m. It can be expressed as:

    Blpm(L) = 1

    1+ q1m (1 L)m (1 L1)m, m=1, 2, 3, ..; .

    The form of the lter is motivated by its frequency domain. Since thelter is symmetric and the frequency response function, Blpm(ei), isnowhere negative, the gain is equal to the frequency response function.Thus, writing the gain as Blpm(), we have

    Blpm() = 1

    1+ q1m (2 2cos )m (9)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 6 2 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    32/42

    Butterworth lters

    Since 1 cos=2 sin2(/2),we can write

    Blpm() = 1

    1+ q1m 22m sin2m (/2)=

    1+ (

    sin(/2)

    sin(h/2))2m

    1(10)

    where

    qm = [2sin(h/2)]2m = [2sin(/Ph )]

    2m (11)

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 6 3 / 8 4

    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 J anu ary 20 14 6 4 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    33/42

    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 frequencybelow h. The higher frequencies are cut o more sharply as m increasesand the lter becomes more rectangular.The parameter qalso inuences the sharpness and location; consistentwith the relationship in (11), according to which higher values ofqcoincide with a larger index m, the Butterworth low pass lter becomessharper as q increases while h remains xed. On the other hand, if theorder m is xed, then higher values ofqm are associated with increases in

    the cuto frequency h.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 6 5 / 8 4

    Butterworth lters

    The low-pass Butterworth lter of order m is the optimal lter for

    extracting a stochastic trend, (1

    L)mm,t=

    (m)t , from white noise.

    That isyt=m,t+t, t WN(0, 2)

    with q=2(m)/

    2 . Havinga model underpinning the lter not only

    suggests when the lter might be appropriate but it also solves theproblem of how to compute the weights in nite samples ( since it can beput in SSF).

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 6 6 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    34/42

    Ideal low-pass lter

    The aim of a ideal low-pass lter is to remove all frequencies beyond agiven point, L , while leaving lower frequencies unaected. Thus the gainshould be one up to Land zero thereafter. Using standard results onFourier transforms, such a gain is found to be given by an innite moving

    average in which the weights are

    wlp0 =/ and w

    lpj =sin(Lj)/j, j= 1,2, ..;

    see Baxter and King (1999, R E Stat). The corresponding detrending, or

    high-pass, lter has whp0 =1wlp0 , whpj = wlpj , jjj > 0.Letting m ! in the Butterworth lter approximates an ideal lter andso 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 amodel is an attractive one is debateable. Note that since

    Ph =/(arcsin 0.5q1/2mm ),

    letting m ! gives a value of Ph =/(arcsin 0.5)= 6 forany q.Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 6 7 / 8 4

    Ideal band-pass lters

    An ideal band-pass lterseeks to cut out all frequencies not lying betweentwo frequencies 1 and2 , 2 > 1, while leaving the frequencies between

    1 and 2 intact. It can be constructed by subtracting low-pass lterweights for 1 from those for 2 . Thus

    wibp0 = (2 1)/ and wibpj = [sin(2j) sin(1j)]/j, j= 1,

    In the context of business cycle research, 1 and2 typically correspondto periods of six and thirty-two quarters.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 6 8 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    35/42

    Ideal band-pass lter: Baxter-King

    Application of the above lters in practice requires that the weights betruncated, that is the weights are set to zero beyond truncation points ofk. In order for the band-pass lter to be a detrending lter (and henceproduce stationary series for d 2), the weights should be adjusted so asto sum to zero. Baxter and King propose

    wibp(k)

    j =wibp

    j h=k

    h=k

    wibph /(2k+1), j= k, .., 0, ..., k.

    and explore the implications of dierent values ofk.A problem with the BK lter is that it does not produce estimates for the

    last ktime periods - just when they are needed ! But see Cristiano andFitzgerald (IER).As with HP, the BK lter can produce misleading results if used forinappropriate series, e.g. white noise or random walk - see gure.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 6 9 / 8 4

    Figure: Gain of ideal band-pass lter for stationary and I(1) series.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 7 0 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    36/42

    Seasonality

    A seasonal component, t, may be added to a model consisting of a trendand irregular to give

    yt=t+t+t, t=1, ..., T, (12)

    A xed seasonal pattern may be modelled as

    t=s

    j=1

    jzjt

    wheres

    is the number of seasons and the dummy variablez

    jt is one inseason jand zero otherwise. In order not to confound trend withseasonality, the coecients, j, j=1, ..., s,are constrained to sum to zero.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 7 1 / 8 4

    Stochastic Seasonality

    Let jtdenote the eect of season jat time tand denet= (1t, ..., st)

    0. Seasonals evolve as a multivariate RW

    t= t1+ t, t=1, ...., T,

    where t=(1t, ..., st)0 is a zero mean disturbance with

    Var(t)= 2

    I s1ii0 , (13)where2 is a non-negative parameter. Although all sseasonalcomponents are continually changing, only one aects the observations atany particular time, that is t=jtwhen season j is prevailing at time t.The requirement that the seasonal components always sum to zero isenforced by the restriction that the disturbances sum to zero at each t.This restriction is implemented by the correlation structure in (13), where

    Var(i0t)= 0, coupled with initial conditions constraining the seasonalsto sum to zero at t=0. Specically 0 has mean zero and a covariancematrix proportional to (13). Hence E(i00) =Var(i00)= 0, andthereafter i0t=0 ensures i0t=0.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 7 2 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    37/42

    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 inall three components are taken to be mutually uncorrelated. The signalnoise ratio associated with the seasonal, that is q =2/

    2 , determines

    how rapidly the seasonal changes relative to the irregular. Figure showsthe forecasts for a quarterly series on the consumption of gas in the UK byOther nal users. The forecasts for the seasonal component are made byprojecting the estimates of the 0jTs 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 J anu ary 20 14 7 3 / 8 4

    Figure: Trend and forecasts for Other nal users of gas in the UKAndrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 7 4 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    38/42

    Figure: Individual seasonals for ofuGAS

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 7 5 / 8 4

    Basic structural model : reduced form

    The reduced form of the dummy variable stochastic seasonal model is

    t= s1

    j=1tj+t (14)

    witht following an MA(s 2) process. Thus the expected value of theseasonal eects over the previous year is zero. The simplicity of a singleshockmodel, which is formulated directly as (14) with twhite noisewith variance 2, can be useful for pedagogic purposes, but it is usuallypreferable to work with the balanced dummy variablemodel based on (13).Given (14), which can be written as S(L) t=t, where

    S(L)= 1+ L + ..+ Ls1

    is the seasonal summation operator, it can be seen that 2S(L) yt isstationary and that the reduced form of the BSM is syt MA (s+1) .

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 7 6 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    39/42

    Trigonometric seasonal*

    Instead of using dummy variables, a xed seasonal pattern may bymodelled by a set of trigonometric terms at the seasonal frequencies,

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

    t=[s/2]

    j=1

    jcosjt+jsinjt

    When s is even, the sine term disappears for j=s/2 and so the numberof trigonometric parameters, the js and js, is always s

    1. Provided

    that the full set of trigonometric terms is included, the estimated seasonalpattern is the same as the one obtained with dummy variables.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 7 7 / 8 4

    Trigonometric stochastic seasonal*

    The trigonometric components may be allowed to evolve over time in thesame way as the stochastic cycle. Thus

    t=[s/2]

    j=1

    jt

    with

    jt=j,t1cos j+j,t1sin j+jtjt= j,t1sin j+j,t1cos j+jt

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

    wherejt and

    jtare zero mean white-noise processes which are mutually

    uncorrelated with a common variance 2j . The larger these variances, themore past observations are discounted in estimating the seasonal pattern.When s is even,

    s/2,

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

    If2j =2 forj=1, ..., [(s 1)/2] and, for s even, 2s/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 J anu ary 20 14 7 8 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    40/42

    Seasonal ARIMA models

    For modelling seasonal data, Box and Jenkins (1976, ch. 9) proposed aclass of multiplicative seasonal ARIMA models; see Ghysels, Osborn and

    Rodrigues (Handbook of Economic Forecasting, 2006). The mostimportant model within this class has subsequently become known as theairline model since it was originally tted to a monthly series on UKairline passenger totals. The model is written as

    syt=(1+L) (1+Ls) t

    where s=1 Ls is the seasonal dierence operator and and areMA parameters which, if the model is to be invertible, must have modulusless than one. Box and Jenkins (1976, pp. 305-6) gave a rationale for theairline model in terms of EWMAs at monthly and yearly intervals.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 7 9 / 8 4

    Seasonal ARIMA models

    Maravall (1985), compares the autocorrelation functions ofsyt for theBSM and airline model for some typical values of the parameters and ndsthem to be quite similar, particularly when the seasonal MA parameter, ,

    is close to minus one. In fact in the limiting case when is equal tominus one, the airline model is equivalent to a BSM in which 2 and2

    are both zero. The airline model provides a good approximation to thereduced 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 slopeand that of the seasonal component may be limiting.Pure AR models can be very poor at dealing with seasonality sinceseasonal 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 J anu ary 20 14 8 0 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    41/42

    Seasonal adjustment

    Seasonal adjustment may be carried out by a procedure such as theBureau of the Census X-11, or X-12, which is based on a set of weights.Model based seasonal adjustment - remove the seasonal component, bysmoothing, in a model. In a STM this is straightforward as the seasonalcomponent is modelled explicitly. In an ARIMA model, a UC form may bederived, assuming that the model satises certain constraints egTRAMO-SEATS.A seasonal adjustment lter, Mn (L), should normally contain the Ss(L)polynomial as a factor in order to cancel out seasonal unit roots in the raw

    series. A symmetric lter will usually contain Ss(L)Ss(L1

    ). In both cases,Mn () =

    Mn (ei)=0 at j=2j/s, j=1, ..,[s/2].

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 8 1 / 8 4

    Seasonal adjustment

    Example

    In the BSM with a RW trend and a single shock seasonal component, theseasonal adjustment lter, g+(L)/gy(L), is

    w(L) =2/ j1 Lj2 +2

    2/ jS(L)j2 +2/ j1 Lj2 +2

    =jS(L)j2 (2+ j1 Lj2 2)

    j1 Lj2 2+ jS(L)j2 2+ j1 Lsj2 2

    The weights sum to one, but only because of the integrated trend.

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 8 2 / 8 4

    http://find/http://find/
  • 8/13/2019 02 Lent Lecture 2 - TSFE4p Ach34

    42/42

    Figure: Seasonally adjusted ofuGAS

    Andrew Harvey () Further Time Series 4. Trends, Cycles and Seasonality J anu ary 20 14 8 3 / 8 4