Dirk Eddelbüttel* Bank of Montreal, Toronto, Canada. Dirk.Eddelbuettel@bmo.com
November 1999

Summary
GNU Octave is an open-source implementation of a (mostly Matlab compatible) high-level languagefor numerical computations. This review briefly introduces Octave, discusses applications of Octave in an econometric context, and illustrates how to extend Octave with user-supplied C++ code.Several examples are provided.

Introduction
Econometricians sweat linear algebra. Be it for linear or non-linear problems of estimation or inference, matrix algebra is a natural way of expressing these problems on paper. However, when it comes to writing computer programs to either implement tried and tested econometric procedures, or to research and prototype new routines, programming languages such as C or Fortran are more of a burden than an aid. Having to enhance the language by supplying functions for even the most primitive operations such as transposing a matrix adds extra programming effort, introduces new points of failure, and moves the level of abstraction further away from the elegant mathematical expressions. As Eddelbüttel (1996) argues, object-oriented programming provides `a step up' from Fortran or C by enabling the programmer to seamlessly add new data types such as matrices, along with operations on these new data types, to the language. But with Moore's Law still being validated by ever and ever faster processors, and, hence, ever increasing computational power, the prime reason for using compiled code, i.e. speed, becomes less relevant. Hence the growing popularity of interpreted programming languages, both, in general, as witnessed by the surge in popularity of the generalpurpose programming languages Perl and Python and, in particular, for numerical applications with strong emphasis on matrix calculus where languages such as Gauss, Matlab, Ox, R, Splus, which were reviewed by Cribari-Neto and Jensen (1997), Cribari-Neto (1997) and Cribari-Neto and Zarkos (1999), have become popular. This article introduces another interpreted language focussed on numerical applications: Octave.

Octave is a program, as well as a programming language, for doing numerical work in a convenient yet expressive and powerful fashion. Octave was written primarily by John W. Eaton of the University of Wisconsin-Madison with various smaller contributions from other programmers across the Internet. The history of Octave can be traced back (as far as 1988) to the idea of providing companion software
for a textbook in chemical engineering, written by two researchers from the University of WisconsinMadison and the University of Texas. Full-time development for Octave began in the spring of 1992. Version 1.0 was released in February of 1994, and version 2.0 followed in January of 1997. Octave is part of the GNU project (which is on the Web at http://www.gnu.org) and released under the GNU General Public License (GPL). It can therefore be used, studied, extended or simply copied just like any other Free Software program.

Econometricians might want to employ Octave for a variety of applications as it provides a convenient tool for interactive work which can range from simple applications to ad hoc simulations. The user interface, i.e. the Octave shell, is flexible and powerful. The rich set of mathematical operators and functions make Octave a very good prototyping and programming platform, or data pre- and postprocessing application. As Octave can be extended with new C, C++ or Fortran code that runs at the speed of compiled code, it is a good building block for Monte Carlo simulations. Octave is very similar to Matlab, and to a lesser extent to Gauss. However, both of these are commercial `closed source' programs whereas Octave, as noted above, is distributed under the GNU GPL.
...
Octave also contains plotting commands which are implemented as wrappers around the external Gnuplot program. These commands include a generic plot command for plotting one or several series, as well as commands for plotting histograms and bar charts. All of these can be annotated, and it is possible to have several plot windows open at the same time (which requires a Gnuplot binary more recent than the 3.5 releases). The Octave plot commands are very convenient, but clearly not as complete as the Matlab plotting functions and hence might not satisfy all needs for publication-quality graphs. However, add-on packages have been provided by Octave users. Debian GNU/Linux provides additional graphics packages such as octave-plplot, an Octave interface to the PLPlot program, and octave-epstk, a package for the direct creation of encapsulated postscript graphs. ...
