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 applications. These applications 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 applications 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 are `dated', which allows for daily or timed observations. 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.
The OxMetrics suite of programs runs on the following platforms:
Installation is to \Program Files\OxMetrics9\ by default, but this can be changed in the installation program.
Installation is to /Applications/OxMetrics9/.
Installation is to /usr/share/OxMetrics9/.
A separate installation document describes the supported platforms in more detail, and shows how to install the software.
OxMetrics 9 operates independently from OxMetrics 8 and previous versions.
The OxMetrics folder structure is as follows:
OxMetrics9/
oxmetrics.exe OxMetrics executable
oxedit.exe OxEdit executable
algebra/ Algebra files
apps/ OxMetrics application runtime files
batch/ Batch files
data/ Data files
doc/ Help system
ox/ Root of Ox installation: Ox executable files
doc/ help files for Ox
include/ Ox header files for Ox code
lib/ Ox additional code library
packages/ Ox packages
samples/ Ox sample code
...
OxEdit_resources/ Additional resources for OxEdit
OxMetrics_resources/ Additional resources for OxMetrics
This documentation refers to OxMetrics 9. OxMetrics 8 users will find much that is familar. There are a number of small fixes in this version, which are documented in the online help.
The most important new features are:
system
{
Y = "log(LY)" 0:3;
Z = Constant, "log(X)" 1:2 4:5 3, LC 0:5;
}
For availability contact Timberlake Consultants: www.timberlake-consultancy.com or www.timberlake.co.uk.
Consult www.doornik.com or www.oxmetrics.info 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 application used to generate the results should be cited in all reports and publications involving its application.
In addition to this document, OxMetrics incorporates a cross-referenced help system based on HTML files, These will open in your default browser. OxMetrics help is available from the Help menu or the Help pane in the workspace. The Help pane lists the contents of all the applications 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.
Several applications interact with OxMetrics. In that case, the OxMetrics front-end is the `server', while the applications (G@RCH, PcGive, STAMP, etc.) are the `clients'. The communication is implemented via a local socket.
While it is possible to write clients that interface directly with the server (such as 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 Arfima, 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 applications 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 application provides an interactive front-end to several Ox packages.
A licensing code is required for the OxMetrics 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.
Without code, OxMetrics will enter evaluation mode, allowing use for a short period.
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 applications.
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 ??.
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 ??.
The primary mode of data storage is a file with extension .oxdata. This is a zip file that contains two files. If you rename data.oxdata to data.oxdata.zip, you can see that it contains data.in7 and data.bn7. The latter is a binary file containing the actual data, whereas the former holds the information on the contents of the binary file.
The .bn7/.in7 pairing is still supported, but the oxdata format is more convenient, because it always keeps both together (while taking less space).
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 (.csv) 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 data file might be m1ukq.oxdata, the OxMetrics Results window storage file could be m1ukq.out, the algebra storage file m1ukq.alg, and batch files m1ukq.fl. Graphs can be saved in many formats, including PDF (.pdf), Windows metafiles (.wmf), enhanced metafiles (.emf), Scalable Vector Graphics (.svg). The OxMetrics graphics file (.gwg, for GiveWin graphics) is always saved alongside the other format, and this is the file that is reloaded 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.
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-01-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.
There is no facility to handle time zones.
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), macOS/Linux (\n).
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:
Code, instructions that need to be type, and file names are displayed in Typewriter font. Commands on menus, toolbar buttons, and dialog items (buttons, checkboxes etc.) are shown in the text in a Sans Serif font.
Equations are numbered as (chapter.number); for example, (8.1) refers to equation 8.1, which is the first equation in Chapter 8.
Multiple graphs are numbered from left to right and top to bottom, so b is the top-right graph of four, and c the bottom left.
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.