model

model — declares the model equations

Synopsis

model [(OPTION [, OPTION...])] ;
[ MODEL_EXPRESSION = MODEL_EXPRESSION ; | MODEL_EXPRESSION ; | # VARIABLE_NAME = MODEL_EXPRESSION ; ] ...

end ;

Description

The equations of the model are written in a block delimited by model and end keywords.

There must be as many equations as there are endogenous variables in the model, except when computing the unconstrained optimal policy with ramsey_policy.

The syntax of equations must follow the conventions for MODEL_EXPRESSION as described in Section 2, “Expressions”. Each equation must be terminated by a semicolon (;).

When the equations are written in homogenous form, it is possible to omit the =0 part and write only the left hand side of the equation.

Inside the model block, Dynare allows the creation of model-local variables, which constitute a simple way to share a common expression between several equations. The syntax consists of a pound sign (#) followed by the name of the new model local variable (which must not be declared as in Section 1, “Variable declarations”), an equal sign, and the expression for which this new variable will stand. Later on, every time this variable appears in the model, Dynare will substitute it by the expression assigned to the variable. Note that the scope of this variable is restricted to the model block; it cannot be used outside.

Options

linear

Declares the model as being linear. It spares oneself from having to declare initial values for computing the steady state, and it sets automatically order=1 in stoch_simul.

use_dll

Instructs the preprocessor to create dynamic loadable libraries (DLL) containing the model equations and derivatives, instead of writing those in M-files. You need to having a working compilation environment (i.e. the mex command of Matlab® or Octave must be operational). Using this option can result in faster simulations or estimations, at the expense of some initial compilation time.[3]

Examples

Example 1: elementary RBC model

var c k;
varexo x;
parameters aa alph bet delt gam;

model;
c =  - k + aa*x*k(-1)^alph + (1-delt)*k(-1);
c^(-gam) = (aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam)/(1+bet);
end;

Example 2: use of model local variables

The following program:
model;
# gamma = 1 - 1/sigma;
u1 = c1^gamma/gamma;
u2 = c2^gamma/gamma;
end;
...is formally equivalent to:
model;
u1 = c1^(1-1/sigma)/(1-1/sigma);
u2 = c2^(1-1/sigma)/(1-1/sigma);
end;

Example 3: a linear model

model(linear);
x = a*x(-1)+b*y(+1)+e_x;
y = d*y(-1)+e_y;
end;


[3] In particular, for big models, the compilation step can be very time-consuming, and use of this option may be counter-productive in those cases.