EQUATION Instruction |
EQUATION( options ) equation depvar ARlags MAlags
# list of explanatory variables (in regression format)
EQUATION is the general instruction for setting the form of a (linear) equation, which is represented in RATS as the EQUATION data type. For each equation, it specifies the dependent variable, the list of explanatory variables, and whether or not the equation is an identity. You can also provide the coefficients if they are known already (such as for an identity).
Wizard
You can use the Statistics>Equation/FRML Wizard to define equations.
Description
EQUATION takes slightly different forms for ARMA (autoregressive–moving average) equations compared with standard regression relationships.
•For standard equations, you supply only the equation and depvar parameters. The explanatory variable are listed on the supplementary card.
•For ARMA equations, you use the AR option (or ARlags) and MA option (or MAlags) in addition to equation and depvar.
Parameters
|
equation |
equation name or number |
|
depvar |
dependent variable |
|
ARlags |
(Optional) AR parameters. If you supply some number N, the equation will include AR terms for all lags 1 to N. To select specific lags, use the in-line matrix notation. For example, ||1,4|| to include terms for lags 1 and 4 only.
The AR and MA options are the preferred way to input ARMA lag information. |
|
MAlags |
(Optional) MA parameters. Entered as described for the AR parameters. |
Supplementary Card
|
Standard form |
You need one supplementary card listing the explanatory variables in regression format. Omit it if you use the LASTREG or EMPTY options. |
|
ARMA models |
You only need a supplementary card if you use the REGRESSORS option to include extra variables besides the arma parameters and the automatic CONSTANT. |
Options
IDENTITY/[NOIDENTITY]
This declares the EQUATION as an identity. This information is needed for some of the forecasting instructions.
LASTREG/[NOLASTREG]
LASTREG defines the equation using the variables and estimated coefficients from the most recent regression. Omit the supplementary card if you use this option.
AR=list of autogressive lags [not used]
MA=list of moving average lags [not used]
You can use these as a (more readable) alternative to the ARlags and MAlags parameters for specifying an ARMA equation. As with the parameters, for N consecutive lags (all lags from 1 through N), use the format AR=N or MA=N. For non-consecutive lags, use ||list of lags|| or a VECTOR[INTEGER].
CONSTANT/NOCONSTANT (default depends upon model type)
For an ARMA equation, EQUATION includes the CONSTANT series among the explanatory variables in the equation unless you use NOCONSTANT. For non-ARMA models, NOCONSTANT is the default—if a constant term is needed, it is usually supplied using CONSTANT on the supplementary card along with the other explanatory variables.
REGRESSORS/[NOREGRESSORS]
You can use this option with ARMA models when you want to include variables in addition to the CONSTANT and the ARMA parts. Models like this are sometimes called ARMAX models (ARMA with eXtra variables). List the additional regressors (in regression format) on a supplementary card. (This option was called MORE in RATS v6 and earlier).
FRML=FRML to associate with the equation [not used]
This associates a FRML (formula) with the equation. Whenever the equation is estimated, the FRML will be updated as well.
COEFFS=VECTOR of coefficients [not used]
You can use the COEFFS option to put the coefficients in as you are defining the equation. This would typically be done if you are defining an identity. You can use a VECTOR or ||coefficients separated by commas|| for this.
VARIANCE=residual variance [not used]
Residual variance for this equation. You only need to supply this if you are going to use SIMULATE, IMPULSE or ERRORS. It is usually set when the equation is estimated.
EMPTY/[NOEMPTY]
Use the EMPTY option to create an equation which has only a dependent variable, with no right-hand-side terms. This can be useful if you need to apply shocks to an “exogenous” variable in an impulse response analysis.
ENTRIES=number of supplementary card entries to process[all]
This allows you to control how many of the elements on the supplementary card are processed. This can be useful in certain programming situations. See ENTRIES option.
Standard Form Examples
equation wageeq privwage
# constant prdction{0 1} trend
equation(identity,coeffs=||1.0,1.0,1.0||) prdcteq prdction
# consmptn invest govtexp
This sets up two of the equations for Klein’s model I. The second one is the identity Y=C+I+G.
linreg m1gr 1962:1 *
# constant dintlag inflag surplag m1lag
*
equation(lastreg) mdeq
defines MDEQ based upon the regression, copying M1GR as the dependent variable, the five explanatory variables, coefficients, variance and residuals.
equation(coeffs=||1.0,-1.0||) covery
# c y
This has no dependent variable. It defines the equation COVERY as 0 = 1 x c(t) - 1 x y(t). This type of equation can be used as part of a cointegration model.
equation jpneq xjpn
# constant hhs(1,1) hhs(1,2) hhs(1,3)
This defines equation JPNEQ with XJPN as the dependent variable and four explanatory variables.
Examples of ARMA Equations
The RATS forecasting instructions cannot handle directly equations with the multiplicative structure permitted by the BOXJENK instruction. They require equations with the simpler parametric form:
\(\Phi (L)\,{y_t} = \alpha + \Psi (L)\,{x_t} + \Theta (L)\,{u_t}\)
where \(\Phi\), \(\Psi\) and \(\Theta\) are simple polynomials in the lag operator \(L\). The DEFINE option on BOXJENK generates such equations by multiplying through by all polynomials which appear in the denominators of the estimated form and expanding all products.
If you want to generate a series which follows a particular ARMA structure, you can write the equation in the form above and input the equation with EQUATION:
equation(noconst,ma=4,coeffs=||-.6,+.3,-.5,+.5||) arma y
defines ARMA with Y as the dependent variable with the MA(4) process
\({y_t} = {\varepsilon _t} - .6{\varepsilon _{t - 1}} + .3{\varepsilon _{t - 2}} - .5{\varepsilon _{t - 3}} + .5{\varepsilon _{t - 4}}\)
equation(ar=||1,4||,ma=||4||) yeq y
defines an ARMA(2,1) model with AR lags 1 and 4 and MA lag 4.
Copyright © 2026 Thomas A. Doan