Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Johannes Pfeifer
dynare
Commits
1c0d1409
Unverified
Commit
1c0d1409
authored
Dec 07, 2020
by
Sébastien Villemot
Browse files
Fix the use of [static]/[dynamic] equations with the “block” option
parent
fdf5bfbb
Changes
3
Hide whitespace changes
Inline
Side-by-side
matlab/evaluate_steady_state.m
View file @
1c0d1409
...
...
@@ -309,7 +309,19 @@ if M.static_and_dynamic_models_differ
if
options
.
bytecode
[
r
,
~
]
=
bytecode
(
'dynamic'
,
'evaluate'
,
z
,
zx
,
params
,
ys
,
1
);
elseif
options
.
block
[
r
,
oo
.
dr
]
=
feval
([
M
.
fname
'.dynamic'
],
z
'
,
zx
,
params
,
ys
,
M
.
maximum_lag
+
1
,
oo
.
dr
);
T
=
NaN
(
M
.
block_structure
.
dyn_tmp_nbr
,
1
);
for
i
=
1
:
length
(
M
.
block_structure
.
block
)
[
rr
,
yy
,
T
,
g
]
=
feval
([
M
.
fname
'.dynamic'
],
i
,
...
dynvars_from_endo_simul
(
z
,
M
.
maximum_lag
+
1
,
M
),
...
zx
,
params
,
ys
,
T
,
M
.
maximum_lag
+
1
,
false
);
if
M
.
block_structure
.
block
(
i
)
.
Simulation_Type
==
1
||
...
% evaluateForward
M
.
block_structure
.
block
(
i
)
.
Simulation_Type
==
2
% evaluateBackward
vidx
=
M
.
block_structure
.
block
(
i
)
.
variable
;
rr
=
yy
(
M
.
lead_lag_incidence
(
M
.
maximum_endo_lag
+
1
,
vidx
))
-
oo
.
steady_state
(
vidx
);
end
idx
=
M
.
block_structure
.
block
(
i
)
.
equation
;
r
(
idx
)
=
rr
;
end
else
iyv
=
M
.
lead_lag_incidence
'
;
iyr0
=
find
(
iyv
(:));
...
...
tests/Makefile.am
View file @
1c0d1409
...
...
@@ -63,6 +63,7 @@ MODFILES = \
ramst.mod
\
ramst_a.mod
\
ramst_static_tag.mod
\
ramst_static_tag_block.mod
\
ramst_mshocks.mod
\
on-the-fly/ex1.mod
\
on-the-fly/ex2.mod
\
...
...
tests/ramst_static_tag_block.mod
0 → 100644
View file @
1c0d1409
// Test the [static]/[dynamic] tags, in the context of a block decomposed model
var c k;
varexo x;
parameters alph gam delt bet aa;
alph=0.5;
gam=0.5;
delt=0.02;
bet=0.05;
aa=0.5;
model(block);
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
[dynamic] c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
[static] k = ((delt+bet)/(x*aa*alph))^(1/(alph-1));
end;
initval;
x = 1;
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
c = aa*k^alph-delt*k;
end;
steady;
check;
shocks;
var x;
periods 1;
values 1.2;
end;
simul(periods=200);
rplot c;
rplot k;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment