Econometric Modelling with Time Series

Specification, Estimation and Testing



Computation

Computer code written in GAUSS (*.g), MATLAB (*.m) and R (*.R) is available to reproduce relevant examples in the text, figures in the text that are not part of an example, the applications presented in the final section of each chapter and to complete the exercises. Where applicable, the time series data used in these examples, applications and exercises are also available in a number of different formats.

Although GAUSS, MATLAB and R are very similar high-level programming languages, there are some important differences that require explanation. Probably the most important difference is one of programming style. GAUSS programs are script files that allow calls to both inbuilt GAUSS and user-defined procedures. MATLAB and R, on the other hand, do not support the use of user-defined functions in script files. Furthermore, the MATLAB programming style favours writing user-defined functions in separate files and then calling them as if they were in-built functions. This style of programming does not suit the learning-by-doing environment that the book tries to create. Consequently, the MATLAB and R programs are written mainly as function files with a main function and with all of the required user-defined functions required to implement the procedure in the same file. The only exception to this rule is that a few utility files are provided as separate stand-alone MATLAB and R function files.

The GAUSS code was developed using Version 10 on a Windows operating system. The only applications that are required to run the code are MAXLIK and OPTMUM which are older versions of the maximum likelihood and optimisation modules than those currently available. The backwards compatibility of the code with the newer modules has not been checked.

The MATLAB code was developed using Mac OS2 Versions R2011/R2012 of MATLAB and uses the Optimisation, Statistics and Econometrics toolboxes. When most of the code was written, the Mac OS2 version only included a very basic ability to read Excel files. For example, sheet names and cell addresses could not be used. Consequently many of the MATLAB files read in .mat files to load the data. Newer versions of MATLAB (and also GAUSS 13) for the Mac platform now do have the functionality to handle Excel files so development is ongoing to clean up how the data is dealt with.

The R code was developed using R Studio, which is a free integrated development environment for R. A guide which explains how to set up and configure R Studio may be downloaded here. In some cases where ASCII data files are not available, the R code reads Rdata files.

There will no doubt be errors, bugs and inefficiencies in this code. It has not been written as software but rather to aid learning by doing. Please report all errors (hopefully with fixes) and any suggestions for more efficient code to Stan Hurn [s.hurn@qut.edu.au]. There may also be links put up with code written in other languages or using econometric software. If you have any code for the examples, applications or exercise and don't mind sharing them, please also send them along and arrangements will be made to have them put on the website.

RATS code for replicating the examples using actual data is available at
http://www.estima.com/cgi-bin/bookbrowser_singlebook.cgi?Textbook=martinhurnharris


Download all the code and data

Gauss Files

Matlab Files

R Files

RStudio Setup Guide


Code for each exercise may be accessed by clicking on the relevant chapter link.