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
7d0f8aa1
Commit
7d0f8aa1
authored
4 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Plain Diff
Merge branch 'exogenouslag' into 'master'
Exogenouslag See merge request
!1759
parents
9b946ca0
0391dbbe
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1759
Exogenouslag
Pipeline
#4139
passed
4 years ago
Stage: build
Stage: test_and_pkg
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/perfect-foresight-models/sim1_linear.m
+14
-3
14 additions, 3 deletions
matlab/perfect-foresight-models/sim1_linear.m
matlab/perfect-foresight-models/sim1_purely_backward.m
+2
-2
2 additions, 2 deletions
matlab/perfect-foresight-models/sim1_purely_backward.m
with
16 additions
and
5 deletions
matlab/perfect-foresight-models/sim1_linear.m
+
14
−
3
View file @
7d0f8aa1
...
...
@@ -120,9 +120,13 @@ if max(abs(d1))>options.solve_tolf
error
(
'Jacobian is not evaluated at the steady state!'
)
end
% current variables
[
r0
,
c0
,
v0
]
=
find
(
jacobian
(:,
jc
));
% current and predetermined
[
rT
,
cT
,
vT
]
=
find
(
jacobian
(:,
jpc
));
% current and jump variables
[
r1
,
c1
,
v1
]
=
find
(
jacobian
(:,
jcn
));
% all endogenous variables
[
rr
,
cc
,
vv
]
=
find
(
jacobian
(:,
jendo
));
iv0
=
1
:
length
(
v0
);
...
...
@@ -155,9 +159,16 @@ for it = (maximum_lag+1):(maximum_lag+periods)
nv
=
length
(
vv
);
iA
(
iv
+
m
,:)
=
[
i_rows
(
rr
),
i_cols_A
(
cc
),
vv
];
end
z
(
jendo
)
=
Y
(
i_cols
);
z
(
jexog
)
=
transpose
(
exogenousvariables
(
it
,:));
res
(
i_rows
)
=
jacobian
*
z
;
if
M
.
maximum_exo_lag
>
0
% needed as jacobian for lagged exogenous variables is wrong
% in current version of Dynare
zz
=
Y
(
i_cols
);
res
(
i_rows
)
=
dynamicmodel
(
zz
,
exogenousvariables
,
params
,
steadystate_y
,
it
);
else
z
(
jendo
)
=
Y
(
i_cols
);
z
(
jexog
)
=
transpose
(
exogenousvariables
(
it
,:));
res
(
i_rows
)
=
jacobian
*
z
;
end
m
=
m
+
nv
;
i_rows
=
i_rows
+
ny
;
i_cols
=
i_cols
+
ny
;
...
...
This diff is collapsed.
Click to expand it.
matlab/perfect-foresight-models/sim1_purely_backward.m
+
2
−
2
View file @
7d0f8aa1
...
...
@@ -38,13 +38,13 @@ dynamicmodel = str2func([M.fname,'.dynamic']);
info
.
status
=
1
;
for
it
=
2
:
options
.
periods
+
1
for
it
=
M
.
maximum_lag
+
(
1
:
options
.
periods
)
yb
=
endogenousvariables
(:,
it
-
1
);
% Values at previous period, also used as guess value for current period
yb1
=
yb
(
iyb
);
[
tmp
,
check
]
=
solve1
(
dynamicmodel
,
[
yb1
;
yb
],
1
:
M
.
endo_nbr
,
nyb
+
1
:
nyb
+
M
.
endo_nbr
,
...
1
,
options
.
gstep
,
options
.
dynatol
.
f
,
options
.
dynatol
.
x
,
...
options
.
simul
.
maxit
,
options
.
debug
,
exogenousvariables
,
...
M
.
params
,
steadystate
,
it
+
M
.
maximum_lag
-
1
);
M
.
params
,
steadystate
,
it
);
if
check
info
.
status
=
0
;
end
...
...
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