| What is Ox? | Running and learning | Supported data file formats |
| Packages | Platforms and versions | Ox is fast |
| Graphics | Folder structure | Using file names in Ox |
| Extending Ox | Debug mode | OxEdit |
Ox is an object-oriented matrix programming language with a comprehensive mathematical and statistical function library. Matrices can be used directly in expressions, for example to multiply two matrices, or to invert a matrix. The major features of Ox are its speed, extensive library, and well-designed syntax, which leads to programs which are easier to maintain. For a first impression of the matrix and statistical function library see the Function summary.
The full desktop version of Ox, called Ox Professional is part of the OxMetrics software that is available from Timberlake Consultants. Timberlake can be found on the internet at timberlake.co.
The Windows/macOS/Linux command-line versions of Ox can be downloaded from: oxlang.dev. This is called Ox Console, and contains OxEdit as the default editor to create and run Ox programs.
The Ox runtime is the same in the professional and console version. So both are 64-bit and support parallel loops.
The Ox folder structure is described below. Detailed information on the installation structure for Windows and macOS/linux is also available.
The browser version of Ox is at oxrun.dev.
This documentation refers to version 10.
Please check my
work page for the latest news, including
known bugs
and planned extensions.
See what's new in this version.
Conditions, citation and copyright.
Ox is most conveniently run via OxEdit or OxMetrics.
Ox can also be run from oxrun.dev or the command line using the oxl command.
It is recommended to start with the by J.A. Doornik and M. Ooms. The accompanying tutorial programs are in the ox/samples folder and also in oxrun.dev.
Ox can read (and write) the following data files directly into a matrix:
Data files are loaded into a matrix using the loadmat() function. Alternatively, the Database class can be used to load data files with sample period and variable names. The database function is Load.
In addition, there are text and binary functions for reading and writing.
Packages extend the functionality of Ox in various ways. Once installed, they become an integrated part of Ox. Some packages just add a few useful functions, whereas others offer their functionality in an extensive class. A package is also a convenient way for communicating research.
Check oxlang for additional code and packages. The Arfima and DPD packages are installed with Ox and OxMetrics:
There are also several packages and utilities which are part of the basic release:
Ox is faster than most other matrix programming languages. Some benchmarks are available.
Many types of graphs are readily produced in Ox, such as graphs over time of several variables, cross-plots, histograms, correlograms, etc. A graph can be saved in : PDF (.pdf or SVG (.svg). The OxMetrics graphics file (.gwg) is saved as a companion file to allow reloading into OxMetrics. Although view and saving graphs will work on any system supported by Ox, it is only possible to edit the results directly in OxMetrics. The terminal version cannot display graphs.
C:\Program Files\OxMetrics10\ox
If a local install is made, installation is to your user folder as recorded in \verb$%USERPROFILE%$:
%USERPROFILE%\AppData\Local\Programs\OxMetrics10
/Applications/OxMetrics10/ox
/usr/share/OxMetrics10/ox
%USERPROFILE%\OxMetrics10\ox
$HOME/OxMetrics10/ox
The layout within the installation folder is:
ox - executables and DLLs
ox/data - default data directory
ox/dev - examples on how to extend Ox
doc/ox - documentation (start index.html)
ox/include - Ox header files
ox/lib - useful additional source code files
ox/packages - Ox extension packages
ox/samples - Ox samples directory
ox/src - Ox code for .oxo files in ox/include
ox/samples/bench - benchmark samples
ox/samples/classes - Line and Angle classes, virtual
ox/samples/database - database class examples
ox/samples/graphics - graphics examples
ox/samples/inout - input/output examples
ox/samples/Introduction to Ox - Example code for \cite{OxIntro
ox/samples/lib - examples for source code files in ox/lib
ox/samples/maximize - function maximization and differentiation
ox/samples/oxapp - application illustrating Ox App dialogs
ox/samples/pcfiml - PcFiml examples
ox/samples/simulation- Simulator class examples
Ox is installed with a default search path for code and data files. To see what it is, open a terminal (console) window, go to the ox folder, and enter oxl -i. The search path can be amended on the command line, or through the OX10PATH environment variable. Ox will read the OX10PATH environment variable on all platforms. If you do set it, you must include the default paths.
The command-line syntax is
oxl [options for oxl] program [options for program]
Arguments before the Ox filename are passed to the compiler, those after to the running program. So in
oxl -DMYTEXT1 prog.ox -DMYTEXT2
the string "-DMYTEXT2" is not handled by the compiler, but available to the prog.ox program when using the arglist() function.
If you specify full path names of files in a string constant, you must either use one forward slash, or two backslashes:
"./data.mat"
".\\data.mat"
Ox will interpret one backslash in a string as an escape sequence (as in the newline character); a single backslash will only work if it does not happen to form an escape sequence. Also note that Linux treats file names in a case sensitive manner.
Ox implements a flexible run-time engine, and can be extended in various ways, for example:
The documentation is in the .
Using Ox App, Ox can use OxMetrics as a front-end, which holds databases, and receives text and graphical output from Ox.
Most Ox versions have a debug mode, which is entered by using the -d switch. The (debug) prompt indicates the debug mode. Just pressing enter will step through the code.
Local and global variables in .oxo files can only be seen in the debugger if these have been compiled with the -d switch. Note that expressions which are entered from the command line still need to be terminated with a semicolon as usual (including, for example, when just a few spaces are entered).
Ox version 10.0. © JA Doornik This file last changed .