MODEL Data Type |
A MODEL is a collection of FRMLs, EQUATIONs and related information, used to organize information for systems estimation, simulation and solution. The main uses of MODELS are:
•Specifying a VAR for estimation, forecasting and analysis
•Creating and maintaining a simultaneous equations model for forecasting and analysis
•Creating a Dynamic Simultaneous General Equilibrium (DSGE) model for solution into an (approximate) state-space form.
Different uses require different combinations of components. For instance, VAR's are all linear, and thus all EQUATIONs, while DSGE models are all FRMLs. Simultaneous equations models can be a mix. Although a FRML could in fact be "linear", we will refer to them as non-linear in the discussion below as their information is kept in quite a different form that EQUATIONs.
Creation
Two instructions can create a MODEL: SYSTEM and its subcommands create a set of linear equations of similar form (typically a VAR), while GROUP pulls together a set of (previously) defined EQUATIONS and FRMLS to create a MODEL.
Estimation
A MODEL as a whole can be estimated by ESTIMATE (if it's all linear), SUR (if it's all linear), GARCH (if it's all linear), or NLSYSTEM (if it's all non-linear). These estimate the model and set the coefficients for the underlying EQUATIONS, or (for NLSYSTEM) the members of the PARMSET that is estimated, and thus the FRMLs that go into it.
The individual components of a MODEL (the EQUATIONs or FRMLs) are often estimated separately by other instructions.
Use (Structure Only)
The instructions CMOM, MCOV and SWEEP can use the information in a (linear) MODEL as their input for the variables in their calculation. A MODEL can be input to INQUIRE to determine the defined range of all the series and their lags that are used in the MODEL.
Use (Fully Estimated)
The instructions FORECAST, SIMULATE, STEPS, THEIL, IMPULSE, ERRORS and HISTORY do various forecasting and simulation exercises on MODELS and require that either the MODEL as a whole, or all its components be estimated. (You'll get an error message if any part isn't). Because they rely on linearity, IMPULSE, ERRORS and HISTORY all require fully linear models. The first four can be any mix of linear and non-linear.
For DSGE, the FRMLs that make up the MODEL are generally not actually estimated, but need to be have any parameters used within them set to appropriate values, as it's necessary to expand the model around a calculated steady-state.
Arithmetic Operators
MODELS can be combined using the “+” operator.
Functions
MODELS have the following "getters":
%MODELSIZE(model) |
Size (number of equations/formulas) (INTEGER) |
%MODELDEPVARS(model) |
List of Dependent Variables (VECT[INTEGER]) |
%MODELGETCOEFFS(model) |
Matrix of Coefficients (RECT) |
%MODELGETVCV(model) |
Covariance Matrix (SYMMETRIC) |
%MODELEQN(model,n) |
Extracts nth EQUATION from (linear) MODEL (EQUATION) |
%MODELLABEL(model,n) |
Label of the dependent variable for the nth EQUATION (LABEL) |
%MODELFIND(model,series) |
Locates in the model the equation with dependent variable series, returning the position if found or 0 otherwise (INTEGER) |
There are several other specialized retrieval functions. These work only for fully linear models and are designed mainly for use with VARs.
%MODELLAGMATRIX(model,k) |
N x N Matrix of Lag k of the Dependent Variables (RECT) |
%MODELCOMPANION(model) |
Matrix A in X(t)=AX(t-1)+U(t) representation (RECT) |
%MODELLARGESTROOT(model) |
Absolute Value of Largest Root of Companion Matrix of Model (REAL) |
%MODELLAGSUMS(model) |
N x N Matrix of Lag Sums in (I-A(L))X=U(t) representation (RECT) |
%MODELSUBSTECT(model) |
MODEL with Error Correction Terms Substitute Out (MODEL) |
MODELS have the following "setters":
%MODELSETCOEFFS(model,coeffs) |
Set Matrix of Coefficients |
%MODELSETVCV(model,cv) |
Sets Covariance Matrix |
%MODELPOKE(model,n,eqn) |
Replaces the equation at slot n in the model |
Copyright © 2025 Thomas A. Doan