58. GARCH
VOL( 2) Modelling DLFrance/Belgium by restricted
GARCH(1,1)
The dataset is: new09.in7
The estimation sample is: 1973(5) - 1990(2)
Coefficient Std.Error robust-SE t-value t-prob
Constant X 0.00137385 0.0005496 0.0006335 2.17
0.031
alpha_0 H 2.53091e-005 6.838e-006 1.225e-005 2.07
0.040
alpha_1 H 0.548753 0.1647 0.2417 2.27 0.024
beta_1 H 0.386169 0.1059 0.1239 3.12 0.002
log-likelihood 647.090499 HMSE 7.74626
mean(h_t) 0.000169302 var(h_t) 5.89695e-008
no. of observations 202 no. of parameters 4
AIC.T -1286.181 AIC -6.36723266
mean(DLFrance/Belgium) 0.00178439
var(DLFrance/Belgium) 0.000142048
alpha(1)+beta(1) 0.934922 alpha_i+beta_i>=0,
alpha(1)+beta(1)<1
Initial terms of alpha(L)/[1-beta(L)]:
0.54875 0.21191 0.081834 0.031602 0.012204
0.0047127
0.0018199 0.00070278 0.00027139 0.00010480 4.0472e-
005 1.5629e-005
Used sample mean of squared residuals to start recursion
Robust-SE based on analytical Information matrix and
analytical OPG matrix
BFGS using analytical derivatives (eps1=0.0001; eps2=0.005):
Strong convergence
Used starting values:
0.0017844 2.1595e-005 0.70855 0.13943
59. Test for excluding: alpha_1
Subset Chi^2(1) = 11.0952 [0.0009] **
Using robust standard errors:
Subset Chi^2(1) = 5.15536 [0.0232] *
Portmanteau statistic for scaled residuals
Autocorrelation function (ACF) from lag 1 to 12:
0.24488 0.047178 -0.058108 -0.085325 -0.059613
-0.080555
-0.0051672 0.13997 0.19257 0.0078786 -0.13371
-0.15760
Partial autocorrelation function (PACF):
0.24488 -0.013605 -0.070740 -0.057554 -0.023454
-0.065465
0.024169 0.14067 0.12540 -0.091215 -0.13049
-0.078908
Portmanteau(12): Chi^2(12) = 38.040 [0.0002]**
Portmanteau statistic for squared scaled residuals
Autocorrelation function (ACF) from lag 1 to 12:
-0.011257 0.027938 -0.024482 0.032919 0.050857
-0.051928
-0.035495 -0.054797 0.075378 0.023350 -0.028213
0.0044665
Partial autocorrelation function (PACF):
-0.011257 0.027815 -0.023885 0.031675 0.052970
-0.053474
-0.038122 -0.051434 0.071194 0.027495 -0.027254
0.010154
Portmanteau(12): Chi^2(10) = 4.0149 [0.9467]
EGARCH
VOL( 3) Modelling DLFrance/Belgium by EGARCH(1,1)
60. The dataset is: new09.in7
The estimation sample is: 1973(5) - 1990(2)
Coefficient Std.Error robust-SE t-value t-prob
Constant X 0.00101843 0.0005399 0.0005579 1.83
0.069
alpha_0 H -1.41749 0.6391 0.9994 -1.42 0.158
eps[-1] H -0.143496 0.09108 0.1445 -0.993 0.322
|eps[-1]| H 0.691818 0.1431 0.2420 2.86 0.005
beta_1 H 0.833174 0.07042 0.1136 7.33 0.000
log-likelihood 649.124517 HMSE 8.68633
mean(h_t) 0.000159174 var(h_t) 4.75962e-008
no. of observations 202 no. of parameters 5
AIC.T -1288.24903 AIC -6.37747046
mean(DLFrance/Belgium) 0.00178439
var(DLFrance/Belgium) 0.000142048
Used sample mean of squared residuals to start recursion
Robust-SE based on numerical Hessian matrix and numerical
OPG matrix
BFGS using numerical derivatives (eps1=0.0001; eps2=0.005):
Strong convergence
Used starting values:
0.0017844 1.0047 0.70855 0.00000 0.13943
(5) Forecast
Forecasting DLFrance/Belgium from 1990(3) to 1991(5)
Horizon Forecast (SE) Actual CondVar
1.0000 0.0010184 0.0051081 0.00013464 2.6093e-
61. 005
2.0000 0.0010184 0.0060643 -0.00097591 3.6775e-
005
3.0000 0.0010184 0.0069962 0.0043737 4.8947e-
005
4.0000 0.0010184 0.0078812 0.0029580 6.2113e-
005
5.0000 0.0010184 0.0087034 -0.0045257 7.5749e-
005
6.0000 0.0010184 0.0094536 0.0019288 8.9370e-
005
7.0000 0.0010184 0.010128 -0.0019952 0.00010257
8.0000 0.0010184 0.010726 -0.0011920 0.00011505
9.0000 0.0010184 0.011251 0.0031894 0.00012660
10.000 0.0010184 0.011709 0.0056647 0.00013710
11.000 0.0010184 0.012104 .NaN 0.00014651
12.000 0.0010184 0.012443 .NaN 0.00015484
13.000 0.0010184 0.012734 .NaN 0.00016214
14.000 0.0010184 0.012980 .NaN 0.00016849
mean(Error) = -6.2387e-005 RMSE = 0.0030268
SD(Error) = 0.0030261 MAPE = 165.93
FMBF computer lab1.pdf
FMBF: Computer Practical 1
Introduction
There are four workshops for the FMBF module this term which
will be organised as
follows:
Practical 1 ARIMA modelling and unit root testing.
Practical 2 Cointegration procedures.
62. Practical 3 ARCH/GARCH modelling and forecasting.
1 ARIMA Modelling
1.1 Aims
In the first part of this session we will firstly load a dataset and
experiment with ARIMA
modelling. Once the concept has been demonstrated you will be
required to find a preferred
model for the stock price data that we will be using. The stock
price series is raw data so you
will need to calculate returns yourself using the calculator
function in PcGive.
We will demonstrate the procedure for using the Time Series
Models package in PcGive by
estimating an AR(1) model:
1.2 Key Steps
Importing and transforming the data
1. We will be using monthly data on the price of British
Airways from 1996 to 2002.
Download the file BA.xls from duo that contains these data.
2. Start PcGive.
(Start > Search PcGive12)
63. 3. Create new database in PcGive.
(File > New… > OxMetrics (Data: *.in7) > Frequency: Monthly
> Observations: 74 > OK).
Practical 4 Review.
4. Copy the price data column from Excel to PcGive. Double
click on the first row and type
the column title: BA.
Note: You could also click File > Open data file... and import
the Excel file directly.
However, PcGive will not automatically recognise the dates in
the leftmost column. If you
chose to do it this way you could choose Edit > Change Sample
to let PcGive know we are
dealing with monthly data from 1996.
5. Use Calculator to calculate the log return, i.e., generate new
series Ri which equals the
dlog of BA.
64. Prior to constructing the model
You should plot and carefully examine the ACF and PACF.
Recall that we plotted the ACF
and PACF last term, and that you can do this by going to the
Graphics button in PcGive.
(Graphics > Choose the variables and click All plot types >
Time-series properties > In
Dynamic Properties tick ACF and PACF and click OK)
Is a particular model suggested by this graphical analysis?
Constructing the model
These steps show the construction of an AR(1) model for
demonstration.
1 In PcGive select Model > Category: Models for time series
data > Model class: ARFIMA
models using PcGive.
2 Select Formulate…
3 Select Ri as the dependent variable (Y), add a constant term
(PcGive should do this
automatically), and press OK.
65. 4 Set AR order as 1 and fix the Fractional parameter d at 0.
Treatment of the mean should
automatically be set to None (or using constant as regressor).
5 Press OK, and select Maximum Likelihood.
6 Press OK and the Estimation Results will appear.
7 Examine the results. Is this model satisfactory?
Exercice 1: Identifying your preferred model
Carefully examine the results from your model. You should:
using ACF and PACF and the Q-
statistic (Ljung Box statistic).
-estimate the model, overfitting in an effort to isolate the
preferred specification.
competing models.
If you are not prompted to do so by the steps above, you should
66. at the least estimate an MA(1)
and an ARIMA(1,0,1) model to be clear on the procedure of
specifying such models in
PcGive.
2 Unit root testing
2.1 Aims
In the second part of this session we will examine stationarity
testing using PcGive.
Price/Earnings data for the US will be used to demonstrate how
the software can easily test
for the presence of a unit root and display results in a fashion
that easily allows us to choose a
preferred model cf. the number of lags to include. We will then
test for stationarity in
monthly data for the FTSE 100 and FTSE All Share.
Example 1: Annual Price/Earnings Ratio
This example is based on the illustration of the annual
price/earnings ratio proposed in
Verbeek (2004, p.274). The literature has focussed on whether
the price/earnings ratio is
mean reverting (why might this be interesting?).
67. 1 Load the data PE.xls into PcGive (File > Open… > PE.xls).
This is annual data on the
ratio of the S&P Composite Stock Price Index and S&P
Composite Earnings. The sample
(annual data) runs from 1871 to 2002.
2 Plot the log of the series (LOGPE) using GiveWin graphics
(Graphics > Choose LOGPE >
Actual series) . Does it look stationary?
3 We will test for stationarity with the standard Dickey-Fuller
regression, i.e. if we denote
the log P/E ratio as Yt
1 1t t t
(1)
Note that you will need to use Calculator to diff the LOGPE
series.
Modelling this using Single equation dynamic modelling...
gives
1
0.335 0.125
68. t t t
Y Y e
(2)
(Model > Category: Model for time-series data > Model class:
Single-equation Dynamic
Modelling using PcGive > Formulate… > Select DLOGPE as Y
and choose lagged
LOGPE > Click OK)
The full output from PcGive is
We can calculate the DF test statistic as -2.57, the 5% critical
value being -2.88. Thus we
cannot reject the null of a unit root. However, for this result to
hold we must have included
lags to the extent that the error term is white noise.
2.2 Automated unit root testing
Fortunately, PcGive makes it easy to perform unit root testing
automatically, saving us
having to run a regression each time. It also produces a neat
summary table allowing easy
69. selection of the appropriate number of lag terms.
We will first replicate the results previously obtained:
1 Select Model > Category: Other models > Model class:
Descriptive Statistics using
PcGive)
2 Select Formulate
3 Add LOGPE to the model and click OK
4 In Descriptive Statistics select Unit-root tests, and then edit
Unit-root test settings so that
Lag length for differences is 0 and Constant) is selected
5 Click OK and then OK in the Estimate Model dialog
6 The following results should appear in the Results area in
GiveWin
These are the results we obtained previously. Note that the
software automatically calculates
the correct test statistic and critical value.
2.3 ADF testing
We will now add lags and look at the results from augmented
Dickey-Fuller tests:
70. 1 Formulate a new model (Descriptive Statistics)
2 Edit Unit-root test settings so that Lag length for differences
is 6 and Constant) is selected.
Make sure that Report summary table only is selected.
The following results are presented
There is a rejection of the null of a unit root at the 5% level
with one lag. However, none of
the other ADF tests reject the null of nonstationarity. Does this
concur with the graphical plot
of the P/E series that you produced above?
Exercice 2: Annual Price/Earnings Ratio cont...
Test for the presence of a second unit root in annual
price/earnings data (Hint: you will need
to difference the data once more). Can you reject the null of
nonstationarity? What
conclusion does this lead you towards?
Exercice 3: Stationarity in the FTSE 100 and ALL SHARE
1. Load the data FTSEDATA.xls that is on duo. This contains
monthly data for the FTSE 100
and ALL SHARE from 1985:1.
2. Create logarithms of the two indices, naming them LFTSE100
71. and LFTALLSH.
3. Plot the series then test for stationarity adding an appropriate
number of lags.
4. Create the first difference of LFTSE100 and LFTALLSH and
test for stationarity after
plotting the differenced series.
5. Come to conclusions about the presence of a unit root in the
two series.
2.4 Points to note
unit root test output mean;
see Figure 1 and Figure 2.
unit root in ammore systematic
way (see Harris and Sollis p. 47 and your lecture notes). This
will not be considered here.
References
M. Verbeek. A Guide to Modern Econometrics. John Wiley &
Sons, Inc., 2004.
Figure 1: Interpreting unit root test output: summary table
option
72. Figure 2: Interpreting unit root test output: summary table vs.
standard output
Guide_to_ACF_PACF_plots(computer lab1).pdf
Guide to ACF/PACF Plots
The plots shown here are those of pure or theoretical ARIMA
processes. Here are
some general guidelines for identifying the process:
Nonstationary series have an ACF that remains significant for
half a dozen or
more lags, rather than quickly declining to zero. You must
difference such a
series until it is stationary before you can identify the process.
Autoregressive processes have an exponentially declining ACF
and spikes
in the first one or more lags of the PACF. The number of spikes
indicates the
order of the autoregression.
Moving average processes have spikes in the first one or more
lags of the ACF
and an exponentially declining PACF. The number of spikes
indicates the order of
the moving average.
73. Mixed (ARMA) processes typically show exponential declines
in both the
ACF and the PACF.
At the identification stage, you do not need to worry about the
sign of the ACF or
PACF, or about the speed with which an exponentially declining
ACF or PACF
approaches zero. These depend upon the sign and actual value
of the AR and MA
coefficients. In some instances, an exponentially declining ACF
alternates between
positive and negative values.
ACF and PACF plots from real data are never as clean as the
plots shown here.
You must learn to pick out what is essential in any given plot.
Always check the ACF
and PACF of the residuals, in case your identification is wrong.
Bear in mind that:
Seasonal processes show these patterns at the seasonal lags (the
multiples of
the seasonal period).
1
2
You are entitled to treat nonsignificant values as zero. That is,
you can ignore
values that lie within the confidence intervals on the plots. You
do not have to
ignore them, however, particularly if they continue the pattern
74. of the statistically
significant values.
An occasional autocorrelation will be statistically significant by
chance alone.
You can ignore a statistically significant autocorrelation if it is
isolated, preferably
at a high lag, and if it does not occur at a seasonal lag.
Consult any text on ARIMA analysis for a more complete
discussion of ACF and
PACF plots.
ARIMA(0,0,1), θ>0
ACF PACF
3
Guide to ACF/PACF Plots
ARIMA(0,0,1), θ<0
ACF PACF
ARIMA(0,0,2), θ1θ2>0
ACF PACF
4
ARIMA(1,0,0), φ>0
76. Introduction
This workshop session covers cointegration, using the Engle-
Granger and Johansen
approaches. You should be aware of the benefits and drawbacks
of each approach.
1 Engle-Granger
Exercise 1: Cointegration between the S&P and FTSE All-Share
1. Load the data file FMBF Prac2.xls from duo. This contains
monthly data on the
S&P 500 and FTSE All Share from January 1 1965 to January 1
2004.
2. Log both series (Calculator) and then use the unit root testing
facility in
Descriptive Statistics to assess the degree of integration of the
series (Model >
Category: Other models; Model class: Descriptive statistics
using PcGive).
Notes: most financial variables are I(1) series. To conduct the
EG procedure, we
should firstly check whether the two time series are I(1).
3. Regress LS&P on LFTSE and a constant using OLS (Model >
Category:
Models for time-series data; Model class: Single-equation
dynamic
77. Modelling using PcGive).
4. Save the cointegration regression residual in the database
(Test > Test Menu:
Store Residuals etc. in Database… > Store in database:
Residuals).
5. Test for cointegration by performing a unit-root test on the
saved residuals (do
not include deterministic components here).
6. Evaluate the results and establish whether or not the series
cointegrate (note:
make sure you use the correct critical values).
7. If appropriate, build an ECM. Do this by regressing DLS&P
on a constant,
DLFTSE and the one-period lagged residuals that were
previously stored in the
database. Interpret your findings.
Notes: according to the unit root test of the residuals, since the
78. residuals are not
stationary, it is not appropriate to put the non-stationary
residuals into the ECM.
In other words, the residuals are I(1). Therefore, we should
estimate a model
containing only first differences.
2 Johansen
Example 1: Long-run PPP
This is a PcGive implementation of the long-run purchasing
power parity example
presented in Verbeek (2004, p.331). We begin by loading the
data file ppp.xls from
duo, which contains monthly observations from 1981:1 to
1996:6 on price indices and
exchange rates from France and Italy. The variables contained
in the file are as
follows:
This example investigates the concept of PPP, where exchange
rate equals the ratio of
price levels. In logarithms, we represent PPP as:
*
79. ttt
(1)
where t
s
is the log of the spot exchange rate, t
p
is the log of domestic prices and
*
t
p
is the log of foreign prices.
1. Following Verbeek's reasoning we will first run a test with p
= 3, excluding a
time trend (Model > Category: Models for time-series data;
Model class:
Multiple-equation dynamic Modelling using PcGive). Note that
PcGive
automatically restricts the Constant term (shown by the U to its
left. We remove
this to restrict the constant following Verbeek's example. Select
U Constant in
80. Selection > Change Use default status to Clear status and click
Set, then the
U is removed. Note that this now corresponds to Model 2 in the
Pantula
Principle). Click OK and choose Unrestricted system.
2. Press Test > Test Menu: Dynamic Analysis and Cointegration
Tests... >
Dynamic Analysis: I(1) cointegration analysis > OK. You are
presented with
results, the firrst part of which are the eigenvalues:
We can see from the results that there are two small eigenvalues
that are significant at
the 1 percent level. In this case we reject H0 : r = 0 and also H0
: r = 1, but we cannot
reject H0 : r = 2 against the alternative of H1 : r = 3. Therefore
using Johansen we
conclude that there are two cointegrating relationships. P-values
are based on Doornik
(1998) (reprinted in McAleer and Oxley (1999)). Verbeek
(2004, p.332) reminds us
that in this particular example, Engle-Granger finds that the null
81. of no cointegration
could not be rejected. (Note: you can follow the E-G procedure
that was used above to
verify this). One possible explanation is that the number of lags
is too small.
Therefore we formulate a model with p = 12, supported by the
use of monthly data:
These results are clearly weaker than with p = 3. We do,
however, have a rejection of
H0 : r = 1. We can now move on to build a cointegrated VAR
model. We will assume
r = 1.
3. Formulate the model used for estimating the cointegration
test for p = 12.
Remember that we have a restricted constant (Model >
Category: Models for
time-series data; Model class: Multiple-equation dynamic
Modelling using
PcGive).
4. Click OK and then select Cointegrated VAR and press OK
once more.
82. 5. In the Cointegrated VAR Settings dialog box make sure the
Cointegrating rank is
set to 1. Click OK and OK to estimate a Reduced Rank
Regression
You should be presented with the following output in the
Results:
The most interesting part of these results, relating to estimating
the cointegrating
vector, β, are shown under Reduced form beta. The normalized
cointegrating
therefore corresponds to:
*
756.14346.6
ttt
As Verbeek, p.332 points out, this “does not seem to correspond
to an economically
interpretable long-run relationship.”
83. 3 The Pantula Principle
Following Johansen (1992) we can use the so-called Pantula
Principle to determine
the choice for deterministic components in the cointegration
space and/or the
short-run, and also establish the order of the cointegration rank
r. Recall that we
estimate all three models and present the results from the r = 0
(model 2, the most
restrictive) to r = n-1 (model 4, the least restrictive). Moving
through these models
and examining them in turn, we look to the trace statistic and
stop once the null
hypothesis cannot be rejected. In the case of the example we are
concerned with
identifying the deterministic components. One further point to
consider are the correct
critical values for models 1 to 4.
Exercice 2: The Pantula Principle
In the above worked example we estimated a long-run PPP
model and tested for
84. cointegration. Effectively, what we did corresponds with Model
2 in the Pantula
Principle.
timating Models 2, 3
and 4 in sequence.
You should examine your results and establish which
specification is preferred.
To assist you, Table 1 contains pointers on setting up each
model in PcGive. It is
helpful to construct a table similar to Table 5.5 in Harris and
Sollis (2003).
You should come to
your own conclusion about this by first looking at appropriate
graphic analysis.
Specifically you can go to Test > Graphic Analysis and look at
Actual and
fitted values, Cross plot of actual and fitted, Residuals (scaled),
Residual
density and histogram (kernel estimate) and Residual
correlogram (ACF).
preferred model. You should
85. examine F-tests on the retained regression to see if it is possible
to delete all the
lags of the same length (i.e. those that are not significant)
whilst keeping the
sample period unchanged. You can use Test > Exclusion
Restrictions... to
evaluate.
Summary for
equation-by-equation and system-wide tests, which you should
examine.
3.1 Imposing Restrictions
We can test for restrictions on α and β with PcGive. For
example, to test the
restriction
We would go to Model > Category: Models for time-series data;
Model class:
Multiple-equation dynamic Modelling using PcGive and select
Cointegrated VAR.
86. Press OK and enter a Cointegrating rank of 1. We then select
General restrictions
and press OK.
The General Restrictions dialog box opens, where we specify
the restriction in the
form &1=0;&2=0;&3=0 - see Figure 2 for a screenshot. We are
testing a null of
weakly exogenous - you may wish to try this for the PPP model
estimated above.
We can also use PcGive's ability to impose general restrictions
to test for unique
cointegrating vectors and in addition jointly test restrictions on
α and β. See Harris
and Sollis (2003, p.135-163) for full details, examples and
references to imposing
restrictions in PcGive.
4 Points to note
87. -
G and Johansen
approaches to cointegration.
whether the smallest k
- r0 eigenvalues significantly differ from 0. However, we can
also use the
maximum eigenvalue test. This tests H0 : r ≤ r0 against H1 : r =
r0 + 1. PcGive
gives the eigenvalues so it is possible to calculate these. For
example, in the PPP
example the first eigenvalue is 0.30091 so the ax
m
as 183*LN(1-0.30091), i.e. 65.509 which can be set against the
correct critical
value, in this case 22.04.
References
J. A. Doornik. Approximations to the asymptotic distribution of
cointegration tests.
88. Journal of Economic Surveys, 12:573{593, 1998.
R. Harris and R. Sollis. Apple Time Series Modelling and
Forecasting. John Wiley &
Sons Ltd., Chichester, 2003.
D. F. Hendry and J. A. Doornik. Empirical Econometric
Modelling Using Pc-Give,
volume 1. Timberlake Consultants Ltd., 3 edition, 2001.
S. Johansen. Cointegration in partial systems and the effciency
of single equation
analysis. Journal of Econometrics, 52:389{402, 1992.
M. McAleer and L. Oxley. Practical Issues in Cointegration
Analysis. Blackwell
Publishers, Oxford, 1999.
M. Verbeek. A Guide to Modern Econometrics. John Wiley &
Sons, Inc., 2004.
Johansen Test by PcGive(computer lab2).pdf
— Appendix ————-—
Cointegration Analysis Using the
Johansen Technique: A Practitioner's
__ Guide to PcGive 10.1
89. This appendix provides a basic introduction on how to
implement the Johan-
sen technique using the PcGive 10.1 econometric program (see
Doornik and
Hendry, 2001 for full details). Using the same data set as
underlies much of the
analysis in Chapters 5 and 6, we show the user how to work
through Chapter 5
up to the point of undertaking joint tests involving restrictions
on a and p.
This latest version of PcGive brings together the old PcGive
(single equa-
tion) and PcFiml (multivariate) stand-alone routines into a
single integrated
software program (that in fact is much more than the sum of the
previous
versions, since it is built on the Ox programming language and
allows
various bolt-on Ox programs to be added—such as dynamic
panel data
analysis (DPD), time series models and generalized
autoregressive conditional
heteroscedastic (GARCH) models—see Chapter 8). It is very
flexible to
operate, providing drop-down menus and (for the present
analysis) an
extensive range of modelling features for 7(1) and 7(0) systems
(and limited
analysis of the 7(2) system).1 Cointegration facilities are
embedded in an
overall modelling strategy leading through to structural vector
autoregression
(VAR) modelling.
90. After the data have been read-in to GiveWin2 (the data
management and
graphing platform that underpins PcGive and the other programs
that can
operate in what has been termed the Oxmetrics suite of
programs), it is first
necessary to (i) start the PcGive module, (ii) select 'Multiple-
equation Dynamic
Modelling' and then (iii) 'Formulate' a model. This allows the
user to define the
model in (log) levels, fix which deterministic variables should
enter the co-
integration space, determine the lag length of the VAR and
decide whether
1 PcGive also allows users to run batch jobs where previous
jobs can be edited and rerun.
2 The program accepts data files based on spreadsheets and
unformatted files.
260 APPENDIX
Figure A.I. Formulating a model in PcGive 10.1: Step (1)
choosing the correct model
option.
7(0) variables, particularly dummies, need to be specified to
enter the model in
the short-run dynamics but not in the cointegration spaces (see
Figures A. 1 and
A.2).
When the 'Formulate' option is chosen, the right-hand area
under 'Data-
91. base' shows the variables available for modelling. Introducing
dummies and
transformations of existing variables can be undertaken using
the 'Calculator'
or 'Algebra Editor' under Tools' in GiveWin, and these new
variables when
created will also appear in the 'Database'. In this instance, we
will model the
demand for real money (rm) as a function of real output (y),
inflation (dp) and
the interest rate (rstar), with all the variables already
transformed into log
levels. The lag length (k) is set equal to 4 (see lower right-hand
option in
Figure A.2); if we want to use an information criterion (1C) to
set the lag
length, then k can be set at different values, and when the model
is estimated
it will produce the Akaike, Hannan—Quinn and Schwarz 1C for
use in deter-
mining which model is appropriate.3 (However, it is also
necessary to ensure
that the model passes diagnostic tests with regard to the
properties of the
residuals of the equations in the model—see below—and
therefore use of an
1C needs to be done carefully.)
Each variable to be included is highlighted in the 'Database'
(either one at
a time, allowing the user to determine the order in which these
variables enter,
or all variables can be simultaneously highlighted). This will
bring up an
'<<Add' option, and, once this is clicked on, then the model
selected appears
92. on the left-hand side under 'Model'. The 'Y' next to each
variable indicates
3 Make sure you have this option turned on as it is not the
default. To do this in PcGive.
choose 'Model', then 'Options', 'Additional output' and put a
cross in the information
criterion box.
APPENDIX , 261
Figure A.2. Formulating a model in PcGive 10.1: Step (2)
choosing the 'Formulate'
option.
that it is endogenous and therefore will be modelled, a 'IT
indicates the vari-
able (e.g., the Constant, which enters automatically) is
unrestricted and will
only enter the short-run part of the vector error correction
model (VECM),
and the variables with '_k' next to them denote the lags of the
variable (e.g.,
rmt – 1).
We also need to enter some dummies into the short-run model to
take
account of'outliers' in the data (of course we identify these only
after estimating
the model, checking its adequacy, and then creating
deterministic dummies to
try to overcome problems; however, we shall assume we have
already done this,4
93. 4 In practice, if the model diagnostics—see Figure A.3—
indicates, say, a problem of
non-normality in the equation determining a variable, plot the
residuals using the
graphing procedures (select, in PcGive, 'Test' and 'Graphic
analysis' and then choose
'Residuals' by putting a cross in the relevant box). Visually
locate outliers in terms of
when they occur, then again under 'Test' choose 'Store residuals
in database', click on
residuals and accept the default names (or choose others) and
store these residuals in the
spreadsheet. Then go to the 'Window' drop-down option in Give
Win and select the
database, locate the residuals just stored, locate the outlier
residuals by scrolling down
the spreadsheet (using the information gleaned from the
graphical analysis) and then
decide how you will 'dummy out' the outlier (probably just by
creating a dummy
variable using the 'Calculator' option in Give Win, with the
dummy being 0 before and
after the outlier date and 1 for the actual date of the outlier).
262 APPENDIX
or that ex ante we know such impacts have occurred and need to
be included).
Hence, highlight these (dumrst, dumdp, dumdpl), set the lag
length option at
the bottom right-hand side of the window to 0 and then click on
'<Add'. Scroll
down the 'Model' window, and you will see that these dummies
have 'Y' next to
94. them, which indicates they will be modelled as additional
variables. Since we
only want them to enter unrestrictedly in the short-run model,
select/highlight
the dummies and then in the 'Status' options on the left-hand
side (the buttons
under 'Status' become available once a variable in the model is
highlighted)
click on 'Unrestricted', so that each dummy now has a 'U' next
to it in the
model.
Finally, on the right-hand side of the 'Data selection' window is
a
box headed 'Special'. These are the deterministic components
that can be
selected and added to the model. In this instance, we select
'CSeasonal
(centred seasonal dummies), as the data are seasonally
unadjusted, and
add the seasonal dummies to the model. They automatically
enter as unrest-
ricted. Note that if the time 'Trend' is added, it will not have a
'U' next to it
in the model, indicating it is restricted to enter the cointegration
space
(Model 4 in Chapter 5—see equation (5.6)). If we wanted to
select Model
2 then we would not enter the time trend (delete it from the
model if it is
already included), but would instead click on 'Constant' in the
'Model'
box and click on 'Clear' under the 'Status' options. Removing
the unrest-
ricted status of the constant will restrict it to enter the
cointegration space.
95. Thus, we can select Models 2–4, one at a time, and then decide
which
deterministic components should enter II, following the Pantula
principle
(see Chapter 5).
Having entered the model required, click OK, bringing up the
'Model
settings' window, accept the default of 'Unrestricted system' (by
clicking OK
again) and accept ordinary least squares (OLS) as the estimation
method
(again by clicking OK). The results of estimating the model will
be available
in Give Win (the 'Results' window—accessed by clicking on the
Give Win
toolbar on your Windows status bar). Return to the PcGive
window (click
on its toolbar), choose the 'Test' option to activate the drop-
down options,
and click on 'Test summary'. This produces the output in
GiveWin as shown in
Figure A.3. The model passes the various tests equation by
equation and by
using system-wide tests.
Several iterations of the above steps are likely to be needed in
practice to
obtain the lag length (k) for the VAR, which deterministic
components should
enter the model (i.e., any dummies or other 7(0) variables that
are needed in the
short-run part of the VECM to ensure the model passes the
diagnostic tests
on the residuals) and which deterministic components should
enter the
96. cointegration space (i.e., should the constant or trend be
restricted to be
included in II). To carry out the last part presumes you have
already tested
for the rank of II, so we turn to this next.
To undertake cointegration analysis of the I(1) system in
PcGive, choose
Test', then 'Dynamic Analysis and Cointegration tests' and
check the "7(1)
APPENDIX
rm
Y
dp
rstar
rm
Y
dp
rstar
rm
Y
dp
rstar
rm
y
dp
rstar
rm
y
dp
rstar
101. Vector Normality test: Chi'2(8) = 15.358 [0.0525]
Vector hetero test: F(350,346)= 0.47850 [1.0000]
Not enough observations for hetero-X test
Figure A.3. Estimating the unrestricted VAR in PcGive 10.1;
model diagnostics.
cointegration analysis' box.5 The results are produced in Figure
A.4,6 provid-
ing the eigenvalues of the system (and log-likelihoods for each
cointegration
rank), standard reduced rank test statistics and those adjusted
for degrees of
freedom (plus the significance levels for rejecting the various
null hypotheses)
and full-rank estimates of a, p and IT (the P are automatically
normalized along
the principal diagonal). Graphical analysis of the (J-vectors
(unadjusted and
adjusted for short-run dynamics) are available to provide a
visual test of which
vectors are stationary,7 and graphs of the recursive eigenvalues
associated with
each eigenvector can be plotted to consider the stability of the
cointegration
vectors.8
5 Note that the default output only produces the trace test. To
obtain the A-max test as
well as the default (and tests adjusted for degrees of freedom),
in PcGive choose 'Model',
then 'Options', 'Further options' and put a cross in the box for
cointegration test with
Max test.
6 Note that these differ from Box 5.5 and Table 5.5, since the
latter are based on a model
102. without the outlier dummies included in the unrestricted short-
run model.
7 The companion matrix that helps to verify the number of unit
roots at or close to
unity, corresponding to the 7(1) common trends, is available
when choosing the
'Dynamic analysis' option in the 'Test' model menu in PcGive.
8 Note that, to obtain recursive options, the 'recursive
estimation' option needs to be
selected when choosing OLS at the 'Estimation Model' window
when formulating the
model for estimation.
264 APPENDIX
1(1) cointegration analysis, 1964 (2) to 1989 (2)
eigenvalue
0.57076
0.11102
0.063096
0.0020654
loglik for rank
1235.302 0
1278.012 1
1283.955 2
1287.246 3
1287.350 4
rank Trace test [ Prob] Max test [ Prob] Trace test [T-nm] Max
test [T-nm]
0 104.10 [0.000]** 85.42 [0.000]** 87.61 [0.000]** 71.89
[0.000]'
103. 1 18.68 [0.527] 11.89 [0.571] 15.72 [0.737] 10.00 [0.747]
2 6.79 [0.608] 6.58 [0.547] 5.72 [0.731] 5.54 [0.676]
3 0.21 [0.648] 0.21 [0.648] 0.18 [0.675] 0.18 [0.675]
Asymptotic p-values based on: Unrestricted constant
Unrestricted variables:
[0] = Constant
[1] = CSeasonal
[2] = CSeasonal_l
[3] = CSeasonal_2
[4] = dumrst
[5] = dumdp
[6] = dumdp1
Number of lags used in the analysis: 4
beta (scaled on diagonal; cointegrating vectors in columns)
rm
y
dp
rstar
1.0000
-1.0337
6.4188
6.7976
15.719
1.0000
-207.49
131.02
-0.046843
0.064882
1.0000
-0.039555
105. dp
-1.3397
-0.0081182
0.064590
0.28129
rstar
-1.1537
-0.18666
0.18677
-0.11673
Figure A.4. 7(1) cointegration analysis in PcGive 10.1.
After deciding on the value of r < n, it is necessary to select a
reduced rank
system. In PcGive, under 'Model', choose 'Model settings' (not
'Formulate'),
select the option 'Cointegrated VAR' and in the window that
appears set the
cointegration rank (here we change '3' to '1', as the test
statistics indicate that
r — 1). Leave the 'No additional restrictions' option unchanged
as the default,
click OK in this window and the next, and the output (an
estimate of the new
value of II together with the reduced-form cointegration
vectors) will be
written to the results window in GiveWin.
Finally, we test for restrictions on a and p (recall that these
should usually
be conducted together). To illustrate the issue, the model
estimated in Chapter 6
106. APPENDIX , , 265
Figure A.5. Testing restrictions on a and B using 'General
Restrictions' in PcGive 10.1.
is chosen (instead of the one above) with a time trend restricted
into the
cointegration space and r — 2. Thus, we test the following
restrictions:
, r-i i * * o
[ 0 — 1 * * *
,_ r* o * o
~~ L* o * o
using the option 'General restrictions'. To do this in PcGive,
under 'Model',
choose 'Model settings', select the option 'Cointegrated VAR'
and in the
window that appears set the cointegration rank (here we change
'3' to '2',
since we have chosen r = 2). Click the 'General restrictions'
option, type the
relevant restrictions into the window (note that in the 'Model'
the parameters
are identified by '&' and a number—see Figure A.5), click OK
in this window
(and the next) and the results will be written into Give Win
(Figure A.6—see
also the top half of Box 6.1).
CONCLUSION
107. For the applied economist wishing to estimate cointegration
relations and then
to test for linear restrictions, PcGive 10.1 is a flexible option.
But there are
others. Harris (1995) compared three of the most popular
options available in
the 1990s (Microfit 3.0, Cats (in Rats) and PcFiml—the latter
the predecessor
to the current PcGive). The Cats program9 has seen little
development since its
9 Cointegration Analysis of Times Series (Cats in Rats), version
1.0, by Henrik Hansen
and Katrina Juselius, distributed by Estima.
266 APPENDIX
Cointegrated VAR (4) in:
[0] - rm
tl] = y
[2] = dp
[3] = rstar
Unrestricted variables:
[0] = dumrst
[1] = dumdp
[2] = dumdp 1
[3] = Constant
[4] = CSeasonal
[5] = CSeasonal_l
[6] = CSeasonal_2
Restricted variables:
[0] = Trend
Number of lags used in the analysis: 4
General cointegration restrictions: