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
Frédéric Karamé
dynare
Commits
03da338b
Commit
03da338b
authored
9 years ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Added more informative error messages.
parent
6007d51e
No related branches found
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/lmmcp/sw_newton.mod
+16
-2
16 additions, 2 deletions
tests/lmmcp/sw_newton.mod
with
16 additions
and
2 deletions
tests/lmmcp/sw_newton.mod
+
16
−
2
View file @
03da338b
...
...
@@ -69,8 +69,22 @@ end;
simul(periods=1000);
newton_solution_is_wrong = abs(evaluate_max_dynamic_residual(str2func('sw_newton_dynamic'), oo_.endo_simul, oo_.exo_simul, M_.params, oo_.steady_state, 1000, size(oo_.endo_simul, 1), 1, M_.lead_lag_incidence))>options_.dynatol.f;
lmmcp = load('sw_lmmcp_results');
if max(max(abs(lmmcp.oo_.endo_simul-oo_.endo_simul)))>options_.dynatol.x
error('LMMCP and Newton algorithms return different results!')
lmmcp_solution_is_wrong = abs(evaluate_max_dynamic_residual(str2func('sw_newton_dynamic'), lmmcp.oo_.endo_simul, lmmcp.oo_.exo_simul, M_.params, oo_.steady_state, 1000, size(oo_.endo_simul, 1), 1, M_.lead_lag_incidence))>options_.dynatol.f;
solutions_are_different = max(max(abs(lmmcp.oo_.endo_simul-oo_.endo_simul)))>options_.dynatol.x;
if newton_solution_is_wrong
error('Failed to solve SW with ZLB (using Newton algorithm on stacked model)')
end
if solutions_are_different && ~lmmcp_solution_is_wrong
error('Solutions with Newton and LMMCP algorithms are different!')
end
if lmmcp_solution_is_wrong
error('Failed to solve SW with ZLB (using LMMCP algorithm on stacked model)!')
end
\ No newline at end of file
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