
GAUSS Programs for

A family of Autoregressive conditional duration models
======================================================

by Marcelo Fernandes and Joachim Grammig

forthcoming Journal of Econometrics

the programs produce the results of
forthcoming version that can be downloaded until
publication data
http://www.uni-tuebingen.de/uni/wwo/Grammig/classacd.pdf

Contact:
Marcelo Fernandes, Graduate School of Economics, Getulio Vargas Foundation,
Praia de Botafogo 190, 22253-900 Rio de Janeiro, RJ, Brazil.
Telephone: +55 21 2559 5827, Fax: +55 21 2553 8821. mfernand@fgv.br
Joachim Grammig, University of T\"{u}bingen,
Mohlstrasse 36, D-72074 T\"{u}bingen, Germany. Telephone: +49 7071
joachim.grammig@uni-tuebingen.de

The programs can be freely used for academic purposes if
this source is acknowledged.


To run the programs copy the contents of the zip file in a
directory. Retain the paths structure


1. To reproduce the estimation results in tables 3-7
====================================================

The GAUSS programs used to produce the estimation results for the various
members of the ACD family in tables 3-7 of the paper.
The respective programs all have the ending .prg. There is one program for
each stock/duration type/model combination.

Naming convention is as follows:
First letter identifies
stock

e=exxon
b=boeing
d=disney
i=ibm
c=coca cola

second type of duration process
p=price
v=volume
t=trade

remaining letters the model

bcacd  (Box Cox ACD)
exacd  (Dufour and Engle Exponential ACD)
lacd_1 (log ACD type 1)
logacd (log ACD type 2)
linacd (linear ACD)
pacd (power ACD)
asana (asymmetric linear ACD)
apacd (asymmetric power ACD)
alacd (asymmetric logarithmic ACD)
aacd (augmented ACD)

Example: ivpacd.prg is the Power ACD estimated on
IBM volume durations.

Sometimes the last letter is a b identifying the Burr-specification.
However, the letter is not always there due to
to the restriction of 8 letters for the GAUSS program file.
Exception:
Only the IBM price duration programs lack the duration type identifier,
e.g. iaacdb.prg stands for IBM price duration augmented ACD model.

2. Compute D-test (nonparametric specification test) reported in tables 3-7
===========================================================================
Program dtestall.prg is used to compute the D-statistics along the
lines developed
Marcelo Fernandes and Joachim Grammig
Nonparametric specification tests for conditional duration models
forthcoming Journal of Econometrics (2005)
forthcoming version that can be downloaded until
publication data
http://www.uni-tuebingen.de/uni/wwo/Grammig/Hazard.pdf

The zip file also contains the output produced by
the dtestall.prg program which consists of the results of the various test
variants (see Fernandes and Grammig paper)

You need to activate (remove comments) in
the respective program block stock/duration type
in the programm dtestall.prg. The end of the respective blocks are marked.

The program computes all variants of the nonparametric test, but for the
"Family-paper" only the variant with log durations is reported.
 The program also produces graphs that compare
the nonparametric density with the parametric density.
The program prints on the screen and generates an .out file that reports the test statistics and
the p-values. You need only the DS row, the last value is the value of the
test statistic, the second to last is the p-value.
For example part of the output for Exxon price durations looks like

*************************** standard ACD ***********
BACD
DS      0.45496662       0.37096555     0.0042474623      0.098715999        1.2889025
HS      0.00000000             +INF             +INF                .                .

This is for the Box-Cox ACD. The p-value is 0.097 with a test statistic equal to 1.229

The test output is also written into a GAUSS data set.

3. the other .fmt files in the zip file
=======================================
The zip file contains GAUSS .fmt files that contain starting values and estimated
parameters values (*_par.fmt files) of the likelihood functions (*_f0.fmt files),
return codes of the ML estimation (*_retcode.fmt files) and parameter standard
errors (*_se.fmt files). The * stands for the respective stock/duration type/model
combination described above.

All  programs #include  a series of important source files which contain code
the estimation of various conditional duration models (more than
those included in the paper), mostly likelihood functions and auxiliary
procedures. These files are

highfreq.dec;
highfreq.ext;
svdDeflt.ext;
gammafm.src;
svd_h.src;
tacd.dec;
tacd.src;
dtyfcacd.src;
montcarl.prc;

These files have to reside in a directory where GAUSS can #include files.
You can copy them in your current directory and assign the GAUSS starting
directory to it.

The core procedures for ML estimation of the AACD family can be found in
the source file dtyfcacd.src


4. Data files
==============

The data are in  GAUSS matrices

Price durations
xonqp18.fmt
ibmqp18.fmt
koqp18.fmt
baqp18.fmt
disqp18.fmt
Column descriptions in file
price duration info

Volume durations
xonqv25.fmt
ibmqv25.fmt
koqv25.fmt
baqv25.fmt
disqv25.fmt
Column descriptions in file
volume duration info

Trade durations
xon_t.fmt
ibm_t.fmt
ko_t.fmt
ba_t.fmt
dis_t.fmt
Column descriptions in file
file description trade durations.txt

Thanks again to Pierre Giot and Luc Bauwens
for their permission to use the data.

Compatibility and requirements:
===============================

1. You need the GAUSS modules CML (Constrained ML)  and CO
(constrained optimization) on your machines. You can get rid of CO as the
models estimated in the paper only use CML. CO is used for the estimation
of other models. As the programs use some globals of CO, removing the CO
references requires some manual work. Otherwise the programs should run
without problems.

2. We have tested the programs and they run under GAUSS 3.2.3 and GAUSS 6.0
However, GAUSS 3.2.3. did not have a internal digamma function so the
file dtyfcacd.src has a procedure that computes it. Newer versions of
GAUSS have an internal digamma function and will complain if an
own function is declared. Hence, to run the programs under a newer version
of GAUSS you have to comment out the digamma procedure in dtyfcacd.src
The results reported in the paper are based on the digamma procedure in
dtyfcacd.src.
