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
4f6344e6
Verified
Commit
4f6344e6
authored
11 months ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Allow model-local variables with leads or lags
Closes:
#1929
parent
ba2cc7ad
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#10580
passed
11 months ago
Stage: build
Stage: test
Stage: pkg
Stage: sign
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/manual/source/the-model-file.rst
+4
-1
4 additions, 1 deletion
doc/manual/source/the-model-file.rst
preprocessor
+1
-1
1 addition, 1 deletion
preprocessor
tests/preprocessor_checks/example1_mlv.mod
+7
-4
7 additions, 4 deletions
tests/preprocessor_checks/example1_mlv.mod
with
12 additions
and
6 deletions
doc/manual/source/the-model-file.rst
+
4
−
1
View file @
4f6344e6
...
...
@@ -962,7 +962,10 @@ The model is declared inside a ``model`` block:
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
variable (if the model-local variable appears with a lead or a lag
attached to it between parenthesis, the substitution will be done by
shifting the expression accordingly).
Note that the scope of this variable is restricted to
the model block; it cannot be used outside. To assign a LaTeX name
to the model local variable, use the declaration syntax outlined
by :comm:`model_local_variable`. A model local variable declaration
...
...
This diff is collapsed.
Click to expand it.
preprocessor
@
84d792bc
Compare
31080eed
...
84d792bc
Subproject commit
31080eed6ce6c623863850d4e2da5f8317f2b5d
0
Subproject commit
84d792bced340c52d90cd962e51e22eec605cea
0
This diff is collapsed.
Click to expand it.
tests/preprocessor_checks/example1_mlv.mod
+
7
−
4
View file @
4f6344e6
// Tests for model local variables
// (including in params derivs file, i.e. with identification, see Dynare/preprocessor#13)
/* Tests for model-local variables
(including in params derivs file, i.e. with identification, see Dynare/preprocessor#13)
Also tests the possibility of having a lead/lag on a model-local variable
(recursively in the definition of another such variable) (see #1929)
*/
var c, y, k, a, h, b;
varexo e, u;
...
...
@@ -22,8 +25,8 @@ phi = 0.1;
model_local_variable foo $\text{foo}$;
model;
#bar = exp(b
)*c
;
#foo = bar/(exp(b(+1))*c(+1));
#bar = exp(b
(+1))*c(+1)
;
#foo = bar
(-1)
/(exp(b(+1))*c(+1));
c*theta*h^(1+psi)=(1-alpha)*y;
k = beta*(foo
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
...
...
This diff is collapsed.
Click to expand it.
Marco Ratto
@rattoma
mentioned in merge request
!2305 (merged)
·
8 months ago
mentioned in merge request
!2305 (merged)
mentioned in merge request !2305
Toggle commit list
Stéphane Adjemian
@stepan-a
mentioned in commit
83b335e4
·
8 months ago
mentioned in commit
83b335e4
mentioned in commit 83b335e48d18f27947dc96d854136ed20058b6e6
Toggle commit list
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