FORM

Options     Examples

FORM makes a TSP equation (FRML) from the results of a linear estimation procedure or from a list of names (such as regression variables). The FRML can then be used in an estimation or simulation model; it can have either names or constants as its coefficients. The NAR option makes it easy to estimate linear regression equations with AR(p) errors -- just use the resulting FRML in LSQ for direct nonlinear estimation.

FORM (COEFPR=<coefficient prefix>, NAR=<number of AR terms>, PARAM, PRINT,

              RESIDUAL, RHOPREF=<rho prefix>, SUM, VALUE, VARPR=<coefficient prefix>)

             <equation name>  [<list of names>] ;

or

FORM (VALUE) <list of equation names>;

Usage

The first argument to FORM is required; it is the name you wish to give to the equation. If there is only one argument, FORM must follow the linear estimation command (OLSQ, INST, LIML, VAR, or AR1) which created the results you wish to save as an equation. In this case, the equation created by FORM is the same equation that would be used by FORCST to generate a single equation forecast. If you GENRed this equation, you would obtain a static forecast just as if you had run the FORCST procedure (but with a slight loss of precision). The variable names are retrieved from @RNMS and @LHV, while the coefficient values are taken from @COEF and @RHO.

If there are three or more arguments, FORM does not look for a previous estimation; instead it creates a new equation. In this case, the variable names are the remaining arguments and the coefficient names are constructed mechanically (zero starting values are used). Note: having exactly two arguments is invalid, because it implies a dependent variable but no right hand side.

The output equation can be used for estimation or for simulation, or in any application which can use equations (such as ANALYZ, DIFFER, EQSUB, etc.). The PARAM option is used for estimation; in this case, parameter names are inserted into the FRML and values are also stored under these names (as if a PARAM statement had been issued). These names are normally created by appending 0, 1, 2, etc. to a coefficient prefix such as B. If there is a constant term (C), the number start with 0; otherwise they start with 1. PARAM names can also be created from the original variable names, using the VARPREF option. In either case, the PARAM names are stored in the list @RNMSF, which can be used in commands like UNMAKE to fill them with new starting values.

For simulation, use the FORM command after you estimate a linear equation; constant values are inserted into the FRML. FRMLs with parameter names can also be used for simulation; using constant values is just slightly more compact and it also prevents the values from being changed inadvertently.

Output

Normally FORM produces no printed output. If the PRINT option is on, the options and the output equation are printed. A TSP equation is stored in data storage under the name supplied by the user. If the PARAM option is on, scalar PARAMeters will be stored, and a list of the parameter names is stored under @RNMSF.

Options

COEFPR= a prefix for the coefficient names. The default is B plus the equation name. Specify this carefully to avoid overwriting existing variables. For example, avoid creating A0-A11 and then A11-A13.

NAR= number of autocorrelation terms. The default is zero unless the previous estimation was AR1.

PARAM/NOPARAM specifies whether the coefficients will be names or constant values. PARAM is the default if there are three or more arguments, or if COEFPREF or VARPREF have been specified.

PRINT/NOPRINT specifies whether the options and output equation will be printed.

RESIDUAL/NORESIDUAL specifies whether the FRML should be unnormalized (have no dependent variable).

RHOPREF= a prefix for the autocorrelation coefficient names. The default is RHO plus the equation name, if NAR=1. Otherwise it is PHI, plus the equation name, plus the order of the autoregressive lag.

SUM/NOSUM specifies that the equation is to be formed as a sum of terms specified in a list. This is useful when constructing a log likelihood for ML, when you do not know how many terms you will need. See the examples below.

VALUE/NOVALUE is used to fix the values of any PARAMs in a list of existing FRMLs. Then they can be printed to show the values with the other variables, or stored in a databank for later use with SIML or SOLVE (without having to worry about storing the associated PARAMs). VALUE is the default if there is only one argument, or if there are several arguments, and they are all existing FRMLs. This option was formerly called CONST.

VARPR= a prefix for the coefficient names, to be used in conjunction with the variable names. The default is to use a COEFPREF instead. Special coefficient names are used for C (intercept), lags, and leads. 0 (zero) is used in place of C, positive numbers are appended for lags, and L plus positive numbers are appended for leads.

Examples

  1. This example causes an equation named CONSEQ to be printed and stored.

OLSQ CONS C GNP GNP(-1) ;

FORM (PRINT) CONSEQ ;

prints

FRML CONSEQ CONS = ((123.0) + 0.9*GNP)+ 0.05*GNP(-1)

(assuming that the coefficient estimates from the OLSQ were (123., .9, .05).)

  1. This example saves the same equation as in example 1 with names instead of values.

OLSQ CONS C GNP GNP(-1) ;

FORM (COEFPREF=B) CONSEQ ;

is equivalent to the following commands:

FRML CONSEQ CONS = B0 + B1*GNP + B2*GNP(-1);

PARAM B0 123 B1 .9 B2 .05 ;

LIST @RNMSF B0-B2 ;

  1. This example uses a VARPREF instead of a COEFPREF.

OLSQ CONS C GNP GNP(-1) ;

FORM (VARPREF=B) CONSEQ ;

is equivalent to the following commands:

FRML CONSEQ CONS = B0 + BGNP*GNP + BGNP1*GNP(-1);

PARAM B0 123 BGNP .9 BGNP1 .05 ;

LIST @RNMSF B0 BGNP BGNP1 ;

  1. Same as example 3, but the RESID option is used to make the equation unnormalized. This is a form which is most useful for use with the ML command, but could also be used with commands like LSQ, GMM, or FIML.

OLSQ CONS C GNP GNP(-1) ;

FORM (VARPREF=B,RESID) EC;

is equivalent to the following commands:

FRML EC CONS - ( B0 + BGNP*GNP + BGNP1*GNP(-1) );

LIST @RNMSF B0 BGNP BGNP ;

PARAM @RNMSF;

UNMAKE @COEF @RNMSF;

  1. This example creates a similar equation and estimates it with LSQ.

FORM CE CONS C GNP GNP(-1); LSQ CE;

is equivalent to: (Note the default coefficient names based on the equation name.)

FRML CE CONS = BCE0 + BCE1*GNP + BCE2*GNP(-1);

PARAM BCE0-BCE2; LSQ CE;

  1. This example illustrates including the lagged residual term from AR1.

AR1 IMPT C GNP RELP ;

FORM (PARAM) IE;

creates the equation

FRML IE IMPT = IE0 + IE1*GNP + IE2*RELP

                            + RHOIE*(IMPT(-1) - IE0 - IE1*GNP(-1) - IE2*GNP(-2));

PARAM IE0 -251.8369 IE1 2.7984 IE2 .2636 RHOIE .8328 ;

  1. In this example, we estimate the same equation as in example 6, except with AR(4) errors. This FRML could also be used in a system of equations with LSQ or FIML.

FORM (NAR=4) IE IMPT C GNP RELP;

LSQ IE;

  1. FORM can be used after a VAR estimation:

VAR Y1 Y2 | C T ;

FORM (VARPR=H) EQ1 EQ2 ;

creates

FRML EQ1 Y1 = HY1_0 + HY1_T*T ;

FRML EQ2 Y2 = HY2_0 + HY2_T*T ;

where the HY1_0, HY1_T, HY2_0, HY2_T parameters are created and set to estimated values from the VAR.

  1. Example of the SUM option:

FORM (SUM) EQ S X1-X3 ;

creates

FRML EQ S X1+X2+X3 ;