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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
e576dc8c
Verified
Commit
e576dc8c
authored
4 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
Block decomposition: fix evaluation of recursive variables in solved blocks
Ref. #1726
parent
a69d598b
No related branches found
No related tags found
No related merge requests found
Pipeline
#4244
passed
4 years ago
Stage: build
Stage: test_and_pkg
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
matlab/solve_one_boundary.m
+3
-2
3 additions, 2 deletions
matlab/solve_one_boundary.m
matlab/solve_two_boundaries.m
+2
-1
2 additions, 1 deletion
matlab/solve_two_boundaries.m
preprocessor
+1
-1
1 addition, 1 deletion
preprocessor
with
6 additions
and
4 deletions
matlab/solve_one_boundary.m
+
3
−
2
View file @
e576dc8c
...
@@ -92,9 +92,10 @@ for it_=start:incr:finish
...
@@ -92,9 +92,10 @@ for it_=start:incr:finish
g1
=
spalloc
(
Blck_size
,
Blck_size
,
nze
);
g1
=
spalloc
(
Blck_size
,
Blck_size
,
nze
);
while
~
(
cvg
==
1
||
iter
>
maxit_
)
while
~
(
cvg
==
1
||
iter
>
maxit_
)
if
is_dynamic
if
is_dynamic
[
r
,
~
,
T
(:,
it_
),
g1
]
=
feval
(
fname
,
Block_Num
,
dynvars_from_endo_simul
(
y
,
it_
,
M
),
x
,
params
,
steady_state
,
T
(:,
it_
),
it_
,
false
);
[
r
,
yy
,
T
(:,
it_
),
g1
]
=
feval
(
fname
,
Block_Num
,
dynvars_from_endo_simul
(
y
,
it_
,
M
),
x
,
params
,
steady_state
,
T
(:,
it_
),
it_
,
false
);
y
(:,
it_
)
=
yy
(
M
.
lead_lag_incidence
(
M
.
maximum_endo_lag
+
1
,:));
else
else
[
r
,
~
,
T
,
g1
]
=
feval
(
fname
,
Block_Num
,
y
,
x
,
params
,
T
);
[
r
,
y
,
T
,
g1
]
=
feval
(
fname
,
Block_Num
,
y
,
x
,
params
,
T
);
end
end
if
~
isreal
(
r
)
if
~
isreal
(
r
)
max_res
=
(
-
(
max
(
max
(
abs
(
r
))))
^
2
)
^
0.5
;
max_res
=
(
-
(
max
(
max
(
abs
(
r
))))
^
2
)
^
0.5
;
...
...
This diff is collapsed.
Click to expand it.
matlab/solve_two_boundaries.m
+
2
−
1
View file @
e576dc8c
...
@@ -83,7 +83,8 @@ while ~(cvg==1 || iter>maxit_)
...
@@ -83,7 +83,8 @@ while ~(cvg==1 || iter>maxit_)
r
=
NaN
(
Blck_size
,
periods
);
r
=
NaN
(
Blck_size
,
periods
);
g1a
=
spalloc
(
Blck_size
*
periods
,
Blck_size
*
periods
,
nze
*
periods
);
g1a
=
spalloc
(
Blck_size
*
periods
,
Blck_size
*
periods
,
nze
*
periods
);
for
it_
=
y_kmin
+
(
1
:
periods
)
for
it_
=
y_kmin
+
(
1
:
periods
)
[
r
(:,
it_
-
y_kmin
),
~
,
T
(:,
it_
),
g1
]
=
feval
(
fname
,
Block_Num
,
dynvars_from_endo_simul
(
y
,
it_
,
M
),
x
,
params
,
steady_state
,
T
(:,
it_
),
it_
,
false
);
[
r
(:,
it_
-
y_kmin
),
yy
,
T
(:,
it_
),
g1
]
=
feval
(
fname
,
Block_Num
,
dynvars_from_endo_simul
(
y
,
it_
,
M
),
x
,
params
,
steady_state
,
T
(:,
it_
),
it_
,
false
);
y
(:,
it_
)
=
yy
(
M
.
lead_lag_incidence
(
M
.
maximum_endo_lag
+
1
,:));
if
periods
==
1
if
periods
==
1
g1a
=
g1
(:,
Blck_size
+
(
1
:
Blck_size
));
g1a
=
g1
(:,
Blck_size
+
(
1
:
Blck_size
));
elseif
it_
==
y_kmin
+
1
elseif
it_
==
y_kmin
+
1
...
...
This diff is collapsed.
Click to expand it.
preprocessor
@
4560639e
Compare
e4687bb9
...
4560639e
Subproject commit
e4687bb97616a19432e1b46565b6b6065276b657
Subproject commit
4560639eb4035448cc8adc4535a1957fa82924ab
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