Professional Documents
Culture Documents
Time Series Tricks
Time Series Tricks
com/2015/05/time-series-tricks/
HOME ABOUT ME
When you
deal with YOUR OPINIONS
1 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
handle it in
This blog is intented for students that want to
July 2015 (2)
Stata. At
learn Stata in a nutshell. June 2015 (1)
least, for
Michela Guicciardi (c) Copyright 2015
May 2015 (1) Mansar Theme. Powered by WordPress.
Today I am going to
Stata to recognize
AIC append arima autocorrelation
them.
BIC change format cluster command
2 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
there are no gaps in [DO YOU WANT TO BE UPDATED? -----> SIGN UP]
month). You can anything new from your last visit (my fault!), this is your best
solution:
easily notice it, if this
Sign up, subscribe and be notified when I create new
is the case in your
contents.
data, because Stata No more wonderings!
called the tsset
Subscribe
command. How can
time series.
play a bit!
Autocorrelation
and Cross-
Correlation
We can start by
exploring
autocorrelation and
cross-correlation.
Autocorrelation
3 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
Autocorrelation
represents the
correlation between
pac commands to
investigate it. ac
produces a
correlogram (a graph
of autocorrelations)
with pointwise
confidence intervals
that is based on
MA(q) processes. In
the correlation
value of the
logarithmic
transformation of wpi
to define the q in
MA(q) only in
produces a partial
correlogram (a graph
of partial
autocorrelations) with
4 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
confidence intervals
calculated using a
standard error of
1/sqrt(n). The
optionally be
included on the
the correlation
to define the p in
AR(p) only in
stationary series. So
type:
ac ln_wpi, lags(10)
will obtain.. I
way to visualize
autocorrelations.
5 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
the corrgram
command that
creates a table in
which are
shown both ac and
numerically. If you
example, I typed:
corrgram ln_wpi,
lags(10)
6 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
Pierce’Q statistic,
correlation up to lag
series shows
significant
autocorrelation given
therefore, we can
autocorrelated. The
AC shows a slow
suggesting non-
stationarity. The
series is non-
stationary is by
plotting it.
7 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
As we can observe,
so it cannot be
stationary at all.
Cross-
correlation
If you want to
explore the
relationship between
independent variable
dependent variable
specify several
you to graphically
relationship. I, for
example, typed:
8 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
lags(10)
xlabel(-10(1)10,grid)
logarithmic
transformation, the
cross correlation is
almost useless
because, as we can
expect, the
relationship across
in zero.
Lag Selection
Criteria
There is something
you cannot
9 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
underestimate when
out relevant
information. There
criterion procedures
a proper selection of
Schwarz’s Bavesian
Akaike’s information
or AIC. I usually
there’s a useful
command in Stata
10 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
them.
In order to explore
complete, dataset:
use http://www.stata-
press.com/data/r11
/lutkepohl2.dta
varsoc command to
criterion procedures:
Varsoc ln_inc
ln_consump,
maxlag(10)
sometimes it can
happen to get
conflicting results. In
11 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
of 2. There are
need to be sure on
are recommended to
consult them.
the presence of a
section, we
demonstrate how to
at logarithmic
transformation of
root.
12 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
The Dickey-Fuller
null hypothesis is
command is:
investment series
acceptance region.
13 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
stochastic trends
(unit root) is by
difference of the
Panicked? Of course,
believe it!
observe the
associated regression
Dickey-Fuller test,
regress option.
term in the
associated
regression. In our
case:
14 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
trend regress
hypothesis of a time
could it be possible?
on the first
differenced series of
investments, which
one:
see Stata’s
“xtunitroot”
15 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
command.
tuned!
Michela Guicciardi
cross-correlation DF
Tweet
By
Michela
https://www.linkedin.c
/pub/michela-
guicciardi
/82/839/6a1
http://www.econometric
16 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
Time A multi-
Series on variate
Stata: way of
Forecastingmodeling
by time
Smoothing series:
VAR
Leave a Reply
Comment
Name *
17 of 18 26/1/20, 8:45 pm
Time Series Tricks http://econometricstutorial.com/2015/05/time-series-tricks/
Email *
Website
Post Comment
Notify me of follow-up
comments by email.
18 of 18 26/1/20, 8:45 pm