Char Lie
Char Lie
Char Lie
diagnostics
examples and simulations
in Stata
3
1 Introduction
Modeled attention to the climate change issue in
congressional and media settings.
Endogenous (VAR terms)
MA Media Attention
CA Congressional Attention
Exogenous (Covariates)
NKL Net Keeling Level
CEI Climate Extreme Index
IFE International Focusing Events
NSP Net Scientific Publications
4
1 Introduction
This was actually a VARX model
(a VAR with independent variables independent of
the errors)
5
1 Introduction
VAR
output
6
1 Introduction
Lag
Order
Selection
7
1 Introduction
Residual
Whiteness
8
1 Introduction
Stability
9
1 Introduction
Normality
Of Residuals
10
1. Introduction
Fitting model with Stata was interesting and
straightforward.
11
1.1 VAR Model
VAR process of order p
- yt is a k x 1 random vector
- the Ai are k x k fixed coefficient matrices
- v is a k x 1 fixed vector of intercept terms
- ut is a k x 1 random vector,
a white noise or innovation process.
12
1.1 VAR Model
ut is a white noise process iff
- E ut = 0
- E utut' = (nonsingular)
- E utus' = 0 if s ≠ t
- If ut is Multivariate Normal,
then yt is a Gaussian Process
13
1.1 VAR Model
- If |Ik – A1 z – … – Ap z p| ≠ 0
for complex z , |z| < 1
then yt is a stable VAR(p) process
14
1.2 VECM Model
When the stability condition is not satisfied,
We may still analyze the process
15
1.2 VECM Model
yt ~ I(d) is cointegrated
if there exists k x 1 fixed vector β ≠ 0
so β'yt is integrated of order < d
(I(0) stable)
We say yt ~ CI(d)
16
1.2 VECM Model
VECM process of order p
17
1.3 Stata
Stata is a statistical software package
- Fast
- all data stored in RAM
- Accurate
- I worked there, trust me
- Intuitive & Simple Syntax
- Broad Functionality
- Excellent Graphics and Text Display capabilities
18
1.3 Stata
Stata has Powerful Time Series functionality
19
2 VAR diagnostics
If we fit a VAR model and all of the assumptions are
not met :
20
2 VAR diagnostics
Diagnostics help us check that the assumptions of our
model are met.
21
2.1 Lag Order Selection
Determination of p such that
Ai = 0 for all i > p in the VAR model.
22
2.1.1 LR Test
Consider the first option. First find an upper bound
on the lag order, M.
H01 : AM = 0 vs H11 : AM ≠ 0
H02 : AM-1 = 0 vs H12 : AM-1 ≠ 0 | AM = 0
H0M : A1 = 0 vs H1M : A1 ≠ 0 | AM = … = A2 = 0
23
2.1.1 LR Test
When H0i is the first hypothesis rejected, we choose
the lag order to be M-i+1.
24
2.1.1 LR Test
Under the assumption that H0i and all previous null
hypotheses are true,
25
2.1.1 LR Test
Let γi be significance level used for the individual
test of
27
2.1.2 Information Criteria
In linear regression, we do not always pick the model
with the lowest RSS.
28
2.1.2 Information Criteria
More lags mean more parameters to estimate.
29
2.1.2 Information Criteria
The final prediction error (FPE) criterion measures
the mean square error (MSE) of the 1-step ahead
forecast
30
2.1.2 Information Criteria
Akaike’s Information Criterion may also be used for
lag order selection.
31
2.1.2 Information Criteria
There are two additional criteria of interest.
32
2.1.2 Information Criteria
Schwarz (1978) used Bayesian arguments to derive
the SC criterion.
33
2.1.2 Information Criteria
The different information criteria are related.
34
2.1.2 Information Criteria
Stata provides each of the information criteria
through varsoc
Ex.
35
2.2 Whiteness of Residuals
The ut error process of a VAR(p) model is unknown.
We estimate it with the observed residuals .
36
2.2.1 Portmanteau Test
The Portmanteau test jointly tests the significance of
all error autocorrelations up to a set order, h.
37
2.2.1 Portmanteau Test
is the estimated autocorrelation of lag i.
38
2.2.1 Portmanteau Test
For large T and h, under H0
39
2.2.2 LaGrange Multiplier Test
This test was developed by Breusch and Godfrey in
1978.
H0 : D1 = … = Dh = 0 against
H1 : Dj ≠ 0 for at least one j < h
40
2.2.2 LaGrange Multiplier Test
We use the LaGrange Multiplier method to perform
the test.
41
2.2.2 LaGrange Multiplier Test
To determine the test statistic we begin with the
auxiliary regression model
where
42
2.2.2 LaGrange Multiplier Test
Define Fi such that
then
43
2.2.2 LaGrange Multiplier Test
The standard test statistic for testing whether D =
0 (no autocorrelation) is
Under H0
44
2.2.2 LaGrange Multiplier Test
Stata implements the LaGrange Multiplier test
through the varlmar command.
Ex.
45
2.3 Normality of Residuals
Lütkepohl suggests using the multivariate
generalization of the Jarque-Bera test (Jarque &
Bera 1987) on to test the multivariate
normality of the ut.
46
2.3 Normality of Residuals
It is possible that the first four moments of the ut
match the multivariate normal moments, and the
ut are still not normally distributed.
47
2.3 Normality of Residuals
This situation has an analog in linear regression. We
assume that the errors are independent, but we
can only test whether they are correlated.
48
2.3 Normality of Residuals
Our formulaton of the Jarque-Bera test uses a mean
adjusted form of the VAR(p) model, but it
applies to our general form in section 1.2.
49
2.3 Normality of Residuals
50
2.3 Normality of Residuals
Finally our test statistics are
51
2.3 Normality of Residuals
Under the third moment assumption
52
2.3 Normality of Residuals
So all three test statistics may be used to test the
multivariate normality of ut.
53
2.3 Normality of Residuals
Ex.
54
2.4 Stability Test
Checking that a VAR(p) process is stable, that
|Ik – A1 z – … – Ap z p| ≠ 0
for complex z , |z| < 1
55
2.4 Stability Test
Stata uses the varstable command to perform this
task.
1
.5
Imaginary
0-.5
-1
-1 -.5 0 .5 1
Real
56
3 VECM Diagnostics
Many VECM diagnostics are very similar to those of
VAR.
57
3.1 Rank of Cointegration
The coefficient matrix for yt-1 , Π = αβ' where
α k x r loading matrix
β r x k cointegration matrix
58
3.1 Rank of Cointegration
When we find the rank of cointegration, we are
finding r = rank(Π), the number of cointegrating
vectors βi.
59
3.1 Rank of Cointegration
Let l(ri) be the maximum of the likelihood of the
VECM model under cointegration rank ri
(similar to profile likelihood)
H0 : rank(Π) = r0 vs rank(Π) = r0 + 1
61
3.1 Rank of Cointegration
The test statistic for the first is called the
trace statistic
62
3.1 Rank of Cointegration
63
3.1 Rank of Cointegration
The addition of trend terms to the VECM model for
cointegration rank testing involves slight
modifications to what we discussed.
64