Advanced econometrics and Stata
L9-10 Time series
Dr. Chunxia Jiang
Business School, University of Aberdeen, UK
Beijing , 17-26 Nov 2019
Finance models & time series data
 Many applications in finance are concerned with the
analysis of time series data
 Monthly observations of a company’s share prices
 Quarterly observations on GDP
 Data can be observed at different but regular intervals
(yearly, quarterly, monthly, daily, seconds – high
frequency data)
Things to be careful about when
using time series data
 One time series variable can influence another
with a lag
 If variables are non stationary, they cause a
problem of spurious regression
 Non-stationary variables should not be included in
the regression model
 We can transform variables to make them
stationary
 We can check whether they are cointegrated
Stochastic processes
 A random or stochastic process is a collection of random
variables ordered in time
 i.e. GDP for a particular year could be any number,
depending on economic and political environment. The
figure in the sample for that year is a particular
realization of all such possibilities
 GDP is a stochastic process and actual values we
observed are particular realization of that process
 In time series, we see the realization to draw inferences
about the underlying stochastic process
Stochastic processes
 A stochastic process is said to be stationary if its mean and
variance are constant over time and the value of the covariance
between two time periods depends only on the distance or gap
or lag between the two periods and not the actual time at which
the covariance is computed
 If a time series is stationary, its mean, variance, and autocovariance
(at various lags) remain the same no mater at what point we
measure them: they are time invariant
 If a time series is not stationary, it is called a nonstationary time
series
 A nonstationary time series will have a time-varying mean or a time-
varying variance or both
Random walk
 Random walk without drift (no constant or intercept
term)
 Random walk with drift (with constant)
t
t
t u
Y
Y 
 1
Unit root stochastic process
 If rho=1, we face the unit root problem: a situation of
nonstationarity
 We say that the series contains a unit root.
 If the absolute value of rho is less than 1, the time
series is stationary
1
1
1 



  
 t
t
t u
Y
Y
A stationary AR(1) series and a random walk
-10
0
10
20
30
40
50
60
70
1 16 31 46 61 76 91 106 121 136 151 166 181 196 211 226 241 256 271 286 301 316 331 346 361 376 391 406 421 436 451 466 481 496
yt ynst
Stationary
Non-Stationary
Why are stationarity so important
 If a time series is nonsationary, we can study its
behaviour only for the time period under
consideration.
 It is not possible to generalize it to other time periods.
 For the purpose of forecasting, such a time series may
be of little practical value
Tests for stationarity
 Autocorrelation function
 Unit root test
Autocorrelation
 When we consider a time series variable we want to look at
how its value today is correlated to its value yesterday, or
two days ago, three days ago…
 These correlations are called autocorrelations
 For a stationary series the first autocorrelation tends to be
quite high but the effect dies out quickly
 For a non-stationary series, the correlations are very high
even when considering several lags
Univariate time series analysis
 Autocorrelations are useful but not enough to
determine whether a series is stationary
 We need to carry out some regression analysis
 Let’s look at the simple representation of a time series
called Autoregressive Process of order 1 or AR(1):
t
t
t e
y
y 

 1


1


1


1

 Stationary
Non Stationary
Explosive
Univariate regression analysis
 Let’s take the previous AR(1) process:
 Given that a value of θ equals to 1 indicates that
the series is non-stationary, to find out about
stationarity we could simply use a t test for the null
hypothesis that θ=1, against the alternative that is
less than 1.
 Unfortunately this is not the correct procedure.
t
t
t e
y
y 

 1


Dickey-Fuller equation
Let’s subtract yt-1 from both sides of the equation:
This can be rewritten as:
t
t
t e
y
y 

 1


t
t
t
t
t e
y
y
y
y 



 

 1
1
1 

  t
t
t e
y
y 



 1
1


t
t
t e
y
y 


 1


Dickey-Fuller test
(or unit root test)
 From this equation:
 We test if rho is equal to zero, against the alternative that it is less
than zero.
 Rejection of the null implies that the series is stationary.
 If you fail to reject the null, the series is non stationary.
 Use the Dickey-Fuller tables – the Dickey-Fuller (DF) test.
 We then compare the DF test statistics with the critical values in the
DF tables.
 To reject the null, DF test statistics has to be a large negative number
or we can say that the DF test statistic>DF critical values in absolute
value.
t
t
t e
y
y 


 1


Dickey-Fuller test
(or unit root test)
 t value of the estimated coefficient doesnot follow the t
distribution even in large samples. It follows the tau statistic
 Example



 where values in parentheses are DF values (similar to t-values).
DF on Yt-1 is –1.49 which in absolute term, is smaller than the
critical value of -2.93 . Hence, we cannot reject the null
hypothesis and we conclude that Yt is non-stationary.
50
n
0.09
R
(-1.49)
(-1.05)
(9)
0.190Y
0.0066
ΔY
2
1
t
t




 
1% and 5% critical values for the
Dickey-Fuller test
Without trend With trend
Sample size 1% 5% 1% 5%
T=25 -3.75 -3.00 -4.38 -3.60
T=50 -3.58 -2.93 -4.15 -3.50
T=100 -3.51 -2.89 -4.04 -3.45
T=250 -3.46 -2.88 -3.99 -3.43
T=500 -3.44 -2.87 -3.98 -3.42
T= -3.43 -2.86 -3.96 -3.41
There are different types of critical values depending on how you specify your model:
Augmented DF test
 In DF test, it is assumed that error term is uncorrelated.
 If the error term is correlated, use ADF –adding the
lagged values of the dependent variable ∆Yt
 The number of lagged difference terms to include is
often determined empirically, being enough so that the
error term is serially uncorrelated.
 The rest is the same as DF test
(12)
v
ΔY
β
δY
α
ΔY t
p
1
j
j
t
j
1
t
t 







Limitations of unit root tests
 DF test is sensitive to the way it is conducted given
different versions of DF test: random walk, random
walk with drift, random walk with drift and trend
 DF tests tend to accept the null of unit root more
frequently
 Augmented Dickey and Fuller (1979) (ADF) test
 dfuller lM2Growth, trend lags(1) regress
 dfuller d.lM2Growth, trend lags(1) regress
 The Kwiatkowski–Phillips–Schmidt–Shin Kwiatkowski, et
al. (1992) test
 kpss lM2Growth, auto
 kpss d.lM2Growth, auto
DF/ADF Test

Advanced Econometrics L10.pptx

  • 1.
    Advanced econometrics andStata L9-10 Time series Dr. Chunxia Jiang Business School, University of Aberdeen, UK Beijing , 17-26 Nov 2019
  • 2.
    Finance models &time series data  Many applications in finance are concerned with the analysis of time series data  Monthly observations of a company’s share prices  Quarterly observations on GDP  Data can be observed at different but regular intervals (yearly, quarterly, monthly, daily, seconds – high frequency data)
  • 3.
    Things to becareful about when using time series data  One time series variable can influence another with a lag  If variables are non stationary, they cause a problem of spurious regression  Non-stationary variables should not be included in the regression model  We can transform variables to make them stationary  We can check whether they are cointegrated
  • 4.
    Stochastic processes  Arandom or stochastic process is a collection of random variables ordered in time  i.e. GDP for a particular year could be any number, depending on economic and political environment. The figure in the sample for that year is a particular realization of all such possibilities  GDP is a stochastic process and actual values we observed are particular realization of that process  In time series, we see the realization to draw inferences about the underlying stochastic process
  • 5.
    Stochastic processes  Astochastic process is said to be stationary if its mean and variance are constant over time and the value of the covariance between two time periods depends only on the distance or gap or lag between the two periods and not the actual time at which the covariance is computed  If a time series is stationary, its mean, variance, and autocovariance (at various lags) remain the same no mater at what point we measure them: they are time invariant  If a time series is not stationary, it is called a nonstationary time series  A nonstationary time series will have a time-varying mean or a time- varying variance or both
  • 6.
    Random walk  Randomwalk without drift (no constant or intercept term)  Random walk with drift (with constant) t t t u Y Y   1
  • 7.
    Unit root stochasticprocess  If rho=1, we face the unit root problem: a situation of nonstationarity  We say that the series contains a unit root.  If the absolute value of rho is less than 1, the time series is stationary 1 1 1         t t t u Y Y
  • 8.
    A stationary AR(1)series and a random walk -10 0 10 20 30 40 50 60 70 1 16 31 46 61 76 91 106 121 136 151 166 181 196 211 226 241 256 271 286 301 316 331 346 361 376 391 406 421 436 451 466 481 496 yt ynst Stationary Non-Stationary
  • 9.
    Why are stationarityso important  If a time series is nonsationary, we can study its behaviour only for the time period under consideration.  It is not possible to generalize it to other time periods.  For the purpose of forecasting, such a time series may be of little practical value
  • 10.
    Tests for stationarity Autocorrelation function  Unit root test
  • 11.
    Autocorrelation  When weconsider a time series variable we want to look at how its value today is correlated to its value yesterday, or two days ago, three days ago…  These correlations are called autocorrelations  For a stationary series the first autocorrelation tends to be quite high but the effect dies out quickly  For a non-stationary series, the correlations are very high even when considering several lags
  • 12.
    Univariate time seriesanalysis  Autocorrelations are useful but not enough to determine whether a series is stationary  We need to carry out some regression analysis  Let’s look at the simple representation of a time series called Autoregressive Process of order 1 or AR(1): t t t e y y    1   1   1   1   Stationary Non Stationary Explosive
  • 13.
    Univariate regression analysis Let’s take the previous AR(1) process:  Given that a value of θ equals to 1 indicates that the series is non-stationary, to find out about stationarity we could simply use a t test for the null hypothesis that θ=1, against the alternative that is less than 1.  Unfortunately this is not the correct procedure. t t t e y y    1  
  • 14.
    Dickey-Fuller equation Let’s subtractyt-1 from both sides of the equation: This can be rewritten as: t t t e y y    1   t t t t t e y y y y         1 1 1     t t t e y y      1 1   t t t e y y     1  
  • 15.
    Dickey-Fuller test (or unitroot test)  From this equation:  We test if rho is equal to zero, against the alternative that it is less than zero.  Rejection of the null implies that the series is stationary.  If you fail to reject the null, the series is non stationary.  Use the Dickey-Fuller tables – the Dickey-Fuller (DF) test.  We then compare the DF test statistics with the critical values in the DF tables.  To reject the null, DF test statistics has to be a large negative number or we can say that the DF test statistic>DF critical values in absolute value. t t t e y y     1  
  • 16.
    Dickey-Fuller test (or unitroot test)  t value of the estimated coefficient doesnot follow the t distribution even in large samples. It follows the tau statistic  Example     where values in parentheses are DF values (similar to t-values). DF on Yt-1 is –1.49 which in absolute term, is smaller than the critical value of -2.93 . Hence, we cannot reject the null hypothesis and we conclude that Yt is non-stationary. 50 n 0.09 R (-1.49) (-1.05) (9) 0.190Y 0.0066 ΔY 2 1 t t      
  • 17.
    1% and 5%critical values for the Dickey-Fuller test Without trend With trend Sample size 1% 5% 1% 5% T=25 -3.75 -3.00 -4.38 -3.60 T=50 -3.58 -2.93 -4.15 -3.50 T=100 -3.51 -2.89 -4.04 -3.45 T=250 -3.46 -2.88 -3.99 -3.43 T=500 -3.44 -2.87 -3.98 -3.42 T= -3.43 -2.86 -3.96 -3.41 There are different types of critical values depending on how you specify your model:
  • 18.
    Augmented DF test In DF test, it is assumed that error term is uncorrelated.  If the error term is correlated, use ADF –adding the lagged values of the dependent variable ∆Yt  The number of lagged difference terms to include is often determined empirically, being enough so that the error term is serially uncorrelated.  The rest is the same as DF test (12) v ΔY β δY α ΔY t p 1 j j t j 1 t t        
  • 19.
    Limitations of unitroot tests  DF test is sensitive to the way it is conducted given different versions of DF test: random walk, random walk with drift, random walk with drift and trend  DF tests tend to accept the null of unit root more frequently
  • 20.
     Augmented Dickeyand Fuller (1979) (ADF) test  dfuller lM2Growth, trend lags(1) regress  dfuller d.lM2Growth, trend lags(1) regress  The Kwiatkowski–Phillips–Schmidt–Shin Kwiatkowski, et al. (1992) test  kpss lM2Growth, auto  kpss d.lM2Growth, auto DF/ADF Test