About STAMP In detail Order STAMP Documentation Examples Literature

External links

Timberlake UK Office Timberlake US Office OxMetrics SsfPack Econometric Links

STAMP Batch Language

STAMP is mostly menu-driven for ease of use. To add flexibility, certain functions can be accessed through entering commands. The syntax of these commands is described in this chapter. They can be added to the general list of Batch commands provided by OxMetrics.

STAMP 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 STAMP in this case. This section gives an alphabetical list of the STAMP 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.

Batch is activated in OxMetrics via Model/Batch or just by pressing Alt+b. The batch dialog appears with default code displayed. The code reflects the current model in STAMP.

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.


Starts the estimation process.

 forecast(nrfor, incr, option);

Prints nrfor ahead forecasts of dependent variables. When explanatory variables are included in the model, the incr value is the increment value for all exogenous variables. Otherwise, no value for incr should be given. When the data is in logs and the forecasts need to be anti-logged, the option variable must be set to "logs". Otherwise, no value is required for option. This function automatically creates a copy of the dependent variable in the database with its forecasts attached to it at the end of the estimation sample. When necessary, the sample of the database is extended. Furthermore it prints a forecasting report in the Results window.

 intervention(component, year, period);

The component argument specifies the type of intervention to be included in the model:

The year and period indicates the start of the intervention. When year and period refer to a non-existing date within the sample, the intervention will not enter the model.

 system {Y=...; X=...; } Formulate the model, consisting of the following components:

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

 store(type, variable, option);

Use this command to store prediction residuals, smoothed components and smoothed auxiliary residuals into the database, the default name is used.

The type must be one of: "residuals", "components", "auxresiduals".

When type is residuals, no variable and option need to be specified.

When type is "components", the variable can also be one of: "trend", "slope", "seasonal", "cycle", "ar", "irregular", "detrend", "seasadj" and "tvpar". The variable "cycle" refers to the sum of smoothed components associated with autoregressive and the three cycles. The variable "trend" is the same as the smoothed level and "tvpar" refers to the time-varying regression coefficients. When type is "components", the option variable can be one of: "pred" for predictive filtered estimate, "fil" for filtered estimate and "smo" the smoothed (default) estimate.

When type is "auxresiduals", no variable need to be specified. The variable must be one of: "irregular", "level", "slope". No option need to be specified.

 setcmp(cmp, order, variance, par1, par2);

Introduces an unobserved component in the model. The possibilities are:


This call is required to activate all specified unobserved components in the model. This call must always come after the last setcmp statement.


Prints the estimated final state and the estimated regression and intervention vector together with the corresponding test statistics. The output depends on the specified model.


Prints the estimation and diagnostic summary reports.

We finish with an annotated example using most commands. To run this file, we assume that OxMetrics is loaded with ENERGY.IN7, and that STAMP has been started.

// Batch code for UC( 1)
    Y = ofuELl;
setcmp("level", 1, 0.000327959, 0, 0);
setcmp("slope", 1, 1.27393e-006, 0, 0);
setcmp("seasonal", 4, 0.000120803, 0, 0);
setcmp("irregular", 0, 0.000244399, 0, 0);
intervention("outlier", 1968, 4);
intervention("outlier", 1974, 1);
estimate("ML", 1960, 1, 1986, 4);
store("components", "seasadj", "fil");

This Batch code produces the output:

 Very strong convergence relative to 1e-007
 - likelihood cvg 9.89599e-015
 - gradient cvg 7.35869e-008
 - parameter cvg 7.61594e-008
 - number of bad iterations 0
 Estimation process completed.

UC( 2) Estimation done by Maximum Likelihood (exact score)
	The database used is C:\Users\s.j.koopman\Documents\OxMetrics6\data\ENERGY.IN7
	The selection sample is: 1960(1) - 1986(4) (T = 108, N = 1)
	The dependent variable Y is: ofuELl
	The model is:  Y = Trend + Seasonal + Irregular + Interventions
	Steady state. found

Log-Likelihood is 295.641 (-2 LogL = -591.282).
Prediction error variance is 0.0024297

Summary statistics
 T                 108.00
 p                 3.0000
 std.error       0.049292
 Normality         17.120
 H(33)            0.72117
 DW                1.8406
 r(1)            0.061773
 q                 12.000
 r(q)          -0.0092300
 Q(q,q-p)          9.3476
 Rs^2             0.76665

 Variances of disturbances:
                    Value    (q-ratio)
Level         0.000327959  (    1.000)
Slope        1.27393e-006  ( 0.003884)
Seasonal      0.000120803  (   0.3683)
Irregular     0.000244399  (   0.7452)

State vector analysis at period 1986(4)
                             Value      Prob
Level                      6.35343 [0.00000]
Slope                      0.01126 [0.01921]
Seasonal chi2 test        50.24905 [0.00000]
Seasonal effects:
                Period       Value      Prob
                     1     0.16215 [0.00000]
                     2    -0.06904 [0.02530]
                     3    -0.13451 [0.00000]
                     4     0.04140 [0.10536]

Regression effects in final state at time 1986(4)

                Coefficient        RMSE     t-value      Prob
Outlier 1968(4)     0.11156     0.03657     3.05048 [0.00292]
Outlier 1974(1)    -0.23316     0.03657    -6.37579 [0.00000]

ofuELlForc [1960(1) - 1988(4)] saved to ENERGY.IN7
Standardised Residuals [1960(1) - 1986(4)] saved to ENERGY.IN7
ofuELlSeasAdj(Fil) [1960(1) - 1986(4)] saved to ENERGY.IN7

Forecasts with 68% confidence interval from period 1986(4) forwards:
          Forecast   stand.err   leftbound  rightbound
1          6.52684     0.05097     6.47587     6.57781
2          6.30690     0.05247     6.25443     6.35938
3          6.25270     0.05539     6.19730     6.30809
4          6.43987     0.05625     6.38363     6.49612
5          6.57188     0.07572     6.49616     6.64760
6          6.35195     0.07760     6.27435     6.42954
7          6.29774     0.08073     6.21701     6.37847
8          6.48492     0.08198     6.40294     6.56690