Ox
An object-oriented matrix programming language with an extensive mathematical and statistical function library, designed by Jurgen Doornik for high-performance econometric and statistical computing.
Created by Jurgen A. Doornik
Ox is an object-oriented matrix programming language with a comprehensive mathematical and statistical function library, designed by Jurgen A. Doornik for econometric and statistical computing. It pairs a familiar, C-like syntax with first-class support for matrices and high-level numerical routines, allowing researchers to express linear algebra, simulation, and estimation problems concisely while retaining the speed expected of a compiled-style scientific tool. Ox sits at the heart of OxMetrics, a widely used suite for econometric modelling, and has long been valued in academic economics for combining matrix-language expressiveness with strong numerical performance.
History & Origins
Ox grew out of the practical needs of empirical econometrics. Its lineage traces back to PcGive, one of the earliest econometric software packages for personal computers, initiated by the econometrician David Hendry in the 1980s while at the London School of Economics. PcGive established a tradition of accessible, well-documented tools for time-series and dynamic modelling that would eventually be gathered under the OxMetrics umbrella.
Jurgen Doornik, working in the econometrics research community associated with the University of Oxford, released the first public version of Ox in 1996. He set out to build a matrix language that was both fast and programmable — something that could serve as the computational engine for serious econometric work rather than only as an interactive calculator. The name “Ox” reflects the first and last letters of “Object-oriented matrix,” and is often also read as a nod to Oxford. According to the language’s own lore, the name was partly self-deprecating at the outset — likening the system to a sturdy but slow work animal — though Ox subsequently became considerably faster.
Over the following decades Ox was developed alongside OxMetrics, the graphical environment (originally related to the GiveWin/PcGive front-ends) that provides interactive data handling, graphics, and access to estimation modules. Ox became the scripting and extension language that ties these components together.
Design Philosophy
Ox is built around a few deliberate choices that distinguish it from both general-purpose languages and other matrix systems:
- Matrices as the primitive. The fundamental data type is the matrix, so operations such as multiplication, inversion, and concatenation are written directly in mathematical terms rather than through explicit loops.
- C-like syntax with managed memory. Ox borrows much of its surface syntax from C and C++ — braces, semicolons, familiar control flow — which lowers the barrier for programmers coming from those languages, while handling memory management automatically.
- Object orientation for larger programs. Beyond quick scripts, Ox supports classes and objects, enabling the construction of reusable estimation libraries and structured statistical packages.
- Performance as a goal, not an afterthought. Ox was designed so that numerically intensive code — simulations, bootstrap procedures, and iterative estimators — runs efficiently, an important consideration for computationally demanding econometrics.
A practical consequence of these choices is that variables are dynamically typed: they are introduced with the decl keyword and can hold scalars, matrices, strings, arrays, or objects, with the actual type resolved at run time.
Key Features
- Rich numerical library: built-in functions for linear algebra (decompositions, solving systems, eigenvalues), probability distributions, random number generation, optimization, and numerical differentiation.
- Matrix operators: concise operators for matrix arithmetic, element-by-element operations, horizontal and vertical concatenation, and indexing/slicing of submatrices.
- Object-oriented programming: classes, member functions, and inheritance for building structured statistical software.
- Extensibility: the ability to link to external code and to define packages, which is how libraries such as SsfPack and G@RCH are delivered.
- Integration with OxMetrics: in its professional form, Ox can interact with the OxMetrics environment for data input, graphics, and interactive results, while the console edition runs from the command line.
- Graphics: facilities for producing plots, particularly useful in exploratory data analysis and reporting.
A flavour of the syntax
#include <oxstd.oxh>
main()
{
decl x = <1, 2, 3; 4, 5, 6>; // a 2x3 matrix literal
decl y = x'; // transpose
println("x * y = ", x * y); // matrix multiplication
}
The combination of matrix literals, the transpose operator, and C-style program structure is characteristic of how Ox code reads.
Performance
A recurring theme in Ox’s presentation is numerical speed. In benchmarks published by its author comparing matrix-language implementations of common econometric tasks, Ox has been reported to perform competitively with — and on some numerically intensive operations faster than — other matrix-oriented systems such as GAUSS and MATLAB. These comparisons are author-reported and depend heavily on the specific operations measured, the problem sizes, the hardware, and the versions involved, so they should be read as indicative of Ox’s design emphasis on speed rather than as universal claims. Doornik has also explored computationally intensive and distributed econometrics built on the language.
Evolution
Ox has been steadily maintained for nearly three decades, with versions tracking the parallel OxMetrics releases:
| Version | Approx. release |
|---|---|
| Ox 1 (first public release) | 1996 |
| Ox 3.4 | October 2004 |
| Ox 4 | March 2006 |
| Ox 5.1 | July 2008 |
| Ox 6.2 | April 2011 |
| Ox 7 | August 2013 |
| Ox 8 | December 2018 |
| Ox 9.30 | June 2024 |
Across these releases the language gained library breadth, performance improvements, and platform updates — including the move to 64-bit-only builds around version 8 and support for macOS on both Intel and Apple silicon in recent releases. The current version is Ox 9.30, released in June 2024.
Distribution and Licensing
Ox uses a dual model. The Ox Console edition — the command-line interpreter — is free for academic use, which has helped it spread through university teaching and research. Ox Professional, which integrates with the OxMetrics graphical environment, is a commercial product distributed through commercial channels. The broader OxMetrics suite bundles Ox with econometric modules such as PcGive, STAMP, G@RCH, and others. Ox is available for Windows, Linux, and macOS.
Current Relevance
Ox occupies a specialized but durable niche. It is not a mainstream general-purpose language and does not compete with Python or R for breadth of ecosystem; instead, it serves the econometrics and statistical-computing community, where its matrix orientation, speed, and tight integration with OxMetrics remain attractive. Its continued release cadence — with a 2024 version supporting modern 64-bit platforms and Apple silicon — shows that it is actively maintained rather than a historical artifact. Many advanced econometric methods, particularly in time-series, state space, and volatility modelling, have first been made available as Ox packages.
Why It Matters
Ox demonstrates how a carefully scoped, domain-focused language can thrive for decades by serving its community well. It bridged two worlds that were often separate in the 1990s: the convenience of interactive matrix languages and the performance of compiled numerical code. For econometricians, it provided a programmable, fast platform on which a generation of estimation methods and software packages were built, and through OxMetrics it brought sophisticated modelling techniques to a wide audience of researchers and analysts. As an example of a long-lived scientific programming language designed by a working researcher for working researchers, Ox is a notable entry in the history of statistical computing.
Timeline
Notable Uses & Legacy
OxMetrics econometric suite
Ox is the programming language underpinning OxMetrics, the integrated econometrics and statistics system developed by Jurgen Doornik and David Hendry for time-series, cross-section, and panel data analysis
PcGive and Autometrics
Doornik's Autometrics automatic model-selection algorithm and the PcGive dynamic-econometrics module are implemented and distributed within the Ox/OxMetrics ecosystem
SsfPack (state space methods)
SsfPack, a library for state space modelling and the Kalman filter co-developed by Siem Jan Koopman, is written as an Ox package and used in statistical time-series research
G@RCH (financial volatility modelling)
G@RCH, a package for estimating GARCH-type models of financial volatility, is built on Ox and used by researchers and practitioners in empirical finance
Academic econometrics research
Because the console edition is free for academic use, Ox has been used extensively in university econometrics teaching and in published quantitative-economics research