CATS: Batch Language

CATS is mostly menu-driven for ease of use. To add flexibility, certain functions can be accessed through entering commands. The syntax of these commands, which can be seen as little computer languages, is described below.

Algebra is described in the OxMetrics manuals. Algebra commands are executed in OxMetrics, via the Calculator, the Algebra editor, or as part of a batch run.

CATS batch language

Table:1.1 Batch language syntax summary

algebra { ...}
app("CATS")
break;
chdir("path");
database(year1, period1, year2, period2, frequency);
estimate("method"=OLS, year1=-1, period1=0, year2=-1, period2=0, forc=0, init=0);
exit;
I1Rank(r);
I2Rank(s);
Lags(Y, X=-1, DET=-1);
loadalgebra("filename");
loadbatch("filename");
loaddata("filename");
module("name");
print("text");
println("text");
option("option", argument);
output("option");
package("CATS", "package");
Restrict { ...}
savedata("filename");
saveresults("filename");
Seasonals(type=1);
store("name", "rename"="");
system { ...}
test("test", lag1=0, lag2=0);
testlinres { ...}
testgenres { ...}
testsummary;
Trend("mode"="");
usedata("databasename");

CATS allows models to be formulated, estimated and evaluated through batch commands. Such commands are entered in OxMetrics. Certain commands are intercepted by OxMetrics, such as those for loading and saving data, as well as blocks of algebra code. The remaining commands are then passed on to the active module, which is CATS in this case. This section gives an alphabetical list of the CATS batch language statements. There are two types of batch commands: function calls (with or without arguments) terminated by a semicolon, and commands, which are followed by statements between curly brackets.

Anything between /* and */ is considered comment. Note that this comment cannot be nested. Everything following // up to the end of the line is also comment.

OxMetrics allows you to save the current model as a batch file, and to rerun saved batch files. If a 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.

If an error occurs during processing, the batch run will be aborted and control returned to OxMetrics. A warning or out of memory message will have to be accepted by the user (press Enter), upon which the batch run will resume.

In the following list, function arguments are indicated by words, whereas the areas where statement blocks are expected are indicated by .... Examples follow the list of descriptions. For terms in double quotes, the desired term must be substituted and provided together with the quotes. A command summary is given in the table above. For completeness, this also contains the commands which are handled by OxMetrics. Consult the OxMetrics book for more information on those commands.

  app("CATS")

Starts CATS.

  I1Rank(r1);
  I2Rank(s1);

Sets the rank for an I(1) model, or the rank indices r,s for an I(2) model.

  Lags(Y, X=-1, DET=-1);

Sets the lag length of the endogenous variables in the VAR. Optionally sets the lag length for weakly exogenous and deterministic variables.

  Trend("mode"="");

Sets the model for constant and trend variables:

"" same as "CIDRIFT",
"NONE" none,
"CIMEAN" restricted constant,
"DRIFT" unrestricted constant,
"CIDRIFT" unrestricted constant, restricted trend.

 Seasonals(type);

Specifies the type of seasonal: 0=none, 1=centred, 2=uncentred.

 Restrict{...}

Specifies restrictions to impose on alpha and beta. It is easiest to generate the relevant restrictions using interactive estimation first.

 estimate("RRR"=OLS, year1=-1, period1=0, year2=-1, period2=0);

Estimate a cointegrating VAR by reduced rank regression. The presence of default arguments implies that the shortest version is just: estimate(), which estimates using the maximum possible sample. Similarly, a call to estimate("RRR", 1950, 1) corresponds to estimate("RRR", 1950, 1, -1, 0).

year1(period1) -- year2(period2) is the estimation sample. Setting year1 to -1 will result in the earliest possible year1(period1), setting year2 to -1 will result in the latest possible year2(period2).

 module("CATS");

Starts the CATS module (if CATS is not already running).

 package("CATS_UI");

 store("name", "rename"="");

Use this command to store residuals, etc. into the database, the default name is used. Note that if the variable already exists, it is overwritten without warning. The name must be one of: residuals, fitted, cointvec, cointvec_r, randraw.

The optional second argument replaces the default name. For example store("residuals") stores the residuals under the name Residual; store("residuals", "xyz") stores them under the name xyz.

 system {Y=...; X=...; U=...; }

Specify the system, consisting of the following components:

  • [Y] endogenous variables;

  • [X] weakly exogenous variables (restricted to the cointegrating space);

  • [U] short-run (unrestricted) variables.

The variables listed are separated by commas, their base names (that is, name excluding lag length) must be in the database. If the variable names are not a valid token, the name must be enclosed in double quotes.

 testsummary;

Do the test summary.

We finish with two examples. To run this file, we assume that OxMetrics is loaded with PPPuip.oxdata:

app("CATS");
usedata("PPPuip.oxdata");
system
{
    Y = dp1c, dp2, b1, b2, ppp;
    X = "C(1991:1)";
    U = Di7810, Di8110, Dp8007, Dp8602, Dp9707, DpTax;
}
Lags(2,2,1);
I1Rank(2);
Trend("CIMEAN");
Seasonals(1);
estimate("RRR", 1975, 9, 1998, 12);

app("CATS");
usedata("PPPuip.oxdata");
system
{
    Y = lp1c, lp2, ls12, b1, b2;
    X = "C(1991:1)";
    U = Di7810, Di8110, Dp8007, Dp8602, Dp9707, DpTax;
}
Lags(2);
I1Rank(2);
I2Rank(1);
Trend();
Seasonals(1);
estimate("RRR", 1975, 9, 1998, 12);