Part III Seats

Post on 24-Dec-2015

15 views 0 download

description

Demetra

Transcript of Part III Seats

October 2008

NOTES ON PROGRAMS

TRAMO AND SEATS

SEATS PART

Signal Extracion in ARIMA Times Series

Agustín Maravall

Bank of Spain

2

In the remote past, unobserved components where estimated

using

Deterministic Models

xt = pt + st + ut

For example:

pt = a +bt linear trend

st = Σβi dit dummies ( t1d = 1 for January, 0 otherwise;…)

or, equivalenty, sine-cos functions

st = ΣAj cos (ωjt + Bj)

ut = white noise: niid (0, Vu)

pt st ut ut

3

− concept of deterministic: if we know the "true" parameters of the

model, the variable can be forecast with no error (ex.: tp or ts

above)

− concept of white noise : [ ]T

1ta is w.n. iff (a1….aT) ∼ niid (0, Va)

MOST COMMON OBJECTIVE OF SEASONAL ADJUSTMENT:

Better understanding of underlying (still, short-term) evolution of the series. In so far as highly transitory noise can also distort the picture, it is often helpful to look at: Trend-Cycle estimation (i.e. the SHORT-TERM TREND)

Trend and SA series

0

200000

400000

600000

800000

1 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150

stochastic trend stochastic SA series

4

"Short term" analysis ≡ at the most two-year horizon

When main interest is to remove:

− Seasonal noise, − (Highly transitory) irregular noise, so as to read data better in short-term policy, the remaining signal may well contain variation for cyclical frequencies. In this case, trend → "trend-cycle"

Stochastic Trend - cycle

80

85

90

95

100

105

110

115

1 10 20 30 40 50 60 70 80 90 100 110 120 130 140

stochastic trend

5

Gradual realization that seasonality evolves in time ("moving seasonality")

[An obvious and basic example: the weather,

one of the main causes of seasonality]

↓ MOVING AVERAGE METHODS

1) Fixed ("band-pass") filters

Some limitations:

* Spurious results

* Can overadjust

Can underadjust

......................

6

Spectrum of white noise

0 π

Spectrum of Seasonal Component in w.n.

0 π

Squared gain of X11 (default) filter

0 π

7

2) An alternative approach:

Use simple stochastic models to capture structure of series. (ARIMA models)

Derive optimal filter

(Signal Extraction)

THIS IS OUR APPROACH

The method permits us to jointly solve many problems of applied interest.

In the most general case:

A series contaminated by outliers, affected by regression variables,

subject to deterministic effects (TD, EE, Intervention variable, ...)

has been cleaned by TRAMO ("preadjustment").

Then the preadjusted or "linearized" series (the output of the

ARIMA model) is decomposed into components by SEATS.

8

IPI: Original Series

20

40

60

80

100

120

140

1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 113 120 127 134 141 148 155

IPI: Preadjustment Factors

20

40

60

80

100

120

140

1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 113 120 127 134 141 148 155

IPI: linear series

20

40

60

80

100

120

140

1 8 15 22 29 36 43 50 57 64 71 78 85 92 99 106 113 120 127 134 141 148 155

9

Use of TRAMO as a PREADJUSTMENT program

Observed series

TRAMO ↓ (Interpolated series) ↓

↓ ↓ Stochastic Part:

"Linearized" Series

(output of ARIMA)

Deterministic Part:

Regression Effects

↓ SEATS AO (Outlier) ↓ TC (Outlier) Trend LS (Outlier) + Seasonal Trading Day/Leap Year + Easter Effect (Transitory) Holidays + Intervention Variables Irregular Regression Variables (can be assigned to any component) ↓ ↓ Final components

10

BASIC IDEA BEHIND THE FILTERS IN SEATS

a) NONSEASONAL SERIES b) PURELY SEASONAL

SERIES

x t = white noise S x t = w t (stationary MA)

filter for SA series: filter for SA series:

1 = ) F B, ( υ 0 = ) F B, ( υ Conclusion: SERIES WITH DIFFERENT STOCHASTIC STRUCTURES REQUIRE DIFFERENT FILTERS What SEATS does: To taylor the filter to the structure of the series (in some optimal way)

Spectrum of non seasonal series

0 π 0 π/2 π

Spectrum of seasonal series

11

The decomposition can be multiplicative: irregular x )transitory(x seasonal x cycletrend_ t =Χ in which case:

- trend-cycle gives level - others expressed as factors

(in this case, usually multiplied by 100. Thus st = 103.7 implies that the seasonal effect for month t is an increase of 3.7 percent for that month series’ value.)

or additive: irregular + ) transitory + ( seasonal + cycletrend_ = x t . Since Χ= tt log x makes multiplicative → additive (in logs), we discuss additive decomposition.

12

The decomposition is of the type: zt = pt + st + (ct) + ut pt : trend st : seasonal ct : transitory ut : irregular or

zt = nt + st

nt : seasonally adjusted series nt = pt + (ct) + ut

Assumption:

COMPONENTS ARE ORTHOGONAL

(what causes seasonal fluctuations -weather, holidays, ...- has little to do with what causes the long-term evolution of the series -productivity, technology, ... )

13

SEATS allows for the sum of the components to respect the stochastic structure of the observed series. This stochastic structure is captured with an ARIMA model. Given the ARIMA model for the observed data:

) roots unit includes ( polynomial AR" Full " : ) B (

a ) B ( = z ) B ( tt

φ

θφ

or:

a ) B ( ) B (

= z tt φθ

SEATS decomposes zt in the following manner: 1) Factorize the AR polynomial (B) φ as in: (B) x (B) x (B) = (B) csp φφφφ

where: : (B)pφ trend roots

: (B)sφ seasonal roots : (B)cφ "transitory" roots (roots are assigned according to their associated frequency) Assumption: Two different components cannot share the

same AR root. Strictly speaking, the assumption is only needed for UNIT AR

roots. But it simplifies exposition.

14

2) Express zt as:

, u + a ) B ( ) B (

+ a ) B ( ) B (

+ a ) B (

) B ( = a

) B ( ) B (

tct

c

cst

s

spt

p

pt φ

θφθ

φθ

φθ

with ut white noise. Hence, model for components are: a ) B ( =p ) B ( ptptp θφ

a ) B ( = s ) B ( st sts θφ a ) B ( = c ) B ( ct ctc θφ ut = white noise If the spectra of all components are nonnegative, the decomposition is called ADMISSIBLE

15

Example: Let the model be tt12 a)B(x)B4.1( θ=∇∇− . Then, =∇∇−=φ 12)B4.1()B(

S)B4.1( 2∇−= We know that * )B4.1( − generates stationary (highly transitory) behavior,

* ∇ (and 2∇ ) generates trends, * S generates seasonality. Thus the allocation of roots will be

,)B4.1()B(

S)B(

)B(

c

s

2p

−=φ

∇=φ

16

and the series tx is decomposed as in the “Stochastic Partial Fraction Expansion”

tttt

tctc

sts

pt2

p

tt

ucsp

uaB4.1

)B(a

S

)B(a

)B(

a)B(

)B(x

+++=

+−

θ+

θ+

θ=

=φθ

=

where

,a)B(c)B4.1(

,a)B(sS

,a)B(p

ctct

stst

ptpt2

θ=−

θ=

θ=∇

and tu is white noise. All components are mutually orthogonal. Notice that components also follow ARIMA-type models and can be interpreted.

17

SEASONAL COMPONENT For a deterministic seasonal component, the sum over a year period of the component should be zero, st+ st-1 + … + st-11 = 0 (monthly data) or (1 + B + B2 + …+ B11) st = 0 . In short, if S = 1 + B + B2 + … + B11,

S st = 0

For "moving" or stochastic seasonality, this condition cannot hold for every t. (Precisely because component is moving.) But, in any case, the annual sum of st should, on average, be zero, and should not depart too much from it. Thus we may say S st = ast , where ast is w.n. , with E ast = 0 , Var (ast) = Vs relatively small; this yields a stochastic component (Harvey-Todd, 1983).

18

More generally, for the seasonal component, often: B + + B + B + 1 = S = ) B ( 1s-2

s Kφ where s = # of observations / year. Hence, a model for the seasonal of the type , w = s S tt where wt is a stationary ARMA model with: * zero mean * small variance, implies "annual aggregation of the seasonal component will on average be

zero, and will not depart too much from it”.

A Comment on Stationary Seasonal AR Roots

Assume the ARIMA model for the observed series contains the

seasonal AR factor

)B1( ssφ+ .

19

* When ks <φ ,

k = a preassigned (moderate) value (in SEATS: parameter

RMOD = .5 by default),

then factor is assigned to the transitory component.

(A small correlation whose effect disappears, in practice, after

one or two years cannot be properly called “seasonality”.)

* When ks >φ , (very rarely encountered)

the factor )B1( ssφ+ is associated with a stationary 2-year

period. It is thus assigned to the transitory component.

* When ks −<φ ,

the following identity is used

[ similar to )BB1()B1(B1 1ss −+++−=− K ] .

Let sφ denote now )( sφ− . Then,

)BBB1()B1(B1 1s1s22ss

−−ϕ++ϕ+ϕ+ϕ−=φ− K ,

where

[ ] s/1sφ=ϕ

(Ex.: →=φ 7.4 915.=ϕ

→=φ 7.12 987.=ϕ ) .

20

Then,

- the root )B1( ϕ− is assigned to the trend-cycle component.

- the roots of the polynomial

1s1s22s BBB1)B( −−ϕ++ϕ+ϕ+=ϕ K

are assigned to the seasonal component.

Thus the model for the seasonal component will in general be of the type

ststd

s a)B(sS)B( s θ=ϕ , (most often with 0=ϕ and 1d s = ), with sta a zero mean, small variance w.n. The model will be balanced (i.e.: total AR order = total MA order).

21

TREND Analogously, we may start with a deterministic trend, say pt = a + bt We know that ∇ pt = b, or ∇2 pt = 0 We cannot expect a "moving" trend to exactly satisfy the above conditions at every t. Instead, we require that departures from those conditions should, on average, cancel out, and that they should not be too large. This yields as a possible specification: ∇ pt = b + apt with E apt = 0 Var (apt) = Vp relatively small This stochastic trend specification is the well-known "random walk + drift" model. Alternatively, we could use as stochastic specification ∇2 pt = apt

22

with E apt = 0

Var (apt) = Vp relatively small

This is the so-called "second-order random walk" model. Notice that the 2 stochastic models are different:

∇ pt = b + apt implies a random shock in the slope of the trend

∇2 pt = apt implies a random shock in the change of the slope

of the trend

More generally, the specification of the stochastic trend will be of the type tt

d wpp =∇ where wt is a -zero mean -stationary ARMA process.

23

The model for the trend component can be expressed, in general, as ptpt

d

p a)B(p)B( p θ=∇φ ,

with (Maravall, 1993)

- φp (B) stationary (for example, (1--.8B)),

- d = (0), 1, 2, (3),

- θp(B) of low order,

- Var (apt) = a small fraction of Va.

The model will also be balanced.

24

In essence: SEATS finds admissible models for the components a ) B ( = p ) B ( ptptp θφ

a ) B ( = s ) B ( ststs θφ a ) B ( = c ) B ( ctctc θφ .n . w= ut such that u + c + s + p = x ttttt (Sum of component models ≡ ARIMA for observed series) At time t = T, SEATS PROVIDES - FOR t = 1,…, T, T+1,…T+FH ( FH = Forecast Horizon ) the decomposition:

u + c + s + p = x T|t T|t T|t T|t t

) x forecast ARIMAitsby replaced is x T > twhen ( |Ttt →→

where (for ex.) ) x x | s ( E = estimator MMSE = s T1t T|t K .

SEATS also provides standard error of estimators and forecasts.

25

ALLOCATION OF AR ROOTS Ex.: Quartely data Pseudospectrum:

Trend Roots

Unit AR roots at 0 = ω ( i.e., root B=1 in AR polynomial

0)1( =φ→ ).

Also:

Stationary roots for 0 =ω if large enough modulus.

Ex.: (1 - .8B) in AR polynomial.

"Large enough" = above the value of parameter RMOD

Spectrum ( Quaterly Series )

π/2 π 0

26

Seasonal roots

Seasonal frequencies:

ππ ,

2 (once-and twice-a year frequencies)

Roots at

[ ] - ,

2

εππ∈ω

ε±π∈ω

will be treated as seasonal ( : ε controlled by EPSPHI) Transitory * AR factors of the type ( 1 - .4B ) or ( 1 + .4B ) (i.e. roots for 0 = ω or πω = with small moduli, as

determined by RMOD)

* AR roots for

επε∈ω - 2

, + 0 (range of "cyclical frequency")

(i.e. between trend and first harmonic) * AR roots for "intraseasonal" frequencies * when Q > P : In this case, the SEATS decomposition yields

a pure MA ( Q - P ) component (hence transitory). Notice that, when Q > P, a transitory component will appear even when there is no AR factor allocated to it. Irregular

Always white noise

(Convenient for testing)

27

The TRANSITORY COMPONENT is always stationary, and hence

its effect is, by construction, transitory.

It will typically capture short-lived, fairly erratic behavior that is not

white noise, sometimes associated with ackward frequencies.

Its separate presence is justified by two considerations:

a) The variation it contains should not contaminate the trend or

seasonal components. Its removal permits to obtain smoother,

more stable trends or seasonals.

b) From the testing and diagnostics point of view, it is desirable to

preserve a purely white-noise irregular, computed as a residual.

However, in the final decomposition, it may be convenient to

combine the transitory and irregular components into a single

"transitory-irregular" component.

28

ALLOCATION OF AR ROOTS

Example: Quarterly data

εεεε εεεε εεεε

freq .

0 ππππ/2 ππππ

range of cyclical

frequencies

range of intraseasonal

frequencies

TO TRANSITORY TO TRANSITORY

TO TREND TO SEASONAL TO SEASONAL

29

An example:

Model for monthly observed series:

tt1232 a ) B ( = x ) B .512 + B .624 - B .78 - 1 ( θ∇∇

Regular AR polynomial factorizes as:

) B .64 + B 1.58 - 1 ( ) B .8 + 1 ( = B .512 + B .624 - B .78 - 1 232

Root of πω⇒ = ) B .8 + 1 ( 2/2 =ωπ=τ⇒ months

hence seasonal root

( 6 times-a-year frequency )

Roots of ⇒ ) B .64 + B 1.58 - 1 ( 2

complex root with modulus 8.r 2 =φ= ;

frequency ω (in radians) = = ) r 2 / ( arcos 1φ

rads .16 = ;

period months 40 2

= =ωπ

.

Thus complex root is associated with a 31/3 year

stationary cycle

⇒ to transitory component

30

Roots of ⇒∇ B - 1 = trend

Roots of ∇12 = B - 1 = 12

= ) B + + B + 1 ( ) B - 1 ( = 11K

S = ∇

⇒∇ trend

⇒S seasonal

* Grouping the roots, the series would be decomposed into:

- trend: a ) B ( = p pt pt2 θ∇

- seasonal: a ) B ( = s S ) B .8 + 1 ( st st θ

- transitory: a ) B ( = c ) B .64 + B 1.58 - 1 ( ctct2 θ

- irregular: .n . w= ut

* The AR polynomials of the models for the components are

determined.

31

DECOMPOSITION FOR THE “DEFAULT” (AIRLINE) MODEL

t121t12 a ) B + 1 ( ) B + 1 ( = x θθ∇∇

models for the components are of the type: )S( 212 ∇=∇∇

TREND-CYCLE

a ) B ( = p ptpt2 θ∇ , (A)

with order [ )B(pθ ] = 2 .

SEASONAL

a ) B ( = s ) B + + B + 1 ( stst11 θK (B)

with order [ )B(sθ ] = s - 1

(there is no transitory component)

IRREGULAR

ut ~ white noise (C)

33

SOME EXAMPLES OF MODEL SPECIFICATION (Monthly series)

A : Basic Structural Model (Harvey-Todd , 1983); ARIMA specifications.

B : ARIMA-Model-Based decomposition of Airline model (Default model TRAMO-SEATS)

C : ARIMA-Model-Based interpretation of X11 (Cleveland, 1975)

A B C

Trend Component a ) B + 1 ( = p t p t2 α∇ a ) B + 1 ( ) B + 1 ( = p t p t

2 α∇ a ) B .32 - B .30 + B .26 + 1 ( = p t p 32

t 2 ∇

Seasonal Component

a = s ) B ( S t s t a ) B ( = s ) B ( S t s st θ

11 order of ) B ( sθ

st12

t a )B .26 + 1 ( = s ) B ( S

Irregular Component

.n.w .n.w .n.w

Overall Series

a ) B ( = x t t 12 θ∇∇ ; 13 order of ) B ( θ parameters 3

a ) B + (1 B) + (1 = x t12

121t12 θθ∇∇ ; 13 order of ) B ( θ

parameters 2

a ) B ( = x t t 12 θ∇∇ ; 14 order of ) B ( θ parameters 0

See Maravall, 1985.

34

Model for SEASONALLY ADJUSTED SERIES can be obtained

by aggregation

nt = pt + ct + ut ,

For ex., for default model, since

) 2 2, (IMA .n . w+ ) 2 2, (IMA → ,

nt ~ IMA (2,2) , say

∇2 nt = θ2 (B) ant .

Typically one obtains:

θ2 (B) ≈ (1 - .9 B) (1 + α B) ,

with α of moderate size.

If (1 - .9B) cancels one ∇, the model becomes

∇ nt = ( 1 + α B) ant + k ,

with α small.

35

Hence model for SA series often is not far from the popular

"random walk + drift" model.

Remark:

Also we could aggregate the transitory and the irregular to yield a

stationary (transitory- irregular) component

vt = ct + ut

If ct is ARMA (pc, qc), then

vt is ARMA (pv, qv) with

pv = pc

qv = max (pc, qc)

However, a word of caution:

Transitory + Irreg. = Stationary deviations from SA and

detrended series

But trend is "short-term" trend

(i.e., a trend for short-term analysis)

and may contain variation for cyclical frequencies. More properly

called “trend-cycle”.

36

Ex: Quarterly data:

Thus "transitory-irregular component" in SEATS is not meant to

be interpreted as the economic "business cycle".

Note: The trend-cycle of SEATS can be decomposed in a second

run of SEATS into a "long-term trend" plus a "business cycle"

component (Kaiser and Maravall, 2001).

Trend for quaterly data

0

0,1

0,2

0,3

0,4

0,5

0,6

0,7

0,8

0,9

1

0π/30 π/4 π/2 π

37

IDENTIFICATION PROBLEM Example:

They both yield identical aggregate. Alternatively, if tp is invertible, we can remove some noise and add it to the irregular:

old trend = new trend + w.n.

Old trend

0 π

New irregular (w.n.)

0 π

New trend

0 π

New Components

0 π

Old Components

0 π

38

In gral: Can exchange noise among invertible components. Hence: * UNDERIDENTIFICATION problem: - There are ∞ models that yield the same aggregate - They only differ in the relative allocation of white noise to the

components.

SEATS follows solution of Pierce, Box-Hillmer - Tiao, and Burman: THROW ALL WHITE NOISE TO THE (WHITE-NOISE)

IRREGULAR COMPONENT

(⇒ MAXIMIZE THE VARIANCE OF IRREGULAR)

39

CANONICAL SOLUTION

: canonical component : any other admissible decomposition

Trend-Cycle

0 π

Seasonal Component

0 π

Irregular Component

0 π

Canonical Decomposition

0 π

40

PROPERTIES OF CANONICAL DECOMPOSITION - Maximizes ) u ( Var t

- Makes other components noninvertible:

• they display a spectral zero;

• they contain a unit MA root.

Ex. Seasonal:

) B - 1 ( factor contains ) B ( 0 = ) 0 ( g ss θ⇒

Canonical Seasonal Component

0 π

41

Two important properties of the canonical decomposition (Hillmer-Tiao) (1) Let p't be the trend-cycle component in any admissible

decomposition.

It can always be decomposed as

e + p = p ttt′ , (B) where: - ⊥ are e , p tt -pt is canonical trend-cycle -et is w.n. with 0 Ve ≥ . ( p can be replaced by s or c ) Hence: For an observed ARIMA model, the canonical

decomposition provides the "cleanest" signal.

42

(2) Canonical decomposition minimizes

Var (p-innovations) in components (except for ut ) Since the p-innov. is the source of the stochastic behavior of

component,

min. Var (p-innov.) ⇒ most stable components

(compatible with observed ARIMA)

Notice that:

- if there is an admissible decomposition,

there is a canonical decomposition.

- Given any admissible decomposition, the

canonical one can be obtained trivially.

43

Remark:

Sometimes, observed ARIMA model does not accept an

admissible decomposition.

Ex: Airline (default) model

a ) B + 1 ( ) B + 1 ( = x t 12

12 1t12 θθ∇∇

for 0 > ) ( > 112 θθθ , (a case seldom found),

the spectrum of ut becomes negative

SEATS modifies the model until a reasonable decomposable

approximation is found.

44

ESTIMATION OF THE COMPONENTS In brief: Assume, first, an ∞ realization. ] x x x [ = t- ∞∞Χ KK MMSE estimator of st: ) x= x F ; B = F ( jtt

j1

+−

= ) |s( E = s tt Χ

x ) F + B ( + = tjj

j1=j

0

υυ ∑

+ ) x + x ( + ) x + x ( + = 2t- 2t+ 21t- t+1 10 Kυυυ x ) F B, ( = tυ

) F B, ( ≡υ Wiener-Kolmogorov filter. - Convergent;

- Symmetric and centered;

- Adapts to the series;

45

WK FILTER Easy algorithm to obtain it: Assume we wish to estimate a signal, given by the model: φs (B) st = θs (B) ast ast ~ w.n (0, Vs) in series given by model: φ (B) xt = θ (B) at at ~ w.n (0, Va) as in xt = st + rt , rt = "rest" [Notice: φ (B) = φs (B) φr (B)] Write:

st = Ψs (B) ast ; )B()B(

)B(s

ss φ

θ=Ψ ;

xt = Ψ (B) at ; )B()B(

)B(φθ=Ψ ;

46

Then, for a doubly ∞ realization, the MMSE estimator of st is

given by the WK filter

tx

)F,B(filterWK

)F()B(

)F(s

)B(s

aV

sV

ts

444 3444 21ν=−

ΨΨ

ΨΨ= .

Thus, in order to estimate the signal, once the ARIMA model for

xt has been identified, only the model for the signal is needed.

(The other components can be ignored).

[ Note: if series is stationary, WK filter is equal to

)x(ACGF)s(ACGF

)F,B(t

t=ν ]

47

Expressing the Ψ - polynomials as functions of the θ - and φ -

polynomials, after cancelation of roots, one obtains:

)F(

)F()F()B(

)B()B(VV

)F,B( rsrs

a

s

θφθ

θφθ=ν ,

Hence, the filter is

- Symmetric

- Centered

- Convergent (invertibility of θ (B))

- Bounded

or:

WK filter to estimate st is ≡ ACGF of the ARMA model [ ] ;a)B()B(y)B( ytrst φθ=θ

=

a

syt V

V,0wna ,

a stationary model.

48

WK Seasonal Component

-0,05

0

0,05

0,1

0,15

0,2

0,25

0,3

0,35

1 12 24 36 48 60

WK Trend-cycle

-0,05

0

0,05

0,1

0,15

0,2

0,25

1 12 24 36 48 60

WK SA series

-0,4

-0,2

0

0,2

0,4

0,6

0,8

1 12 24 36 48 60

WK Irregular Component

-0,2

-0,1

0

0,1

0,2

0,3

0,4

0,5

0,6

1 12 24 36 48 60

49

Example: Estimate trend-cycle ∇2 pt = θp (B) apt in series with model ∇∇4 xt = θ(B) at , as in xt = pt + rt . We have:

2

pp

)B()B(

∇θ

S)B()B(

)B(2

4 ∇θ=

∇∇θ=Ψ

and

)F(

S)F(

)B(

S)B(k)F,B( pp

pp θθ

θθ

)FFF1S( 32 +++= The filter )F,B(pν is the ACF of the model

][ ytpt aS)B(y)B( θ=θ , ayt ~ w.n (0, kp)

Invertibility of )B(θ guarantees that the filter )F,B(ν is convergent in B and F.

50

CONVERGENCE of the filter implies that it can always be

truncated. Thus, for large enough series, the estimator tt x)F,B(s ν= can be assumed for the middle years of the sample. For ex., if data spans 20 years, for most series the full filter can be

assumed for the central 10 - 14 years. This estimator =ts FINAL or HISTORICAL ESTIMATOR We look next at its structure.

51

FINAL OR HISTORICAL ESTIMATOR We have: tst x)F,B(s ν= , (1) from which one obtains:

[ ] )(g)(G)(g x2

ss ωω=ω where

[ ]2ss )(~)(G ων=ω

Squared Gain of filter it determines which frequencies will contribute to the signal (that is, it filters the spectrum of the series by frecuencies).

52

Squared Gain of Filters: SA series

0

0,2

0,4

0,6

0,8

1

1,2

Squared Gain of Filters: Trend-cycle

0

0,2

0,4

0,6

0,8

1

1,2

Squared Gain of Filers: Seasonal Component

0,00

0,20

0,40

0,60

0,80

1,00

1,20

Squared Gain of Filters: Irregular Component

0,00

0,20

0,40

0,60

0,80

1,00

1,20

53

TESTING

PRESENCE / ABSENCE OF SEASONALITY;

DETERMINISTIC / STOCHASTIC SEASONALITY.

Absence or presence of seasonality:

Determined in AMI.

However:

Given that concept of seasonality somewhat implies NS, AMI in

TRAMO-SEATS is slightly biased towards seasonal

differencing.

Thus, on occasion, when a model of the type

[ ] t12

t12d a)B98.1()B(x)B( −θ=∇∇φ (D)

is obtained, it may be because of seasonal overdifferencing of

the model

µ+θ=∇φ ttd a)B(x)B( ,

a model that has no seasonality.

It can also be the result of the presence of deterministic

seasonality

∑ β+µ+θ=∇φ=

11

1iititt

d da)B(x)B( , (E)

where itd is a monthly seasonal dummy.

54

In both cases, superconsistency of 12θ will yield a value close

to -1.

To distinguish between the two cases, a simple F-test (easily

performed in TRAMO) yields good results.

(More on this issue latter.)

However ,

in the case in which there is highly stable seasonality in the

series, the stochastic specification (D) is maintained, instead of

the dummy-variable specification. Both are very close, and the

starting values lost in (D) are compensated by the 12 additional

parameters in (E) (µ plus 11 dummies). Yet (D) implicitly

allows the µ and β parameters in (E) to evolve –if need be–

very slowly, and the stable stochastic specification is likely to

outperform the dummy-seasonal specification.

Thus, no special treatment for stable (deterministic) seasonality

is needed.

It will be picked up well with the multiplicative structure

t12

t12 a)B99.1()(x)( −=∇ .

55

TESTING FOR UNDER/OVER ADJUSTMENT Underestimation of seasonality ⇒ Excess Variance in SA series Overestimation of seasonality ⇒ Variance of SA series is too small. In SEATS, the following comparison is performed. The variance of the stationary transformation of the SA series

and of the seasonal component are obtained for

- the theoretical value of the optimal estimator: )s(V t - the empirical value obtained for actual estimator: )s(V t (Bartlet’s approximation for )V(SD yields

2

1m

1j

2j0s 21

T2)V(SD

∑ ρ+γ==

).

56

Then: )s(V)s(V:H tt0 = . When V > (significantly) V ⇒ overestimation of seasonality; when

V < (significantly) V ⇒ underestimation of seasonality.

For ex.:

)010.SD(100.V

067.V

s

s

==

=

⇒ “EVIDENCE OF OVERESTIMATION OF SEASONALITY”.

57

ANOTHER REPRESENTATION OF INTEREST :

THE ESTIMATOR AS A FILTER APPLIED TO THE

INNOVATIONS IN THE OBSERVED SERIES

tst x)F,B(s ν=

using xt = ta)B()B(

φθ

[ ] tstst a)F,B(a)B()B(

)F,B(s ξ=

φθν=

)F,B(sξ = “PSIE-weights” (easy to obtain: Maravall, 1994) +ξ+ξ++ξ+=ξ 01

jjs BB)F,B( KK

applies to prior and concurrent innovations KK +ξ++ξ+ −−

jj1 FF

applies to "future" innovations (posterior to t) ξj = contribution of at-j to ts ξ-j = contribution of at+j to ts

58

Note ξξξξs (B,F) is: asymmetric non-convergent in B (unless series is stationary) convergent in F (always)

PSIE-WEIGHTS: SA series

-0,6

-0,4

-0,2

0

0,20,4

0,6

0,8

1

1,2

-24-21-18-15-12-9-6-303691215182124

PSIE-WEIGHTS: Trend-cycle

-0,2

0

0,2

0,4

0,6

0,8

1

1,2

-24-21-18-15-12-9-6-303691215182124

PSIE-WEIGHTS: Seasonal Component

-0,30

-0,20

-0,10

0,00

0,10

0,20

0,30

0,40

0,50

-24-21-18-15-12-9-6-303691215182124

59

As we shall see later, the filter is important to analyse revisions and convergence of the estimator, as well as SE of preliminary estimators . Example: ∇2 pt =θp (B) apt : SIGNAL ∇∇4 xt =θ (B) at : SERIES Then: tpt x)F,B(p ν= ,

ppp

p k)F(

S)F(

)B(

S)B()F,B(

θθ

θθ

=ν ,

where kp = Vp / Va , S = 1 + F + F2 + F3 . Thus

=∇θν= t2pt a

S)B(

)F,B(p

t

p

2

p

p a)F(

S)F()B(k

θθ

∇θ

=

part in B part in F Notice:

't

ppt

2 a)F(

S)F()B(p

θ

θθ=∇

with a2p

't Vk)a(Var = . Somewhat different from model for

SIGNAL above.

60

Previous remark brings a point of general interest: MODEL FOR COMPONENT versus MODEL FOR ESTIMATOR

We have

MODEL FOR SERIES

tt a)B(x)B( θ=φ (“observed”)

MODEL FOR COMPONENT (two components)

[ ]) B ( ) B ( ) B ( , nsx nsttt φφ=φ+=

a ) B ( = s) B ( stss t θφ

MMSE estimator for ts (doubtly infinite realization):

tnsns

st x)F(

)F()F(

)B(

)B()B(ks

θ

φθ

θ

φθ=

it is found:

MODEL FOR ESTIMATOR

't

nssts a

)F(

)F()F()B(s)B(

θ

φθθ=φ

)aka( ts't =

61

Comparison of the model for the component with that of the

estimator shows the effects induced by the estimation filter.

Stationary

transformation

Stationary model

Part in B Part in F

Component

Estimator

=φ ts s)B(

=φ ts s)B(

)B(sθ

)B(sθ )F(

)F()F( ns

θ

φθ

Component and estimator share

− the stationarity-inducing transformation (in particular,

the differencing)

− the (stationary) part in B

Difference: estimator includes a part in F (reflecting the 2-sided

character of the filter). This part is a convergent polynomial in F.

Component and estimator will have different ACF and spectrum.

The different model structures of component and estimator have

some implications of applied relevance.

62

One implication

It is (close to) standard practice to build models on seasonally

adjusted data.

This is based on the belief that, by removing seasonality, model

dimensions can be reduced.

This belief is wrong. Example: DEFAULT MODEL a ) B + 1 ( ) B + 1 ( = x t

12121t 12 θθ∇∇

Decomposes into:

θ

θ∇

a ) B ( =s S

a ) B ( = n

st st

nt nt2

The model for the estimator of the SA series has ACF of model:

= n ) B + 1 ( ) B + 1 ( t

212121 ∇θθ

a S ) B ( ) B ( = t nn θθ , an ARIMA (13,2,15) model.

63

Set, for instance, .4- = 1θ .6- = 12θ . The MA expansions (or ψ -weights) of the stationary transformation of - the original series - the seasonally adjusted series, are the following:

64

LAG ORIGINAL SERIES SA-SERIES (ESTIM.)

0 1 1.00 1 - 0.4 -1.33 2 - 0.38 3 - - 4 - - 5 - - 6 - - 7 - - 8 - - 9 - -

10 - - 11 - - 12 - 0.6 -0.40 13 0.24 0.53 14 - -0.15 15 - - 16 - 0.37 17 - 0.15 18 - 0.06 19 - 0.02 20 - 0.01 21 - - 22 - - 23 - - 24 - -0.24 25 - 0.32 26 - -0.09 27 - - 28 - - 29 - - 30 - - 31 - - 32 - - 33 - - 34 - - 35 - - 36 - -0.14 37 - 0.19 38 - -0.05

Hence: * Model for SA series: MORE COMPLEX

* No reduction in dimension if SA series is used.

65

This is a reason to avoid modelling SA series ↓ they will have coefficients for seasonal and large lags.

A second implication: Broadly, the difference between theoretical component and

estimator is the following

Component: a ) B ( = s ) B ( t s sts θφ

Estimator: a ) F ( ) B ( = s ) B ( tssts αθφ

Difference: )F(

)F()F() F ( ns

s θ

φθ=α

When )F(sθ or )F(nφ contain unit roots, given that these

roots will appear in the MA part of the estimator, the estimator will

not be invertible.

When tn (what is removed in order to obtain ts ) is NON-

STATIONARY → )B(nφ will contain unit roots.

66

Example: Default (Airline) model.

Component models:

a ) B ( = n nt2t2 θ∇

a ) B ( = s S st11t θ

Thus S)B(s =φ .

S ≡ 11 unit root.

Therefore, tn will be NI because of these unit roots.

Recall: the presence of seasonality (in general) ⇒ unit AR

roots in model for seasonal.

67

Consequence:

In gral, for tn

* No convergent AR representation (nor VAR representation)

exists.

AVOID USING AR MODELS TO MODEL SA SERIES

68

General result:

n + m = x t t t

m t ⇒ is Noninvertible if

tn is Nonstationary (Maravall, 1995)

Hence in a standard

trend + seasonal + irregular

decomposition, with NS trend and NS seasonality, all three :

u and , s , p t t t will be NI.

Noninvertibility of the estimators

(and hence previous implications)

is a fairly general property of SA and detrending methods

(including X11)

69

Another important applied result:

We saw ) ( g ] ) ( G [ = ) ( g x

2uu ωωω ,

where u denotes now any of the components, and

) ( g

) ( g = ) ( G

x

uu ω

ωω ≡ Gain of filter .

Thus

) ( g ) ( g

) ( g = ) ( g u

x

uu ω

ω

ωω

Since 1 ) ( g

) ( g

x

u ≤

ω

ω,

for all components:

spectrum of component ≥ spectrum of estimator.

In particular, for the stationary transformation, When some other component is present, the estimator will

always underestimate the stochastic variance of the component

(bias towards “stability”).

)estimator(Var.)comp(Var ≥ .

70

The loss of variance counterpart is the appearance of

crosscovariances between components’ estimators. (As shall be

seen later, these crosscovariances can also be modelled.)

In a particular application, to see if the empirical estimates agree

with the model, their variances and ACF should be compared to

those of the model for the estimator, not to those of the model for

the component.

71

ACF OF TREND: Theoretical Component

-0,60

-0,50

-0,40

-0,30

-0,20

-0,10

0,00

0,10

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

ACF OF TREND: Theoretical MMSE Estimator

-0,4

-0,3-0,2

-0,1

00,1

0,20,30,4

0,5

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

ACF OF TREND: Empirical Estimate

-0,4-0,3-0,2-0,1

00,10,20,30,40,50,6

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

72

JOINT DISTRIBUTION OF THE ESTIMATORS

From the models for the estimators, the variances, ACFs,

spectra, and so on, can be obtained for their stationary

transformations (ST).

We can further obtain the

(THEORETICAL) CROSS-COVARIANCE FUNCTION

between any pair of estimators (ST).

Therefore:

- Given our Normality assumption, the joint distribution of the (ST

of the) estimators is known;

- it is fully determined by the “observed” ARIMA;

- this knowledge permits us to devise simple tests having to do

with issues related to the decomposition obtained in a particular

application.

73

The properties of the estimators have been derived for the case

of an ∞ realization.

Since WK-filter is convergent (in B and in F), in practice it could

be approx. with a finite (2-sided) filter.

Estimators that are obtained with the full filter:

FINAL (OR HISTORICAL) ESTIMATOR

The time it takes for the filter to converge depends on:

- stochastic structure of the series,

- stochastic structure of the component.

Ex. Monthly series with seasonality.

For many, 3 years of revisions are enough.

( Most are completed in 5 years )

Assuming 3 years, if series has 180 observations,

for the central 108 the component estimator could be

considered final.

74

FINITE SERIES ; PRELIMINARY ESTIMATION

Observed series: [x1, x2, …, xT]

Consider WK filter to estimate SA series ( tn )

To obtain T|t 1

n there is no problem: filter has converged to that

for final estimator.

WK SA series

-0,2

0

0,2

0,4

0,6

0,8

1

-k 0 k

Final Estimator and End-Points Problem

-0,5

0

0,5

1

1,5

2

2,5

3

3,5

4

t1 t2 T

75

However, the filter cannot be used to obtain T|t 2n because

convergence of the filter requires future observations, not yet

available.

(same problem near the beginning of the series)

way to proceed (Preliminary Estimators)

1) EXTEND SERIES WITH FORECASTS AND

BACKCASTS (ARIMA ONES)

2) APPLY FILTER TO EXTENDED SERIES

(Cleveland and Tiao, JASA, 1976)

In this way, a PRELIMINARY ESTIMATOR is obtained.

Preliminary Estimator

-0,5

0

0,5

1

1,5

2

2,5

3

3,5

4

T forecasts

76

As new observations become available, it will be revised, until the

final estimator is obtained.

The most important preliminary estimator: T|Tn

Forecasts of n are obtained in the same way as preliminary

estimators, simply by extending the series further.

Concurrent Estimator

-0,5

0

0,5

1

1,5

2

2,5

3

3,5

4

T

Forecast

-0,5

0

0,5

1

1,5

2

2,5

3

3,5

4

77

In SEATS, for monthly data:

24-months-ahead forecasts are computed for the series and

components.

In general, if MQ is the number of observations per year, the

number of forecasts computed is max (2MQ, 8).

FINAL ESTIMATOR:

=ν= tst x)F,B(s

= … + ν1 xt-1 + ν0 xt + ν1 xt+1 + …

PRELIMINARY ESTIMATOR:

Obtained by replacing observations not yet available with

forecasts.

Let

T|ts : Estimator of st when last observation is xT

78

For example:

=−1t|ts … + ν1 xt-1 + ν0 1t|tx − + ν1 1t|1tx −+ + …

↑ ↑

1 p.a.f. 2 p.a.f.

obtained as

ARIMA forecasts

In summary, for finite realization:

[x1 , x2, …, xT]

Preliminary Estimator:

x ) F B, ( = s eT|t sT|t υ

= xe

T|t [backcasts, observations, forecasts]

i.e., series extended with forecasts and backcasts

No need for long extensions:

Burman-Wilson algorithm: only a few forecasts and backcasts

are needed. (Typically, about 2 years)

Note: Preliminary estimator will imply an asymmetric filter, and

will be subject thus to a phase effect.

79

As new observations become available:

s T|t → s 1T+|t → ... s kT+|t → ...

the estimator of s t is revised.

As ∞→ k , (in practice, “large enough”)

→s kT+|t s t (the "final" or "historical" estimator)

(In practice,

st ≡ Historical or Final Estimator is valid for

central years of the series)

80

STRUCTURE OF THE SA SERIES AVAILABLE AT TIME T:

For a particular realization ] x , , x , x [ T21 K ,

what we have is a sequence of estimators:

... s T|100T- ... s |TjT- ... s T|T

s T|100T- ≡ FINAL EST. = s 100T-

s |TjT- ≡ PRELIMINARY EST. (j covering a few years)

s T|T ≡ CONCURRENT EST.

Each one of these estimators is the output of a different model.

(Each j ⇒ a different model.)

Therefore, SA series is a mixture of realizations with different

underlying models.

Thus: SA series available at some point in time is nonlinear

(≅ time-varying parameters model).

* Another reason to avoid using SA in modeling.

81

PRELIMINARY ESTIMATORS AND REVISIONS

Preliminary estimators and revisions are implied by the use of

TWO-SIDED FILTER

KK + x + x + x + x + = s 2t+ 2t+1 1t01t- 1t υυυυ

Two-sided filter is

- necessary to avoid phase effects;

- implied by MMSE ("optimal") estimation in model-based

approach.

Starting with concurrent estimator:

Observations: ] x , , x [ t1 K

KK +x + x + x + x + = s t | 3t+ 3t | 2t+ 2t | 1t+ 1t0t|t υυυυ

1 p.a. forecast 2 p.a. forecast

Notice that:

Given that all forecasts are l.c. of jtx − (j = 0, 1, 2, …), t|ts is

implicitely obtained with a one-sided filter.

82

New observation )x ( 1t+ arrives.

New revised estimator (1-period revision)

KK + x +x + x + x + = s 1t+ | 3t+ 31t+ | 2t+ 21t+ 1t01t+ | t υυυυ

new observation

updated forecast

Likewise, when 2tx + becomes available, the 2-period revision of the concurrent estimator will be given by

KK + x +x +x +x + x + = s 2t|3t32t21t1t01t12t+ | t ++++− υυυυυ

and so on.

Of course, to revise series is always disturbing and an

inconvenience.

But it is due to the fact that knowledge of the future helps us to

understand the present ( a very basic fact of life! ).

To suppress revisions is

- to ignore relevant information,

- to distort our measurements.

83

Revisions:

1-period revision:

.)n.w(a

)xx()xx(ssr

1t1

t|2t1t|2t2t|1t1t1t|t1t|t)1(

t|t

=ξ=

=+−ν+−ν=−=

+

++++++ K

( 1ξ = a constant) .

2-period revision:

)1(MA

aa

)xx(

)xx()xx(ssr

2t21t1

t|3t2t|3t3

t|2t2t2t|1t1t1t|t2t|t)2(

t|t

=

ξ+ξ=

=+−ν+

+−ν+−ν=−=

++

+++

+++++

K

…………………………………..

k-period revision:

)1k(MA

aassr ktk1t1t|tkt|t)k(

t|t

−=

=ξ++ξ=−= +++ K

84

For the full revision in the concurrent estimator :

s - s = r t|t tt + ) x - x ( = t|1t+ 1t+ 1υ

K + ) x - x ( + t | 2t+ 2t+ 2υ

K + (2) e + (1) e = t2t1 υυ

where:

) j ( et : j-th-period-ahead forecast error of the series

[ 1tt a)1(e +=

1t12tt aa)2(e ++ ψ+=

…………………………… ].

85

Hence

∑∞

=υ=

1jtjt )j(er

depends on:

- forecast errors

- weights of the WK filter

Thus:

- interest in "small" forecast errors ( X11 → X11 ARIMA)

- but revision still depends on the s j ′υ ,

WHICH DEPEND, in turn, ON THE STOCHASTIC

STRUCTURE OF THE SERIES

( i.e., the ARIMA model ).

For some series, the revision can be large;

for other series, they may be small.

Also, for some series the revision will last long;

for others it will disappear fast.

86

THUS, FOR A GIVEN SERIES, THERE IS AN

APPROPRIATE AMOUNT OF REVISION.

THE REVISION SHOULD NOT BE LARGER THAN THAT,

NOR SHOULD IT BE SMALLER.

Two features of the revision process are of relevance:

- the size of the revision

- the duration of the revision process.

Often one finds there is a trade-off between them.

87

ERROR IN THE ESTIMATOR OF A COMPONENT

In the context of Seasonal Adjustment, concern with the error

made when measuring seasonality has been periodically

expressed (Bach et al. 1976; Moore et al. 1981; Bank of

England 1992). This need is especially left for key variables that

are (explicitly or implicitly) being subject to some type of

targeting (e.g., a monetary aggregate or a consumer price

index). In these cases, intrayear monitoring and policy reaction

is based on the SA series (e.g., see Maravall 1988).

We are concerned with the precision of the

* concurrent estimator and forecasts

* first revisions

* final estimator

* some rates of growth.

The associated MSE are straightforward to obtain.

From the previous discussion, it is clear that the error will be different for

a) final estimator, ts

b) preliminary estimator, K,2,1k;s kt|t ±±=+ ,

(which also includes forecasts).

88

Total estimation error in the estimator T|ts

T|ttT|t ss −=ε ,

it can be expressed as the sum of the two errors,

)ss()ss( T|ttttT|t −+−=ε ,

where the first error

ttt sse −=

is the error in the final estimator , and the second error

T|ttT|t ssr −=

denotes the revision in the estimator T|ts .

* te and T|tr are orthogonal (Pierce 1979)

thus, for example, )r(V)e(V)(V T|ttT|t +=ε .

89

REVISION ERROR: Size and Convergence

Express, as before, component as filter of innovations in series:

x ) F B, ( = s tst υ

a ) B ( ) B (

) F B, ( = ts φθ

υ ,

or

a ) F B, ( = s tst ξ

* Divergent in B

* Convergent in F

Write:

a ) F ( + a ) B ( = s 1t+ +

st -

st ξξ

The filter F)B, ( sξ can be easily computed (Maravall, Journal of

Forecasting, 94).

90

For a concurrent estimator:

a ) B ( t-

sξ : Effect of starting conditions and present and

past innovations in series.

a ) F ( 1t++

sξ : Effect of future innovations.

Taking conditional expectations at time t ,

a ) B ( = s t-

st|t ξ

the revision is given by rt = s - s t|t t ; or

,

a zero-mean convergent one-sided (stationary) MA.

a ) F ( = r 1t+ +

st ξ

91

HISTORICAL (OR FINAL) ESTIMATION ERROR

Because of its stochastic nature, the historical estimator s t contains an estimation error

)ss(e ttt −=

* "unobservable"

* finite variance

* can derive distribution.

In particular, te has ACF and spectrum of the model (Pierce,

80)

[ ] etnst a)B()B(e)B( θθ=θ ,

eta ∼ wn

a

ns

V

VV,0

92

ERROR ANALYSIS: SOME APPLICATIONS

A. From knowledge of the models for the different types of

estimation errors, one can build standard

TESTS FOR THE SIGNIFICANCE OF SEASONALITY

in a particular application, such as, for example,

0s:H 0 = ,

where s is a vector of estimators with known covariance matrix.

Notice that it may be possible to detect significant seasonality

with the final estimator, yet the forecasts of the seasonal

component for the next year may be worthless.

B. Proper intrayear monitoring of the economy is greatly

facilitated.

For example: Assume an increase in unemployment of 10000

persons in last month, as measured with (the concurrent

estimator of) the SA series. We can easily test for whether this

increase is significantly different from zero.

Naturally, economic policies based on some (explicit or implicit)

annual (or biannual, …) targeting, where short-term control is

typically based on the SA series, the variance of the estimation

error of seasonality can be used to build confidence intervals

around the estimated SA series . In this way, the question “are

we growing too much?” (or “too little”) can be answered in a

more rigorous manner.

93

Historical Estimation Error: never known.

The best we can do: Historical Estimator.

Hence, from applied point of view, perhaps CI should only

consider the Revision Error.

(“How far can I be from my eventual best measurement?”)

C. USE IN MODEL ESPECIFICATION

The possibility of deriving properties of the components can be

of help in the choice of the proper model.

It is often the case that several ARIMA specifications seem

about equally acceptable from the fitting and out-of-sample

forecasting criteria. In these cases, one can look at the

decompositions implied by the “sample equivalent” models, and

select the one that offers the most appealing decomposition.

Some important criteria that can be used in the comparison are

the following:

• Stability of the components

One may wish to remove a seasonal component as stable as

possible. Thus one may seek the decomposition with

min [ ])a(Var st .

• Precission of the estimator

(better detection of seasonality…)

• SMALLER REVISIONS

(and fast convergence) .

(examples in Bank of Spain web site).

94

AMB used as “fixed filter”: SEATS by default (RSA = 0). A remark on the DEFAULT MODEL "Airline Model" (Box-Jenkins, 1970)

µθθ∇∇ + a ) B +1 ( ) B +1 ( = x t12

121t12 The annual difference of the monthly growth (rate-of-growth if in

logs) is a stationary process, with constant variance

* Parameters have "structural” interpretation θ1 → stability of trend θ12 → stability of seasonal ( values close to -1 produce stable components ) σa → overall unpredictability * Often found * Displays very well-behaved filters * Can encompass many models (in a fairly robust way)

95

Ex.: - deterministic trend: 9.9- 1 →θ - deterministic seasonal: 9.9- 12 →θ - even white noise ! θ1( and )9.9- 12 →θ • No need for the dilema: Deterministic vs. Stochastic. • Overdifferencing does little damage. • Good idempotency properties. • Good for pretesting.