Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
15a769f2
Commit
15a769f2
authored
8 years ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Added comments to the example mod file.
Also moved some variable/parameter declarations.
parent
4fa41bf9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/example1_model_block_declared_vars.mod
+53
-19
53 additions, 19 deletions
tests/example1_model_block_declared_vars.mod
with
53 additions
and
19 deletions
tests/example1_model_block_declared_vars.mod
+
53
−
19
View file @
15a769f2
// Example 1 from Collard's guide to Dynare
var c, a, h, b;
verbatim;
% I want these comments included in
% example1.m 1999q1 1999y
%
var = 1;
end;
// Declaration of some endogenous variables.
var c;
/*
** REMARKS
**
** Some declarations for the endogenous variables are missing. They are declared below in
** the model block.
**
*/
// Declaration of some of the parameters.
parameters beta, rho, theta, psi, tau;
rho = 0.95;
...
...
@@ -15,19 +17,51 @@ tau = 0.025;
beta = 0.99;
psi = 0;
theta = 2.95;
phi = 0.1;
/*
** REMARKS
**
** Same remark, some parameters are defined in the below in the model block (alpha and delta). These
** variables must be calibrated after the model block (ie after the calibration).
**
** We do not declare the exogenous variables in the preamble. The innovations are decalred in the model
** block below.
**
*/
model;
c*theta*h^(1+psi)=(1-alpha)*y;
k
|e
= beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
c*theta*h
|e
^(1+psi)=(1-alpha)*y;
k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
*(exp(b(+1))*alpha|p*y(+1)+(1-delta)*k));
y|e = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
k = exp(b)*(y-c)+(1-delta|p)*k(-1);
a = rho*a(-1)
+tau*b(-1)
+ e|x;
b =
tau*a(-1)+
rho*b(-1) + u|x;
k
|e
= exp(b)*(y-c)+(1-delta|p)*k(-1);
a
|e
= rho*a(-1) + e|x;
b
|e
= rho*b(-1) + u|x;
end;
/*
** REMARKS
**
** On the fly declaration works as follows:
**
** - A symbol followed by |e implicitely declares an endogenous variable.
** - A symbol followed by |x implicitely declares an exogenous variable.
** - A symbol followed by |p implicitely declares a parameter.
**
** A parameter declared on the fly has to be calibrated after its declaration, ie after the model
** block. If the user tries to give a value to a parameter before its declaration, then Dynare
** interpret the calibration as a matlab statement, because Dynare doesn't know that the symbol is
** a parameter.
**
** By default an undeclared symbol is interpreted as an exogenous variable. Consequently, if the user
** removes an equation where an endogenous variable is declared, the status of the variable changes.
** For instance, if one comments the last equation, the law of motion of b, symbol b becomes an
** exogenous variable (whose value is zero by default). A more interesting use case, is to remove
** the first equation, the arbitrage condition between leisure and consumption. Labour supply is
** then supposed to be exogenous.
*/
alpha = 0.36;
delta = 0.025;
...
...
@@ -43,9 +77,9 @@ u = 0;
end;
shocks;
var e; stderr 0.009;
var u; stderr 0.009;
var e, u = phi*0.009*0.009;
var e; stderr 0.009;
var u; stderr 0.009;
var e, u = phi*0.009*0.009;
end;
stoch_simul;
stoch_simul
(order=1)
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment