1
TIME SERIES ANALYSIS
USING EVIEWS
Prof.Dr. Nabeel M. Aljanabi
Course Outline
2
Starting EVIEWS
Applied Regression Analysis
Linear regression, Dynamics, Dummy variables,
Causality analysis, VARs.
Nonstationary Models
Unit roots, Cointegration, Vector error correction
modelling (VECM).
Model Evaluation
3
STARTING EVIEWS
What is EViews?
4
An econometrics package, which provides data
analysis, regression and forecasting tools
Useful for many different analyses
Very user-friendly
Excellent help function
Workfile Created
5
Start Eviews
Select File/New/Workfile
Defining the Workfile
6
Defining the Workfile
7
Start Eviews
Select File/New/Workfile
Enter the frequency and the range
Entering Frequency and Range
8
Frequency workfile Start date End date
Annual a 1990 1999
Semi-annual s 1990:1 1999:2
Quarterly q 1990:1 1999:4
Monthly m 1990:1 1999:12
Weekly* w 01/01/1990 31/12/1999
Daily[5 day]* d 01/01/1990 31/12/1999
Daily[7 day]* 7 01/01/1990 31/12/1999
Undated u 1 100
Sample and Range
9
Information Needed to Import
10
name of the worksheet where the data are
(unnecessary if the data file is a worksheet)
the number of variables
where (cell) the data (numbers) begin
Import Data
11
Import Data
12
Excel Worksheet
13
Importing the Excel Worksheet
14
Data
15
Examine the Contents
16
Examine the Contents
17
data
18
19
Time plot
20
Time plot
21
Time plot
22
Time plot
23
Scatter plot
24
Drawing a scatterplot - Click the [View] button and choose Graph
Scatter Regression Line.
Histogram plot
25
Obtaining descriptive statistics and histograms. Click the [View]
button. Choose Descriptive Statistics Histogram and Stats
Descriptive Statistics
26
Descriptive Statistics
27
Displaying correlation and covariance matrices
28
The easiest way to display correlation and
covariance matrices is to highlight the relevant
series (using the mouse and the [Ctrl] key) and then
click Quick Group Statistics Correlations
(or Covariances if you want a covariance matrix).
29
APPLIED REGRESSION
ANALYSIS
30 Linear regression
Linear Regression with One Regressor
31
Linear regression allows us to estimate, and make
inferences about, population slope coefficients.
Ultimately our aim is to estimate the causal effect on
Y of a unit change in X – but for now, just think of the
problem of fitting a straight line to data on two
variables, Y and X.
The Population Linear Regression Model – general
notation
32
Yi = 0 + 1Xi + ui, i = 1,…, n
X is the independent variable or regressor
Y is the dependent variable
0 = intercept
1 = slope
ui = the regression error
The regression error consists of omitted factors, or possibly
measurement error in the measurement of Y. In general, these
omitted factors are other factors that influence Y, other than the
variable X
This terminology in a picture: Observations on Y and X; the population
regression line; and the regression error (the “error term”):
33
The Ordinary Least Squares Estimator
34
How can we estimate 0 and 1 from data?
Recall that Y was the least squares estimator of Y: Y solves,
n
min m (Yi m )2
i 1
By analogy, we will focus on the least squares (“ordinary least
squares” or “OLS”) estimator of the unknown parameters 0
and 1, which solves,
n
min b0 ,b1 [Yi (b0 b1 X i )]2
i 1
35
Least squares assumption.
36
For any given value of X, the mean of u is zero:
Example: Test Scorei = 0 + 1STRi + ui, ui = other factors
What are some of these “other factors”?
Is E(u|X=x) = 0 plausible for these other factors?
Estimate Equation Using EViews
37
Continue/ Estimate Equation
38
Continue/ Estimate Equation
39
Continue/ Estimate Equation
40
Continue/ Estimate Equation
41
42 multivariate regression model
multivariate regression model
43
Select variables
44
output
45
serial correlation test
46
Serial Correlation LM Test:
47
Multicollinearity Test
48
Multicollinearity Test
49
Variance Inflation Factors (VIF)
50
Heteroskedasticity test
51
Heteroskedasticity test
52
53 System Equation
System Equation
54
55
56
57
58 Dynamics Linear regression
Dynamics Linear regression
59
ADL Model
60
ADL Model
61
62 Causality analysis
Causality analysis
63
Causality analysis
64
65 VARs
Vector autoregression VAR
66
The VAR(1) model
67
68
VAR Estimate
69
VAR Estimate
70
VAR Estimate
71
VAR Lag Order
72
Impulse Response function (IRF)
73
Impulse Response function (IRF)
74
Variance Decomposition
75
Variance Decomposition
76
77
NONSTATIONARY
MODELS
The Procedure to Analysis
78
Economic
Economic or
or Financial
Financial Theory
Theory
Summary
Summary Statistics
Statistics of
of Data
Data
Luukkonen et al. (1988) Linearity Test
If reject
not reject
Linear
Linear Model
Model Nonlinear
Nonlinear Model
Model
Basic Advanced
Econometric Econometric
The Procedure to Analysis
79
Time
Time Series
Series Data
Data
Unit
Unit Root
Root Test
Test
Non-Stationarity Staionaruty
Dickey-Fuller
Augmented DF
Orders of Integration H0: Yt ~ I(1)
The same Difference H1: Yt ~ I(0)
Phillips-Perron
VAR in
E-G DF-GLS, NP
Level
J-J ARDL
Bounding H0: Yt ~ I(0)
H-I KPSS
KPSS
Test
H1: Yt ~ I(1)
Cointegration Test
The Procedure to Analysis
80
Unit
Unit Root
Root Test
Test
Staionaruty
Cointegration
Cointegration Test
Test
Yes No
EG,JJ, KPSS ARDL
UECM
(Pesaran et
VECM al., 2001) VAR in
VAR in
Level
differ
Model
Model Specification
Specification
The Procedure to Analysis
81
Model
Model Estimation
Estimation
Economic or Finance
Implication
Impulse Variance Granger
Resp Dec Causality
The Procedure to Analysis
82
Heteroskedastic Goodness-of-fit
ACH-LM Teat R square
Normality Diagnostic Error specification
Checking
Jarque-Bera N Ramsey’s RESET
Series autocorrelation
sationarity
Ljung-Box Q, Q 2
CUSUM (square)
83 Unit roots
Stationary Time Series
Time Series modeling
A series is modeled only in terms of its own past values and
some disturbance.
Autoregressive, AR (1)
yt 0 1 yt u t ut ~ WN (0, ) 2
Moving Average, MA (1)
ut t t 1
84
Stationary Time Series
Box-Jenkins (1976) ARMA (p, q) model
yt 0 1 yt 1 p yt p ut 1ut 1 q ut q
p q
0 i yt i i u1i
i 1 i 0
The necessary and sufficient stationarity condition
i 1
i 1
85
Stationary Time Series
The determination of the order of an ARMA process
Autocorrelation function (ACF)
cov( yt , yt por q )
( por q)
var( yt )
Partial ACF (PACF) p 1
p j 1 ( p 2, j pp p 2, p j ) p j
( p) , p3
1 j 1 ( p 2, j pp p 2, p j ) j
p 1
i2 p
Q( p
Ljung-Box T (T 2)
Q) statistic ~ p2
i 1 T - i 86
Stationary Time Series
87
e series is AR(1)
P* = 1
Non-stationary Time Series
88
How to achieve stationary?
DSP = Difference stationary process
• Yt ~ I(1) = D d 1 y yt yt 1 yt
t
• Yt ~ I(2) = D d 2 y y y 2 y
t t t 1 t
TSP = Trend stationary process
yt 0 1t t ŷt
Non-stationary Time Series
Unit Root Test
ADF Test p
: Yt Yt 1 i Yt i t De-data
i 1 p
t : Yt t Yt 1 i Yt i t De-trend
i 1
p
u : Yt Yt 1 i Yt i t De-mean
i 1
iid
Yt t rt t t ~ N (0, 2 )
KPSS
89
Non-stationary Time Series
90
Selection Criteria of the Lag Length
Schwartz Bayesian Criterion (SBC)
SSR k ln T
min SBC ln( ) Small sample
T T
Akaike Information Criterion (AIC)
SSR
min AIC T ln( ) 2k Big sample
T
k parameters
T observations
SSR sum of squared residuals
Non-stationary Time Series
91
Reject H0
Non-stationary Time Series
Engle-Granger 2-Stage Cointegration Test
Step 1: regress real exchange rate
et 0 1lst 2luswpit 3lukwpit ut
t u
uerror term
Step 2:
t 1 t ADF Unit Root Test
H0 : 0
Hypothesis
H1 : 0
If reject H0, u
t~I(0
)
We support PPP
92
93 Cointegration
Cointegration
94
Cointegration
95
96 Vector error correction modelling (VECM).
Vector error correction modelling (VECM).
97
Vector error correction modelling (VECM).
98
99
MODEL
Model
100
Model
101
Model/variable
102
Solve the model
103
Extended the range
104
Solution sample
105
Forecast variables
106
GDP forecast
107
% Change gdp at current price (Baseline)
30
25
20
15
10
0
1980 1985 1990 1995 2000 2005 2010 2015 2020
In sample forecast
108
50,000
40,000
30,000
20,000
10,000
0
1980 1985 1990 1995 2000 2005 2010 2015 2020
gdp at current price (Baseline)
gdp at current price
109
SEASONAL
ADJUSTMENT
110
111
112
113
114
115
116
Log Transformations
117
Appropriate when the variability in a series
increases as its level increases, and when all
values of the series are positive
Change multiplicative relationships into
additive relationships
Increases/decreases can be thought of in terms
of percentages
Problem: Extreme Values
118
Solution:
These effects can be estimated also, but they can be
difficult to estimate when seasonality and trend are
present
119
120
121
Which of these values are outliers (extreme
values)?
Models
122
Multiplicative model:
Yt = St´ × Tt × It Additive model:
Yt = St´ + Tt + It
= St ´ × N t
= St´ + Nt
where
where
St´ = St × TDt × Ht
St´ = St + TDt + Ht
Hodric-prescott filter
123
124
125
Hodrick-Prescott Filter (lambda=1600)
3,000
2,500
2,000
300
200 1,500
100 1,000
0
500
-100
-200
-300
92 94 96 98 00 02 04 06 08 10 12
Real Gross Domestic Product At Market Prices
Trend
Cycle
X12-filter
126
127
128
129
3,200
2,800
2,400
2,000
1,600
1,200
800
92 94 96 98 00 02 04 06 08 10 12 14 16 18 20
GDP_SA
GDP_TC
Real Gross Domestic Product At Market Prices
Tramo-filter
130
131
50,000
40,000
30,000
20,000
10,000
0
92 94 96 98 00 02 04 06 08 10 12 14 16 18 20
Final seasonally adjusted series
Final trend-cycle
Money Supply M2 ( million JD)