The OxMetricstm system presents an interactive menu-driven graphics-oriented system for econometric, statistic, and financial analysis. Here we describe the core OxMetrics program, which acts as the `front-end' to a series of integrated software modules. These modules obtain their data from OxMetrics and return output and graphics to it. OxMetrics is the component that allows you to load, edit, and save data; transform that data using the calculator or algebra; create a wide variety of graphs, which can be edited, amended and saved in various formats; provide the data for other modules to analyze; receive their text output, results, and graphics; and lets you edit, amend, and save any or all of these as desired. As such, the OxMetrics front-end can be seen as the desktop for econometric and statistical modelling.
OxMetrics databases can have a fixed frequency, or `dated', which allows for daily or timed data. Aggregation facilities are provided, e.g. to convert daily data into monthly. OxMetrics is multilingual, in that names of database variables and text in reports and graphics can be from a wide range of languages, including Chinese and Japanese.
1.1 Supported platforms
The OxMetrics suite of programs runs on the following platforms:
A separate installation document describes the supported platforms in more detail, and shows how to install the software.
OxMetrics 7 operates independently from version 6.
1.1.1 Folder structure
The OxMetrics folder structure is as follows:
OxMetrics8/ algebra/ Algebra files bin/ binary and related files (32-bit, 64-bit macOS) bin64/ binary and related files (64-bit Windows, Linux) batch/ Batch files data/ Data files doc/ Help system ox/ Root of Ox installation bin/ binary files for Ox (32-bit, 64-bit macOS) bin64/ binary files for Ox (64-bit Windows, 64-bit Linux) doc/ help files for Ox include/ Ox header files for Ox code packages/ Ox packages samples/ Ox sample code ... OxEdit/
1.2 What is new?
This documentation refers to OxMetrics 8. OxMetrics 7 users will find much that is familar.
The most important new features are:
For availability contact Timberlake Consultants: www.timberlake-consultancy.com or www.timberlake.co.uk.
Consult www.doornik.com or www.oxmetrics.net for pointers to additional information relevant to the current and future versions of OxMetrics. A demonstration version is also available from these web sites.
The Help/Support menu lists some contact addresses for OxMetrics, as well as web sources of information.
To facilitate replication and validation of empirical findings, the module used to generate the results should be cited in all reports and publications involving its application.
OxMetrics incorporates an extensive cross-referenced help system which offers advice about crucial decisions and can be accessed at any time. This is based on HTML files, and requires that a browser such as Chrome, Firefox or Internet Explorer is installed. OxMetrics help is available from the Help menu or the Help pane in the workspace. The Help pane lists the contents of all the modules that have been installed within OxMetrics. Double clicking on an entry will start your default browser with the Help contents.
Context-dependent help, where available, can be obtained either by pressing the F1 key, or from the Help menu. For example, when writing an Ox program, put the caret on `println', and press F1. OxMetrics will search the html index files for a reference to that word. If there is only one, it will jump there immediately. Otherwise it will offer a list of choices in a dialog.
OxMetrics maintains the modular structure that was introduced in previous generations of the software. An increasing number of modules interacts with OxMetrics. In that case, the OxMetrics front-end is the `server', while the modules (TSP, STAMP, etc.) are the `clients'. The communication is implemented via DDE.
While it is possible to write clients that interface directly with the server (such as TSP, OxPack, and OxRun), it is much easier to develop Ox packages which do this. This requires the use of the Modelbase class, which provides the necessary functionality. Examples of this are PcGets, PcGive, G@rch, etc.
Ox is a powerful object-oriented matrix programming language with an extensive statistical library. Ox allows you to write your own programs using high level matrix operations, and provides easy facilities to read the same data files as OxMetrics can load. When the preprogrammed options in other modules do not provide a required estimator or test, and you have some basic programming skills, Ox could be used instead. Ox also has preprogrammed classes (a class is a term in object-oriented programming) to facilitate writing Monte Carlo experiments. Ox tends to be faster than other popular matrix languages. Please consult the separate Ox documentation for further information. The OxRun dialog application allows running Ox programs with OxMetrics as the destination of text and graphical output. An interesting example which shows densities and QQ plots while a Monte Carlo experiment is in progress is provided in \ox\samples\simulation\simnor.ox. The OxPack module provides an interactive front-end to several Ox packages.
A licensing code is required for the software to work properly. This code will have been supplied with your copy, and, under normal circumstances, the licence that is entered during installation is automatically used by the software.
Additional licences can be entered under the Help/Registration menu option (a dialog will automatically appear when OxMetrics is not registered). In the subsequent dialog you can enter your code as well as your name and affiliation. Help/Registration can be also used to check the available licences for using client modules.
Minor upgrades can be downloaded from www.doornik.com/products.html.
The Algebra language enables you to transform database variables by writing mathematical formulae. Algebra code can be written interactively in the Calculator, or directly in the Algebra editor. Such algebra code can be saved, reloaded, and edited.
The Calculator writes its operations as algebra code to the Results window, from where it can be cut and pasted into the algebra editor. Algebra can also be run directly from the results window, by highlighting the block of algebra code, and then pressing Ctrl+A.
Algebra is a simple vector language, operating on the variables in the database. The operation is applied to each observation in turn, although it is possible to limit access to a subsample. The syntax is described in Chapter Algebra.
OxMetrics is a menu-driven program for ease of use, but some operations can be implemented by entering commands. These commands are parts of simple `computer language' which allow some control of OxMetrics through Batch operations. A Batch program may contain sections of Algebra code.
Batch files allow you to load data, append results, implement algebra and save current PcGive (or STAMP etc.) models. Later, these can be run from the Model/Batch menu or by clicking on the OxMetrics icon on the toolbar. Thus, when a complicated model has been created interactively, it can be saved as a batch file for further editing, or easy recall in a later session. This is also the most convenient way to create a batch file. Like Algebra, batch code can be run directly by highlighting the block of text, and then pressing Ctrl+B.
Once saved to disk, a batch file can also be run directly using File/Open, or even by double clicking on the batch file in the Windows Explorer. Batch files have the .fl extension, which originally stood for Fiml Language. The syntax is described in Chapter Batch.
The primary mode of data storage is a pair of files with extensions .in7 and .bn7. The latter is a binary file containing the actual data, whereas the former holds the information on the contents of the binary file such as variable names, sample periods, frequencies etc. The information file is a human-readable file, the .bn7 is binary and is not human-readable. One artificial data set is supplied in the OxMetrics8\data folder, in the files called data.in7 and data.bn7. The tutorials use this data set. If you want to load your own data, you must begin by inputting the observations; however, follow the relevant tutorial first.
OxMetrics checks for potential overwriting of files and if such is likely to occur, allows selecting another file name. The data options facilitate easy archiving of data. Please be careful not to overwrite precious data sets. It is always wise to make regular backups of important files: hard disks may break down, accidental deletion occur or viruses could strike.
OxMetrics can read and write human-readable files and Excel spreadsheet files. OxMetrics can also read comma-separated, GAUSS and Stata files.
All file names have automatic default extensions which need not be input. Say the basic data set is called m1ukq, then the information file might be m1ukq.in7, the associated binary file (of actual data) will be m1ukq.bn7, the OxMetrics Results window storage file could be m1ukq.out, the algebra storage file m1ukq.alg, and batch files m1ukq.fl. A human-readable base data file generally uses the .dat extension. Graph files allow saving in encapsulated PostScript (.eps), PDF (.pdf), PostScript (.ps), Windows metafiles (.wmf), enhanced metafiles (.emf), and OxMetrics graphics (.gwg, for GiveWin graphics), of which the last can be re-read by OxMetrics for further editing.
Note that by default Windows does not show the file extension in the Explorer window --- only the icon shows what the file type is. If you wish, you can switch the display of file extensions on in the Folder Options entry in the Explorer.
All text output are shown in the Results window as calculations proceed but are not stored on disk or diskette unless specifically requested. On long runs, a large amount of information can be generated. This can be edited to eliminate redundant records: the Edit menu allows copying, cutting and pasting, deleting, finding and replacing.
The storage facility allows rapid interactive modelling to proceed while any useful results can be printed as a batch job when the computer is otherwise idle.
Since much of the output is graphical, graphs can be easily edited. Graphs can be saved in a variety of formats as noted in the next section.
For data samples, reference is by the absolute date in the form Year(Period) to Year(Period), for example: 1965(1) to 1985(3). Whenever a sample choice has to be made, OxMetrics will show the maximum available and will not allow choices outside that range.
When the data is dated, for example consisting of daily data, the choice is made by entering dates in ISO format of yyyy-mm-dd. The year is always four digits, the month one or two digits (1=January) and the date also one or two digits. For example: 1965-1-31 to 1985-9-5.
Time is written as hh:mm:ss.uuu where hour is two digits on the 24-hour clock (so 22:00 is 10 PM), mm is minutes, the seconds and hundreds are optional. When combined with a date, the ISO standard uses a T to glue the parts together: 1980-1-1T12:05:05.
The status bar is displayed at the bottom of the OxMetrics window and consists of four areas:
For example: L 113 C 14 indicates that the caret is at Line 113, Column 14. In binary/hexadecimal viewing mode this shows the position of the caret in decimal (the first character of the document is at byte 0). This field will also indicate if the document is read-only, or when the editor is in overwrite mode.
One of: Win, Lnx, Mac for Windows (\r\n), Linux (\n) or Mac (\r).
If the file format is different from the default (ASCII) encoding, this is indicated by one of UTF8, UTF16, or UTF32. The can be followed by BE or LE to indicated big-endian or little-endian encoding.
These properties can be changed using Edit/Text properties.
Three tool bars are displayed across the top of OxMetrics, below the menu bar. The tool bars can be customized from a right click on the bar. Customization allows adding or removing icons, and choosing small medium or large icon size (medium is the default).
The Find/Replace tool bar, by default on the second row, replicates most commands of the Find/Replace dialog. The two are actively linked, and the Find/Replace bar is often a convenient way to quickly search for text or execute search/replace actions. The default layout consists of:
A column selection can be made with the mouse:
or with the keyboard:
A column selection can be dragged and dropped:
Use the Paste as Column command to insert text from the clipboard as a column. Use the Sort command to sort using a column selection. It is possible to restrict a find/replace operation to a column selection.
The left margin indicates where the cursor is:
Double clicking on the margin toggles line numbering. In binary and hexadecimal mode, the position of the first character is shown in hexadecimal. Right clicking in the margin sets or clears a marker.
A marker allows for fast navigation through a document. A marker is shown as a small blue rectangle in the margin of the line.
To set a marker:
To clear a marker:
To go to a marker:
Markers are not remembered between sessions.
OxMetrics has three viewing modes:
This is the default viewing mode for a text file. This mode allows editing of the text.
This is the viewing mode, most useful for binary file. OxMetrics checks whether a file is binary when loading it. If so, the viewing mode defaults to this binary mode. The position indicator on the status bar will show the position of the caret in decimal (the first character of the document is at byte 0).
In binary mode, there are no text lines. The screen lines are determined by the window width. Instead of lines in the margin, the position of the first character is shown in hexadecimal.
This is the alternative binary viewing mode. The display consists of two columns, with the text on the right, and the hexadecimal values on the left. The position indicator on the status bar will show the position of the caret in decimal (the first character of the document is at byte 0).
|weekly:||day that is closest to Wednesday|
|monthly:||day between 12th and 18th that is closest to Wednesday|
|quarterly:||day between 12th and 18th that is closest to Wednesday in middle month|
|4-weekly:||day closest to centre of each 4-week period|
|biannual:||day closest to Apr 1/Oct 1|
|annual:||day closest to July 1|
More information on Algebra syntax and other ways to execute Algebra code can be found here.
When you create a new variable through an assignment operation, it is immediately added to the database, and initialized to missing values. If necessary the database name will be truncated to 64 characters The database in focus can be switched from the drop-down box on the toolbar.
More information on Batch syntax and other ways to execute Batch code can be found here.
The aim is to build a valid algebra expression in the expression window (without the assignment and the terminating semi-colon). All successful transformations are logged in the Results window. The box at the top of the dialog shows the current expression.
Data transformation using the calculator can be written directly in the expression field at the top. Then pressing the = button asks for a destination name and runs the algebra code. The code is written to the results window.
The fields below the expression window can help to save typing:
More information on Algebra syntax and other ways to execute Algebra code can be found here.
Below that is the database summary (the same as can be printed to the Results window from the View menu). Remember that the dialog can be resized to view the full information.
This dialog can also be activated by double-clicking on the top left cell.
Changing the frequency and start date does not change the number of observations in the database: the end year (period) is automatically adjusted.
The data for the extended period(s) are set to missing value.
Note that text, legends, axes and individual symbols (lines, rectangles, etc.) can be selected with the mouse, and then deleted by pressing the delete key.
More detailed information of the various aspects can be found here.
If there is more than one area, some properties can be copied from the current area to all the other areas.
Note that the active database is listed in the title (as well as the active area if the plot is to be added to an area). The database can be changed from the drop-down box on the toolbar, or simply by activating another database.
Text entered immediately above the graph will have the title property, which means that it is moved with the area when the area is moved.
Mathematical and other formatting can be incorporated through LaTeX style commands.
Previously typed text can be revised by double clicking on it, an then selecting it in the properties editor; moved by grabbing with the mouse or deleted by clicking then pressing the Del key.
The following text properties can be changed after double clicking: actual text, type (floating, title, axis label), size, rotation, and location.
C style means that escape characters in the find or replace text are recognized, e.g. \n for a new line and \t for a tab.
The settings can be reset to the initial default, or saved as a batch file that can be run later.
Batch file (.fl)
OxMetrics data file (.in7/.bn7)
TSP WWW address