ASSOCIATE Instruction |
ASSOCIATE( options ) equation coeffVECTOR
# coefficients for equation (omit with coeffVECTOR parameter or BINARY or FREE options).
ASSOCIATE sets the coefficients (and possibly other aspects) of an EQUATION. It's an older instruction, and in most cases, you should prefer to use the functions %EQNSETCOEFFS, %EQNSETVARIANCE, or %MODELSETCOEFFS, or the COEFFS option on EQUATION.
Description
When you estimate an EQUATION within RATS, the estimating instruction automatically sets the coefficients, residual variance and typically the residual series. So, you usually only need ASSOCIATE if you wish to alter what is stored, or to assign coefficients to equations (such as identity equations) that have not been estimated within your RATS program. ASSOCIATE provides three ways to set the coefficients of an equation:
1.It can read the coefficients from supplementary cards (the default method).
2.It can copy them from a VECTOR by using the coeffVECTOR parameter.
3.It can read them from a file (using the options BINARY or FREE)
This is rarely used in any modern programs, but you may come across it in code written from RATS version 4 or earlier. If you need to set or reset the coefficients of a Vector Autoregression (such as when doing Monte Carlo integration and similar types of simulations), use the functions %MODELGETCOEFFS and %MODELSETCOEFFS.
Similarly, the functions %EQNSETCOEFFS and %EQNSETVARIANCE provide alternative methods of setting the coefficient values and variance of an individual equation.
Parameters
equation |
equation name or number |
coeffVECTOR |
VECTOR for coefficients (Unused: By default, coefficients are supplied on a supplementary card or (using BINARY or FREE options) from a file |
Options
RESIDUALS=series of residuals for the equation [unused]
Series holding the residuals for this equation. You only need this information if you want to use FORECAST, STEPS, SIMULATE or THEIL with an ARMA equation, or the HISTORY instruction with any equation. The residuals are usually saved when the equation is estimated.
VARIANCE=residual variance for the equation [unused]
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.
FRML=FRML to associate with the equation
Use the FRML option to associate a FRML with the equation. Whenever the equation is estimated, the FRML will be updated as well. This has the same effect as using a FRML option on an EQUATION instruction.
PERM/[NOPERM]
You can only use the PERM option if you are also using coeffVECTOR parameter. PERM makes the association with the specified VECTOR permanent—if you change the values of the VECTOR, you change the coefficients.
[COEFFS]/NOCOEFFS
Use NOCOEFFS when you want to use RESIDUALS, VARIANCE or FRML, but you do not want to change the coefficients of equation. Omit the supplementary card if you use NOCOEFFS.
BINARY/[NOBINARY]
FREE/[NOFREE]
UNIT=[DATA]/INPUT/other unit
These options let you read the coefficients from a file rather than from a supplementary card. With FREE, the coefficients are read free-format (tab, blank, or comma-delimited text file) and with BINARY, they are read as binary data. In either case, omit the supplementary card.
Examples
There are several ways to input the relationship
\({y_t} = 5.0 + 1.3{y_{t - 1}} - 0.4{y_{t - 2}} + {u_t};Var\left( {{u_t}} \right) = 0.01\)
This one creates an EQUATION named YEQ:
equation yeq y
# constant y{1 2}
associate(variance=.01) yeq
# 5.0 1.3 -.4
This could also have been done by adding options to the EQUATION instruction:
equation(coeffs=||5.0,1.3,-.4||,variance=.01) yeq y
# constant y{1 2}
You can also directly create a FRML:
frml(variance=1.0) yfrml y = 5.0+1.3*y{1}-.4*y{2}
This defines an equation, then takes the residuals and coefficients from the previous regression (estimated differently) and uses that to do in-sample one-step (static) forecasts of the model.
equation(ar=2,ma=1,const) armaeq spread
associate(resids=%resids) armaeq %xsubvec(%beta,1,4)
uforecast(static,equation=armaeq) onestep %regstart() %regend()
This defines an equation, then associates (permanently) the vector B with it. This means that when B changes (using matrix calculations), the coefficients for the equation change automatically.
equation kalmeq gdph
# constant gdph{1 to 4} fm1{1 to 4}
declare vector b(9) bmean(9)
ewise bmean(i)=(i==2)
associate(perm) kalmeq b
Copyright © 2025 Thomas A. Doan