MFx
–
MacroeconomicForecasting
MFx
–
Macroeconomic
Forecasting
IMFx IMFx
This training material is the property of the Internatio nal Monetary Fund (IMF) and is intended for use in IMF
Ii fC iDl (ICD) A i h ii fhICD I
nst
itute
f
or
C
apac
ity
D
eve
lopment
(ICD)
courses.
A
ny reuse requ
ires t
h
e perm
iss
ion o
f
t
h
e
ICD
.
EViews® is a trademark of IHS Global Inc.
PropertiesofTimeSeries Properties
of
Time
Series
L-1: Introduction
Introduction Introduction
•
Generalcomments
•
General
comments
–Univariateanal
y
sis
y
–
Twogeneral
“
classes
”
ofprocesses
–
Two
general
classes
of
processes
hd(
d
)
–Bot
h
science an
d
art
(
ju
d
gement
)
:
•Understandin
g
behavior and forecastin
g
gg
•
Assessing/testing Assessing/testing
Introduction Introduction
•
Univariate
analysis
Univariate
analysis
Stochasticprocess
vs
timeseries
–
Stochastic
process
vs
time
series
Draw from the
p
rocess
p
p.d.f. of
Y
df
of
Y
t
p.
d
.f.
ofY
p
.
d
.f.
of
Y
t+1
pd of Y
t+2
Time series, subset of the draw
Introduction Introduction
•Two
g
eneral “classes” of
p
rocesses
gp
–
Stationary
vs
nonstationary
Stationary
vs
nonstationary
–
Unchangeddistribution(
pdf
)overtime?
–
Unchanged
distribution
(
pdf
)
over
time?
Coariancestationar
–
Co
v
ariance
stationar
y:
Udiil di
•
U
ncon
di
t
iona
l mean an
d
var
iance constant
() ( )
ttj
E
YEY
2
() ( )
ttjY
VarY VarY
Ciddi
j
hh l db
() ( )
ttj
() ( )
ttjY
•
C
ovar
iance
d
epen
d
s on t
ime
j
t
h
at
h
as e
lapse
d
b
etween
observations notonreferenceperiod: observations
,
not
on
reference
period:
()()
CovY Y CovY Y
(
,
)(
,
)
ttj ssj j
CovY Y CovY Y
Introduction Introduction
•Stationar
y
?
y
√ √
X X
√ √
X X
X X
X X
X X
X X
Introduction Introduction
•
Understandingbehaviorandforecasting Understanding
behavior
and
forecasting
Find the
“best” ARMA
Forecast
YesYes
model
Is Y Y
stationar
y
?
y
Transform
(
difference or
No No
(
other
)
No No
)
Introduction Introduction
•
AssessingandTesting Assessing
and
Testing
M4M4
Find the
“best” ARMA
Forecast
Yes Yes
model
Is Y Y
stationar
y
?
Diagnostic
y
Transform
Diagnostic
tests
(
difference or
NoNo
Unitroottests
Diagnostic
tests
M3, Part 1 M3, Part 1
(
other
)
No No
Unit
root
tests
tests
)
M3, Part 2 M3, Part 2
Outline Outline
•
Part1:Stationaryprocesses Part
1:
Stationary
processes
Identification
–
Identification
–Estimation & Model Selection –
Puttingitalltogether
–
Putting
it
all
together
•Part 2: Nonstationar
y
p
rocesses
–
Characterization
–
Characterization
i
–Test
ing
PropertiesofTimeSeries Properties
of
Time
Series
Part 1: Stationar
y
Time Series
y
L
2Identification
L
-
2
:
Identification
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Justtoremindyou Just
to
remind
you
….
Id tifi ti
•
Id
en
tifi
ca
ti
on
•
Estimation&ModelSelection Estimation
&
Model
Selection
•Puttin
g
it all to
g
ether
gg
Identification Identification
hfi iili i hd
T
h
e
fi
rst step
is v
isua
l inspect
ion: grap
h
an
d
observe
y
our data.
y
“You can observe a lot
just b
y
watchin
g”
“You can observe a lot
just b
y
watchin
g”
jy g jy g
Yogi Berra
Identification Identification
Does the series look stationary?
√√
√√
√√
√√
AR(1)
MA(1) XX
XX
XX
AR(1)
XX
XX
AR(1)
Identification Identification
Assuming Assuming
thattheprocessisstationarythere
Assuming Assuming
that
the
process
is
stationary
,
there
arethreebasictypesthatinterestus: are
three
basic
types
that
interest
us:
•Autore
g
ressive
(
AR
)
11 22
....
ttt ptpt
y
ab
y
b
y
b
y
g()
11 22
ttt ptpt
yyy y
•
MovingAverage(MA)
11 22
...
tttt qtq
y
uu u u
Moving
Average
(MA)
11 22
tttt qtq
y
bb b
•
Combined(ARMA)
11 22
...
tttptp
y
a
by by by
•
Combined
(ARMA)
uu u u
11 22
...
tt t qtq
uu u u
Identification Identification
Somenotation Somenotation
:
Some
notation Some notation
:
•AR
(p),
MA
(q),
ARMA
(
p,q
),
where
p,q
refer to the
(p), (q), (
p,q
),
p,q
order order
(maximumlag)oftheprocess
order order
(maximum
lag)
of
the
process
•
isa
“
whitenoise
”
disturbance:
•
t
is
a
PropertiesofTimeSeries Properties
of
Time
Series
Part 1: Stationar
y
Time Series
y
L
3Sometoolsforidentification
L
-
3
:
Some
tools
for
identification
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Wherearewe?Wherearewegoing? Wherearewe?Wherearewegoing? Where
are
we?
Where
are
we
going? Where
are
we?
Where
are
we
going?
•Stationar
y
p
rocess
(
visual ins
p
ection
)
y y
yp (
p
)
y y
•
Learnedaboutpossibleprocessesfor
y y
•
Learned
about
possible
processes
for
y y
•Need to identify which one in order to
understand, then eventuall
y
forecast
y y
y
y y
toolstohelpidentify toolstohelpidentify tools
to
help
identify tools
to
help
identify
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Autocovariance Autocovariance
andautocorrelation andautocorrelation
Autocovariance Autocovariance
and
autocorrelation and autocorrelation
•Relations between observations at different la
g
s:
g
Ai
–
A
utocovar
iance:
jttj
E
yy
Autocorrelation:
j
–
Autocorrelation:
0j
j
– –
ACFor
“
ACFor
“
Correlogram Correlogram
” ”
:graphofautocorrelationsat
0
– –
ACF
or
ACF
or
Correlogram Correlogram
:
graph
of
autocorrelations
at
each la
gg
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Back to our previous examples… Back to our previous examples…
Di
ff
erent Di
ff
erent
ff ff
p
atterns:
p
atterns:
p p
AR(1), b
07
Geometric Geometric
b
1
=
0
.
7
decay decay
MA(1) MA(1)
,
1
=0.7
Cutoff Cutoff
1
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Partialautocorrelation Partialautocorrelation Partial
autocorrelation Partial autocorrelation
•
The
p
th
partial
autcorrelation
isthe
p
th
coefficientofa
•
The
p
th
partial
autcorrelation
is
the
p
th
coefficient
of
a
li i f
it l t
li
near regress
ion o
f
y
t
on
it
s
lags up
t
o p:
ˆˆ ˆ
11 22ˆˆ ˆ
ˆ...
tttptpt
yabyby by e
•
Thus,
PAC
p
=
ˆb
Thus,
PAC
p
•
Relationshipbetween
y
and
y
controllingforeffectsof
p
b
•
Relationship
between
y
t
and
y
t-p
,
controlling
for
effects
of
otherlagsupto
p
other
lags
up
to
p
•For example, for p= 3, regress
y
t
on
y
t-1
,
y
t-2
,
y
t-3
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
SomeidentifiablepatternsforACF,PACF SomeidentifiablepatternsforACF,PACF Some
identifiable
patterns
for
ACF,
PACF Some
identifiable
patterns
for
ACF,
PACF
•
GeometricdecayofACFinAR(1)oscillatingifb<0
•
Geometric
decay
of
ACF
in
AR(1)
,
oscillating
if
b<0
.
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
SomeidentifiablepatternsforACF,PACF SomeidentifiablepatternsforACF,PACF Some
identifiable
patterns
for
ACF,
PACF Some
identifiable
patterns
for
ACF,
PACF
•
GradualdecayofACFinAR(p)tendingtowardzero
•
Gradual
decay
of
ACF
in
AR(p)
,
tending
toward
zero
ltil ikl
re
la
ti
ve
ly qu
ic
kl
y.
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
SomeidentifiablepatternsforACF,PACF SomeidentifiablepatternsforACF,PACF Some
identifiable
patterns
for
ACF,
PACF Some
identifiable
patterns
for
ACF,
PACF
•
Abrupt
dropoff
inPACFinAR(p)afterlagp
•
Abrupt
dropoff
in
PACF
in
AR(p)
after
lag
p
.
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
SomeidentifiablepatternsforACF,PACF SomeidentifiablepatternsforACF,PACF Some
identifiable
patterns
for
ACF,
PACF Some
identifiable
patterns
for
ACF,
PACF
•
OppositepatternsforMA(q):abrupt
dropoff
inACFafter
•
Opposite
patterns
for
MA(q):
abrupt
dropoff
in
ACF
after
dld t d iPACF
q, gra
d
ua
l d
ecay
t
owar
d
zero
in
PACF
.
PropertiesofTimeSeries Properties
of
Time
Series
Part 1: Stationar
y
Times Series
y
L
4Lookingcloseratidentification
L
-
4
:
Looking
closer
at
identification
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Wenowhaveatool(ACF,PACF)tohelpusidentifythe Wenowhaveatool(ACF,PACF)tohelpusidentifythe We
now
have
a
tool
(ACF,
PACF)
to
help
us
identify
the
We
now
have
a
tool
(ACF,
PACF)
to
help
us
identify
the
stochastic
p
rocess underl
y
in
g
a time series we are stochastic
p
rocess underl
y
in
g
a time series we are
pyg pyg
observin
g
. observin
g
.
g g
Nowwewill: Nowwewill: Now
we
will:
Now
we
will:
•
Summarizethebasicpatternstolookfor
•
Summarize
the
basic
patterns
to
look
for
•
Observeanactualdataseriesandmakeaninitialguess
•
Observe
an
actual
data
series
and
make
an
initial
guess
Ntt tit( llt ti)bd thi
•
N
ex
t
s
t
ep: es
ti
ma
t
e
(
severa
l a
lt
erna
ti
ves
)
b
ase
d
on
thi
s
guess guess
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
ACF PACF
h
ll
'
ll
b'
SfSf
W
h
ite noise A
ll
's= 0 A
ll
b'
s = 0
Geometricdecay
Cutoff after la
g
1
;
S
ummary o
f
S
ummary o
f
AR(1)
Geometric
decay
(oscillating if b<0)
g;
1
= b
1
Decaystowardzero
the the
AR(p)
Decays
toward
zero
,
may oscillate
Cutoff after lag p.
Geometricdecay
the
the
patterns patterns
MA(1)Cutoff after lag 1.
Geometric
decay
(oscillating if
<0)
patterns
patterns
lklk
<0)
MA
(q)
Cutoff after la
g
q
.
Decay (oscillating
if
0)
to
loo
k
to
loo
k
(q)
gq
if
<
0)
df
Geometric deca
y
fo
r:
fo
r:
ARMA(1,1)
Geometric
d
ecay a
f
ter
lag 1 (oscillating if b<0)
y
after lag 1
(oscillatingif
b<
0)
fo fo
(oscillating
if
b<
0)
ARMA(p,q) Decay (direct or
Decay (direct or
oscillatory) after
oscillatory) after lag q lag p
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Some ti
p
s Some ti
p
s
p p
’hd ldbi f
•ACF
’s t
h
at
d
o not go to zero cou
ld
b
e s
ign o
f
nonstationarity
•ACF of both AR
, ARMA deca
y
g
raduall
y,
dro
p
s to 0 for MA
,ygy,p
•
PACFdecaysgraduallyforARMAMAdropsto0forAR
•
PACF
decays
gradually
for
ARMA
,
MA
,
drops
to
0
for
AR
Pibl h Pibl h
biih i i l d
• •
P
oss
ibl
e approac
h P
oss
ibl
e approac
h
:
b
eg
in w
it
h
pars
imon
ious
low or
d
er
AR, check residuals to decide on possible MA terms.
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
WhenlookingatACF,PACF WhenlookingatACF,PACF When
looking
at
ACF,
PACF
When
looking
at
ACF,
PACF
•Box-Jenkins
p
rovide sam
p
lin
g
variance of the
ppg
observedACFandPACFs(
r
s
and
b
s
)
observed
ACF
and
PACFs
(
r
s
and
b
s
)
•
Permitsonetoconstructconfidenceintervalsaround
•
Permits
one
to
construct
confidence
intervals
around
h
hth iifitl0
eac
h
assess w
h
e
th
er s
ign
ifi
can
tl
y ≠
0
•Com
p
uter
p
acka
g
es
(
EViews
)
p
rovide this
ppg(
)p
automatically! automatically!
PropertiesofTimeSeries Properties
of
Time
Series
Part 1: Stationar
y
Times Series
y
L
5Estimation
L
-
5
:
Estimation
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Estimation&ModelSelection: Estimation&ModelSelection: Estimation
&
Model
Selection: Estimation
&
Model
Selection:
•
Decideonplausiblealternativespecifications(ARMA)
•
Decide
on
plausible
alternative
specifications
(ARMA)
•Estimate each s
p
ecification
p
•
Choose
“
best
”
modelbasedon:
•
Choose
best
model
,
based
on:
Significanceofcoefficients
–
Significance
of
coefficients
Fit
vs
parsimony(criteria)
–
Fit
vs
parsimony
(criteria)
Whitenoiseresiduals
–
White
noise
residuals
Abilitytoforecast
–
Ability
to
forecast
Accountforpossiblestructuralbreaks
–
Account
for
possible
structural
breaks
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
FitFit
vsvs
parsimony(informationcriteria): parsimony(informationcriteria):
Fit
Fit
vsvs
parsimony
(information
criteria): parsimony
(information
criteria):
•
Additionalparameters(lags)automaticallyimprovefitbut
•
Additional
parameters
(lags)
automatically
improve
fit
but
reduceforecastquality reduce
forecast
quality
.
Tdffbt fitd i idl d
it iit i
•
T
ra
d
eo
ff
b
e
t
ween
fit
an
d
pars
imony; w
id
e
ly use
d
cr
it
er
ia cr
it
er
ia:
–
AkaikeInformation Criterion (AIC) AIC = T AIC = T lnln
(
SSR
)
SBC=T SBC=T
ln ln
(SSR) (SSR)
+ +
(p (p
+ +
q q
+ +
1) 1)
ln ln
( (
T T
) )
SBC
=
T
SBC
=
T
ln ln
(SSR)
(SSR)
+ +
(p
(p
+ +
q
q
+ +
1)
1)
ln ln
( (
T T
) )
SBC SBC
illt dt f
iii
dlth
AIC AIC
• •
SBC
SBC
w
ill
t
en
d
t
o pre
f
er more pars
im
in
iousmo
d
e
ls
th
an
AIC AIC
.
Part 1: Stationar
y
Time Series
White noise errors: White noise errors:
y
• •Aim to eliminate autocorrelation in the residuals eliminate autocorrelation in the residuals
(could indicate that model does not reflect the lag structure well)
Pl t“ t d di d id l ”(
/
)
•
Pl
o
t
“
s
t
an
d
ar
di
ze
d
res
id
ua
ls
”
(
it
/
)
No more than 5% of them should lie outside [-2,+2] over all periods
•
Lookat
r
b
(andsignificance)atdifferentlags
•
Look
at
r
s
,
b
s
(and
significance)
at
different
lags
•Box Box--Pierce Statistic Pierce Statistic: joint significance test up to lag s:
H
all
r
0
H
0
:
all
r
k
=
0
,
H
1
: at least one r
k
0
22
1
s
ks
k
QT r
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
(
Antici
p
ate M4
)
(
Antici
p
ate M4
)
(p)(p) Forecastability: Forecastability: Forecast
ability: Forecast ability:
Chllhdlf“fl”
••
C
an assess
h
ow we
ll
t
h
e mo
d
e
l f
orecasts
“
out o
f
samp
le
”
:
hdlf b
l(
flhf f
•Estimate t
h
e mo
d
e
l f
or a su
b
-samp
le
(
f
or examp
le, t
h
e
f
irst 250 out o
f
300observations
)
300
observations
)
.
••
Useestimatedparameterstoforecastfortherestofthesample(
last50
)
Use
estimated
parameters
to
forecast
for
the
rest
of
the
sample
(
last
50
)
•
Computethe
“
forecasterrors
”
andassess:
Compute
the
forecast
errors
and
assess:
–
Mean S
q
uared Prediction Error
q
–
Granger-NewboldTest
–Diebold-Mariano Test
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
(AnticipateM4) (AnticipateM4) (Anticipate
M4)
(Anticipate
M4)
Atfiblttlbk Atfiblttlbk A
ccoun
t
f
or poss
ibl
e s
t
ruc
t
ura
l b
rea
k
s:
A
ccoun
t
f
or poss
ibl
e s
t
ruc
t
ura
l b
rea
k
s:
•Does the same model a
pp
ly
e
q
uall
y
well to the entire sam
p
le,
ppy q y p
or do
p
arameters chan
g
e
(
si
g
nificantl
y)
within the sam
p
le?
pg(gy)p
Howtoapproach Howtoapproach
:
How
to
approach How
to
approach
:
•
Ownpriors/suspicion:Chowtestforparameterchange
•
Own
priors/suspicion:
Chow
test
for
parameter
change
If i t t i ti ti t t f t
•
If
pr
iors no
t
s
t
rong, recurs
ive es
ti
ma
ti
on,
t
es
t
s
f
or parame
t
er
tbilit th l f l CUSUM
s
t
a
bilit
y over
th
e samp
le,
f
or examp
le,
CUSUM
.
PropertiesofTimeSeries Properties
of
Time
Series
Part 1: Stationar
y
Times Series
y
L
6Puttingitalltogether
SimulatedData
L
-
6
:
Putting
it
all
together
—
Simulated
Data
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Let
’sfirstworkwithsimulateddata Let’sfirstworkwithsimulateddata
Lets
first
work
with
simulated
data Lets
first
work
with
simulated
data
–
LookathowMA(1)AR(1)seriesare Look
at
how
MA(1)
,
AR(1)
series
are
iltd
s
imu
la
t
e
d
•
inExcel in
Excel
•in EViews
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Let’s first work with simulated data Let’s first work with simulated data •View
g
raph
g
•View ACF, PACF do they behave as expected? •Decide on alternative specifications (one correct, one or more
incorrect)
•Estimate and compare the results •Use the EViews“Automatic ARIMA Modeling” feature
Does the correct specification “win”? Does the correct specification “win”?
PropertiesofTimeSeries Properties
of
Time
Series
Part 1: Stationar
y
Times Series
y
L
7:Puttingitalltogether
Realworlddata
L
-
7:
Putting
it
all
together
—
Real
world
data
Part1:StationaryTimeSeries Part
1:
Stationary
Time
Series
Nowlet
’sworkwithrealworlddata Nowlet’sworkwithrealworlddata
Now
lets
work
with
real
world
data Now
lets
work
with
real
world
data
File“M3Serieswf1” File
“M3
_
Series
.wf1”
•View Sheet “PE_ratios” and choose a series:
–Look at the graph and correlogramfor a specific time series –Does it appear to be stationary?
•
A
g
ain, choose two
(
or more
)
p
ossible s
p
ecifications
g()pp
–
Estimate, com
p
are results
(
coefficients, AIC/SBC, ACF of residuals
)
p( )
–
Use “Automatic ARIMA Modelin
g
”
g
Whichspecification
“
wins
”
? Whichspecification
“
wins
”
?
Which
specification
wins? Which
specification
wins?
PropertiesofTimeSeries Properties
of
Time
Series
Part 2: Nonstationar
y
Times Series
y
L
8Introduction
L
-
8
:
Introduction
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Introduction: Introduction: Introduction: Introduction: KQti KQti K
ey
Q
ues
ti
ons:
K
ey
Q
ues
ti
ons:
•
Whatis
nonstationarity
?
What
is
nonstationarity
?
•
Whyisitimportant?
•
Why
is
it
important?
•How do we determine whether a time series is
n
o
n
stat
io
n
a
r
y
?
ostatoay
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Whatis Whatis
nonstationarity nonstationarity
??
What
is
What
is
nonstationarity nonstationarity
??
RecallfromPart1 RecallfromPart1 Recall
from
Part
1
:
Recall
from
Part
1
:
•Covariance stationarityof
y
implies that, over time,
y
has:
–Constant mean –Constant variance –Co-variance between different observations that do not depend on
time (
t
), only on the “distance” or “lag” between them (
j):
()()
CovY Y CovY Y
(
,
)(
,
)
ttj ssj j
CovY Y CovY Y
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
What is What is nonstationarit
y
nonstationarit
y
? ?
y y
•
Thusifanyoftheseconditionsdoesnotholdwesay Thus
,
if
any
of
these
conditions
does
not
hold
,
we
say
that
y
is
nonstationary nonstationary
:
that
y
is
nonstationary nonstationary
:
Thereisnolong
runmeantowhichtheseriesreturns
–
There
is
no
long
-
run
mean
to
which
the
series
returns
(itfl
t
ilibi ilibi
)
(
econom
ic concep
t
o
f
long-
t
erm equ
ilib
r
ium equ
ilib
r
ium
)
–
The variance is time-dependent. For example, could go to ifiit th b fb ti tifiit in
fi
n
it
y as
th
e num
b
er o
f
o
b
serva
ti
ons goes
t
o
in
fi
n
it
y
hl ldd l
–
T
h
eoretica
l autocorre
lations
d
o not
d
ecay, samp
le
tltid ll
au
t
ocorre
la
ti
ons
d
o so very s
low
ly.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Nonstationary Nonstationary
seriescanhaveatrend: seriescanhaveatrend:
Nonstationary Nonstationary
series
can
have
a
trend: series
can
have
a
trend:
••
Deterministic Deterministic
nonrandomfunctionoftime
••
Deterministic Deterministic
:
nonrandom
function
of
time
:
, where u
t
is “iid”
tt
y
tu
•
Example: Example:
045 045
=
0
.
45
=
0
.
45
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
NonNon
--
stationaryseriescanhaveatrend: stationaryseriescanhaveatrend:
Non Non
stationary
series
can
have
a
trend: stationary
series
can
have
a
trend:
• •
Stochastic Stochastic
randomtrendvariesovertime
• •
Stochastic Stochastic
:
random
trend
,
varies
over
time
–Random Walk:
1 tt t
y
yu
–
RandomWalkwithDrift:
yyu
–
Random
Walk
with
Drift:
(bf
d
)
1 ttt
yyu
(
as
b
e
f
ore, u
t
is ii
d
)
•
is the “Drift”; if
>o, then
y
t
will be increasin
g
y
t
g
QtiRWi il fht ? QtiRWi il fht ? Q
ues
ti
on:
RW
is a spec
ia
l case o
f
w
h
a
t
process
? Q
ues
ti
on:
RW
is a spec
ia
l case o
f
w
h
a
t
process
?
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Exampleofarandomwalk: Exampleofarandomwalk: Example
of
a
random
walk: Example
of
a
random
walk:
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Exam
p
le o
f
a random walk with dri
f
t: Exam
p
le o
f
a random walk with dri
f
t:
pf f pf f
= 2.0 = 2.0
Note:simulatedwiththesamedisturbancesasintheRandom Note:simulatedwiththesamedisturbancesasintheRandom Note:
simulated
with
the
same
disturbances
as
in
the
Random
Note:
simulated
with
the
same
disturbances
as
in
the
Random
Walkinpreviousslide Walkinpreviousslide Walk
in
previous
slide
.
Walk
in
previous
slide
.
PropertiesofTimeSeries Properties
of
Time
Series
Part 2: Nonstationar
y
Times Series
y
L
9Consequences
L
-
9
:
Consequences
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
KeyQuestions: KeyQuestions: Key
Questions: Key Questions:
•
Whatis
nonstationarity
?
What
is
nonstationarity
?
••
Whyisitimportant? Whyisitimportant?
••
Why
is
it
important? Why
is
it
important?
•How do we determine whether a time series is
n
o
n
stat
io
n
a
r
y
?
ostatoay
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Consequencesofnon Consequencesofnon
--
stationarity stationarity
Consequences
of
non Consequences
of
non
stationarity stationarity
Sh kd t“di t”
•
Sh
oc
k
s
d
o no
t
“di
e ou
t”
•
Statisticalconsequences Statistical
consequences
ld b f
–Non-norma
l d
istri
b
ution o
f
test statistics
–
BiasinARcoefficients;poorforecastability Bias
in
AR
coefficients;
poor
forecast
ability
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Shocksdonotdieout Shocksdonotdieout Shocks
do
not
die
out Shocks
do
not
die
out
C id lAR(1)
•
C
ons
id
er a genera
l AR(1)
:
yby
1 ttt
yby
•Can be expressed as an MA(q):
221 ttt
yby b b b b
01221
...
tttt
yby b b b b
The impact of shocks (disturbances) will depend on
value of b.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
221 ttt
yby b b b b
01221
...
tttt
yby b b b b
Three cases: Three cases: 1
b
<1
b
t
→0as
t
→∞sotheeffectofashockwill
1
.
b
<
1
,
b
t
→
0
as
t
→
∞
,
so
the
effect
of
a
shock
will
di iih ti l di
m
in
is
h
as
ti
me e
lapses
1t
2.b= 1
, b
t
= 1 for all t
;
effect
p
ersists
,
0 tti
y
y
,
;p,
variancegrowsindefinitelywithtime
0i
variance
grows
indefinitely
with
time
3.b> 1, shocks become more influential more influential over time
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Statisticalconsequencesof Statisticalconsequencesof
nonstationarity nonstationarity
Statistical
consequences
of
Statistical
consequences
of
nonstationarity nonstationarity
NN
lditibti ft tttiti lditibti ft tttiti
N
on
N
on--norma
l di
s
t
r
ib
u
ti
on o
f
t
es
t
s
t
a
ti
s
ti
cs norma
l di
s
t
r
ib
u
ti
on o
f
t
es
t
s
t
a
ti
s
ti
cs
ff (
b’
)
h
•Bias in autorregressivecoe
ff
icients
(
b’
s
)
; we mig
h
t
mistakenly estimate an AR(1), deficient forecast
•
Usualconfidenceintervalsforcoefficientsnotvalid Usual
confidence
intervals
for
coefficients
not
valid
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Statistical conse
q
uences o
f
non Statistical conse
q
uences o
f
non--stationarit
y
stationarit
y
f
or
f
or
qf qf
y y
f f
multivariateregressions( multivariateregressions(
anticipatingM6 anticipatingM6
) )
multivariate
regressions
( multivariate
regressions
(
anticipating
M6 anticipating M6
) )
•
Forexampletwo
unrelated unrelated
nonstationary
series
y
•
For
example
,
two
unrelated unrelated
nonstationary
series
y
and
z
mightappeartoberelatedthroughastandard
and
z
might
appear
to
be
related
through
a
standard
OLS i OLS
regress
ion
–
High R
2
–
t-statistics that appear to be significant
–The true test: are the regression residuals regression residuals stationary? (i.e.,
long-run equilibrium relationship between
y
and z?)
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Spuriousregressionpracticalexercise: Spuriousregressionpracticalexercise: Spurious
regression
practical
exercise:
Spurious
regression
practical
exercise:
Simulatetworandomwalkseries:
y
and
z
–
Simulate
two
random
walk
series:
y
and
z
(
)
(
each with its own disturbances, and either can have drift or not
)
–
Note that by construction by construction, they are unrelated
–
Run OLS re
g
ression of
y
on z,evaluate coefficients, R
2
, and
g
y
p
lot residuals.
p
PropertiesofTimeSeries Properties
of
Time
Series
Part 2: Nonstationar
y
Times Series
y
L
10Unitroottests
L
-
10
:
Unit
root
tests
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
KeyQuestions: KeyQuestions: Key
Questions: Key Questions:
•
Whatis
nonstationarity
?
•
What
is
nonstationarity
?
•Wh
y
is it im
p
ortant?
yp
• •
Howdowedeterminewhetheratimeseriesisnon Howdowedeterminewhetheratimeseriesisnon
- -
• •
How
do
we
determine
whether
a
time
series
is
non How
do
we
determine
whether
a
time
series
is
non
- -
stationary? stationary? stationary? stationary?
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Testingfornon Testingfornon
--
stationarity stationarity
Testing
for
non Testing
for
non
stationarity stationarity
•
RecallAR(1)model
yby
•
Recall
AR(1)
model
:
1 ttt
yby
•S
p
ecial case: RW, when b= 1
p
•
Stationarity
requires
1
b
•
Stationarity
requires
l()
1
b
•Genera
lizing to AR
(
p
)
:
–
Roots of the
p
ol
y
nomial below must all be >1 in abs value
py
23
12 3 3
1 ...
p
bz bz bz bz
Ifoneoftheroots=1then
y
issaidtohavea
unitroot unitroot
12 3 3
–
If
one
of
the
roots
=
1
,
then
y
is
said
to
have
a
unit
root unit root
.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Testingfornon Testingfornon
--
stationarity stationarity
Testing
for
non Testing
for
non
stationarity stationarity
•
AR(1)model
yby
•
AR(1)
model
:
1 ttt
yby
•Can test for whether
y
is a driftlessrandom walk:
y
–
H
0
:
b
=
1
H
0
:
b
1
Orequivalently
b
1
yy
Or
,
equivalently
:,
=
b
–
1
1 ttt
yy
H
0
= 0
0
•
Thisisthe
“
Dickey
-
Fuller
”
(DF)test:
•
This
is
the
Dickey
-
Fuller
(DF)
test:
R
it l t tf i ifi f ffii t
–
R
egress
y
on
it
s
lag,
t
es
t
f
or s
ign
ifi
cance o
f
coe
ffi
c
ien
t
.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Testingfornon Testingfornon
--
stationarity stationarity
Testing
for
non Testing
for
non
stationarity stationarity
CanextendsimpleDFtestinpreviousslide Can
extend
simple
DF
test
in
previous
slide
:
•Interce
p
t:
1 ttt
y
by
p
•
Interceptandtimetrend:
1
ybyt
•
Intercept
and
time
trend:
llh
b
h
1
tt t
ybyt
•In a
ll
t
h
ree cases, H
0
:
b
= 0;
y
h
as a unit root
Rejectingtheunitroottest Rejectingtheunitroottest
=
findingthat
y
isstationary
Rejecting
the
unit
root
test
Rejecting
the
unit
root
test
finding
that
y
is
stationary
Note Note
:criticalvaluesforthet
statisticsof
b
willvarydepending
Note Note
:
critical
values
for
the
t
-
statistics
of
b
will
vary
depending
onwhetherintercepttrendareincluded on
whether
intercept
,
trend
are
included
.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Someterminology Someterminology Some
terminology Some terminology
••
Orderofintegration Orderofintegration
numberoftimesaseries
y
must
••
Order
of
integration Order
of
integration
:
number
of
times
a
series
y
must
bdiff db i b
e
diff
erence
d
to
b
ecome stat
ionary
•
Thus,if
y
is
“
integratedoforderzero
”
,I(0),thenitis
Thus,
if
y
is
integrated
of
order
zero,
I(0),
then
it
is
stationary(nodifferencingneeded) stationary
(no
differencing
needed)
.
Thti iti tti i
llll
–
Th
a
t
is,
it
is s
t
a
ti
onary
in
leve
ls
leve
ls
•If
y
is I(1), then its firstdifference (
y
) is stationary
andsoon
…
and
so
on
…
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Movingbeyondwhitenoisedisturbances Movingbeyondwhitenoisedisturbances Moving
beyond
white
noise
disturbances Moving
beyond
white
noise
disturbances
DFtestassmesthat
is hitenoise
DF
test
ass
u
mes
that
t
is
w
hite
noise
.
•However, if
t
is autocorrelated, need different
t
versionofthetest,allowingforhigher
-
orderlags:
version
of
the
test,
allowing
for
higher
order
lags:
•
AugmentedDickey
Fuller(ADF)test:
•
Augmented
Dickey
-
Fuller
(ADF)
test:
ppp
11
,
1
ppp
ttitit iij
y
t
yy
b and b
11
111
,
ttitit iij
iij
yyy
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
A
DF tes
t A
DF tes
t
•
AswithDFADFtestswhethercoefficienton
y
(
)
0
•
As
with
DF
,
ADF
tests
whether
coefficient
on
y
t-1
(
)
0
khi
•Must ma
k
e c
h
o
ices
–Intercept, trend, both, none? – –p p: how many lags? (test statistics are very sensitive to p p)
•AIC •
S
B
C
SC
•
General
-
to
-
specific(startoutwithlarge
p p
thenre
-
estimate
General
to
specific
(start
out
with
large
p p
,
then
re
estimate
withsuccessivelysmaller
p
)
with
successively
smaller
p
)
PropertiesofTimeSeries Properties
of
Time
Series
P2
Ni
Ti S i
P
art
2
:
N
onstat
ionary
Ti
mes
S
er
ies
L-11: Testing for nonstationarit
y
,
alternative tests
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
DF,ADFhavebeenfoundtohavelowpowerin DF,ADFhavebeenfoundtohavelowpowerin DF,
ADF
have
been
found
to
have
low
power
in
DF,
ADF
have
been
found
to
have
low
power
in
certaincircumstances: certaincircumstances: certain
circumstances: certain circumstances:
•Stationary processes with near-unit roots
–
Forexample,difficultydistinguishingbetween
b
=
1and
For
example,
difficulty
distinguishing
between
b
1
and
b
=095especiallywithsmallsamples
b
=
0
.
95
,
especially
with
small
samples
.
Tdtti
•
T
ren
d
s
t
a
ti
onary processes
So alternative tests have been desi
g
ned.
g
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Philli
p
s Philli
p
s
– –
Perron Perron
(
PP
)
Test:
(
PP
)
Test:
p p
() ()
•
Formulation:
where
u
isI(0)
**
ytyu
Formulation:
,
where
u
t
is
I(0)
andmaybe
heteroskedastic heteroskedastic
and and
autocorrelated autocorrelated
that
1 ttt
ytyu
and
may
be
heteroskedastic heteroskedastic
and
and
autocorrelated autocorrelated
, ,
that
isfollowinganARMA(
pq
)
is
,
following
an
ARMA(
p
,q
)
.
H
0
•
H
0
: =
0
•PP corrects for an
y
serial correlation and
y
heteroskedasticit
y
in the errors u
t
b
y
directl
y
y
t
yy
modif
y
in
g
the test statistics.
yg
•
OneadvantageofPP:noneedtospecifylaglength One
advantage
of
PP:
no
need
to
specify
lag
length
.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Kwiatkowski Kwiatkowski
– –
Philli
p
s Philli
p
s
– –
Schmidt Schmidt
– –
Shin
(
KPSS
)
Test: Shin
(
KPSS
)
Test:
p p
() ()
•
Nullhypothesis:
y
is
trendstationary
Null
hypothesis:
y
is
trend
stationary
•
Formulation:
0
yD u
•
Formulation:
0
1
tttt
yD u
Wh
D
id iii (
1
tt t
–
Wh
ere
D
t
conta
ins
d
eterm
in
ist
ic components
(
constant or constant
plustimetrend
)
isarandomwalk
plus
time
trend
)
,
t
is
a
random
walk
H
:
therefore
isaconstant
y
istrend
2
0
–
H
0
:
therefore
is
a
constant
,
y
is
trend
stationary
0
stationary
.
–
H
1
:
2
0
H
1
:
–
KPSScriticalvaluesareobtainedbysimulationmethods
0
KPSS
critical
values
are
obtained
by
simulation
methods
.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Afewnotes: Afewnotes: A
few
notes: A
few
notes:
•
DFADFandPParecalled“unitroottests”thenull
•
DF
,
ADF
,
and
PP
are
called
“unit
root
tests”
;
the
null
hhiih
hiiI(1)hih
h
ypot
h
es
is
is t
h
at
y
t
h
as a un
it root;
is
I(1)
or
hi
g
h
er.
•
KPSS,ontheotherhand,isa“
stationarity
test
”
,null
KPSS,
on
the
other
hand,
is
a
stationarity
test,
null
hypothesisisthat
y
isI(0)
hypothesis
is
that
y
t
is
I(0)
.
C t ifi ti i k it t dt d
•
C
orrec
t
spec
ifi
ca
ti
on
is
k
ey:
in
t
ercep
t
an
d
t
ren
d
should be included when appropriate.
•
Structuralbreakscancomplicatemattersfurther Structural
breaks
can
complicate
matters
further
.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Aunifiedwayoflookingattheunitroottests Aunifiedwayoflookingattheunitroottests A
unified
way
of
looking
at
the
unit
root
tests A
unified
way
of
looking
at
the
unit
root
tests
Slightlydifferentrepresentation Slightly
different
representation
:
tt
y
tu
tt
y uu
In practice, In practice,
H
1
hitt
1 ttt
uu
this is what this is what
H
0
:
=
1
y
h
as a un
it
roo
t
EViews EViewsdoes does
H
1
: |
|< 1
y
is stationary
(test for (test for
). ).
•If
t
is white noise, then DF can be used
t
•
If
t
isARMA(
p,q
)thenuseADForPP.
If
t
is
ARMA(
p,q
)
then
use
ADF
or
PP.
PropertiesofTimeSeries Properties
of
Time
Series
P2
Ni
Ti S i
P
art
2
:
N
onstat
ionary
Ti
mes
S
er
ies
L-12: Some exercises with simulated
data
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Simulatethreeprocessesin Simulatethreeprocessesin
EViews EViews
Simulate
three
processes
in
Simulate
three
processes
in
EViews EViews
•
Stationaryprocesswithnear
unitroots
•
Stationary
process
with
near
-
unit
roots
•Trend stationar
y
p
rocess
yp
•
AnI(1)process
•
An
I(1)
process
hh db h bh
•Grap
h
t
h
em an
d
o
b
serve t
h
eir
b
e
h
avior
•
Conduct
UnitRoot/
Stationarity
Testsonallthree
Conduct
Unit
Root/
Stationarity
Tests
on
all
three
.
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
In
“
SimulatedTimesSeriesExamples.xlsx
”
In
“
SimulatedTimesSeriesExamples.xlsx
”
In
Simulated
Times
Series
Examples.xlsx In
Simulated
Times
Series
Examples.xlsx
Si lt I(0) ith t t lb k Si lt I(0) ith t t lb k Si
mu
la
t
e an
I(0)
process w
ith
a s
t
ruc
t
ura
l b
rea
k
Si
mu
la
t
e an
I(0)
process w
ith
a s
t
ruc
t
ura
l b
rea
k
Importinto
EViews
Import
into
EViews
•
Graphandobserve
•
Graph
and
observe
•Conduct Unit Root/Stationarit
y
Tests
y
PropertiesofTimeSeries Properties
of
Time
Series
P2
Ni
Ti S i
P
art
2
:
N
onstat
ionary
Ti
mes
S
er
ies
L-13: Some exercises with real-world
data
Part2:
Nonstationary
TimeSeries
Part
2:
Nonstationary
Time
Series
Nowlet
’sworkwithrealworlddata Nowlet’sworkwithrealworlddata
Now
lets
work
with
real
world
data Now
lets
work
with
real
world
data
•Choose a series:
–Look at graph and correlogramfor a specific time series –Does it appear to be non-stationary? –Does it appear to have a trend, or a structural break?
•
UndertakeUnitRoot/
Stationarity
Tests
Undertake
Unit
Root/
Stationarity
Tests
Dothedifferenttestsagree?
–
Do
the
different
tests
agree?
Ifyoususpectastructuralbreak re
testfortwosub
samples
–
If
you
suspect
a
structural
break
,
re
-
test
for
two
sub
-
samples