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
Marco Ratto
dynare
Commits
5fab01c5
Unverified
Commit
5fab01c5
authored
Oct 21, 2020
by
Sébastien Villemot
Browse files
Perfect foresight: fix case where max lead/lag on exo is greater than max lead/lag on endo
Bug introduced in commit
e21cb1ad
Ref. #1720
parent
4e16ffcd
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/perfect-foresight-models/private/initialize_stacked_problem.m
View file @
5fab01c5
...
...
@@ -83,15 +83,15 @@ end
z
=
endogenousvariables
(:,
M
.
maximum_lag
+
(
1
:
periods
));
illi
=
M
.
lead_lag_incidence
'
;
[
i_cols
,
~
,
i_cols_j
]
=
find
(
illi
(:));
if
M
.
maximum_lag
==
0
if
M
.
maximum_
endo_
lag
==
0
i_cols
=
i_cols
+
M
.
endo_nbr
;
end
illi
=
illi
(:,(
1
+
M
.
maximum_lag
):(
1
+
M
.
maximum_lag
+
M
.
maximum_lead
));
illi
=
illi
(:,(
1
+
M
.
maximum_
endo_
lag
):(
1
+
M
.
maximum_
endo_
lag
+
M
.
maximum_
endo_
lead
));
[
i_cols_J1
,
~
,
i_cols_1
]
=
find
(
illi
(:));
i_cols_T
=
nonzeros
(
M
.
lead_lag_incidence
(
1
:(
1
+
M
.
maximum_lag
),:)
'
);
i_cols_T
=
nonzeros
(
M
.
lead_lag_incidence
(
1
:(
1
+
M
.
maximum_
endo_
lag
),:)
'
);
if
periods
==
1
i_cols_0
=
nonzeros
(
M
.
lead_lag_incidence
(
1
+
M
.
maximum_lag
,:)
'
);
i_cols_J0
=
find
(
M
.
lead_lag_incidence
(
1
+
M
.
maximum_lag
,:)
'
);
i_cols_0
=
nonzeros
(
M
.
lead_lag_incidence
(
1
+
M
.
maximum_
endo_
lag
,:)
'
);
i_cols_J0
=
find
(
M
.
lead_lag_incidence
(
1
+
M
.
maximum_
endo_
lag
,:)
'
);
else
i_cols_0
=
[];
i_cols_J0
=
[];
...
...
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