Commit Graph

14707 Commits (79df7673143c5eec1569868e71c0dd3b5376398d)

Author SHA1 Message Date
Sébastien Villemot 79df767314
Bump JSONLab to version 2.0
We were previously using version 1.8.
2022-03-23 15:01:55 +01:00
Sébastien Villemot 35bdac6be6
Testsuite: in block_bytecode/ireland.mod, remove unneeded option setting
The default of options_.slowc is already 1.
2022-03-22 12:53:04 +01:00
Sébastien Villemot b43f9af7d1
Windows package: minor build system simplification
The “all” rule being equivalent to the “build” rule, juste delete the former
and move the latter upwards.
2022-03-22 12:11:44 +01:00
Sébastien Villemot 8c16d1745e
block_trust_region MEX: first part of handling complex values returned by solved function
If solved function returns complex values (with nonzero imaginary part), turn
them into NaNs. This mimics the behaviour of the use_dll case.

Next step will be to adapt the trust region algorithm to diminish radius when
there are NaNs.

Incidentally, bump the required GCC version to 9, since we use the %re and %im
components of complex values in Fortran.
2022-03-21 18:55:42 +01:00
Sébastien Villemot d5472d2338
Tighten input sanity checks of various MEX files
Note that the unitary test in lyapunov_solver.m that checks sparse matrix input
had to be removed. Previously, this test was passing by chance (because the
sparse test matrices had actually no zero element, hence the internal double
float storage was the same as in the dense case). Now it consistently fails
with the additional checks in disclyap_fast MEX.
2022-03-18 22:49:46 +01:00
Sébastien Villemot 4f6d8a198a
k_order_perturbation MEX: convert complex elements of residuals or derivatives matrices to NaNs 2022-03-18 16:45:33 +01:00
Sébastien Villemot d8c3467a08
Testsuite: improve tests for block/bytecode options
Improve the model that is used to test all combinations of algorithms with
block and bytecode options, by ensuring that it includes the 8 possible types of blocks:
– Solve {forward, backward, two boundaries} {simple, complete}
– Evaluate {forward, backward}

All the “Solve” blocks are also included in both linear and nonlinear forms
(since the codepaths are typically different depending on the linearity of
the block).

Note that there is no such thing as a nonlinear “Evaluate” block, since the
endogenous variables of the block always enter linearly (on the LHS).

Also:
- use perfect_foresight_{setup,solver} instead of simul (and disable automatic homotopy)
- add a shock on e_R (though this is not strictly needed since the
  corresponding block already inherits the shock from another ancestor block)
- remove the block for observables, there is already another block of type
  “Evaluate forward”
2022-03-16 15:00:09 +01:00
Sébastien Villemot 07978affa5
Block decomposition: simplify MATLAB implementation of stack_solve_algo=3 (BiCGStab)
This commit makes it closer to the implementation in bytecode. In practice,
this change fixes convergence problems on some models.
2022-03-16 15:00:09 +01:00
Sébastien Villemot db5e04107f
solve_one_boundary.m: fix crash in verbose mode 2022-03-16 15:00:09 +01:00
Sébastien Villemot 2d73ae2971
Bytecode: fix typo 2022-03-16 15:00:09 +01:00
Sébastien Villemot 8a6ea14402 Merge branch 'doc_naming' into 'master'
Manual: clarify potential naming issues in steady state files

See merge request Dynare/dynare!2007
2022-03-15 16:43:22 +00:00
Sébastien Villemot 3a039a1d7f
Preprocessor: fix detection of nonlinearity of blocks of type “Solve backward/forward simple” 2022-03-15 17:42:03 +01:00
Sébastien Villemot 96fb676be7
Bytecode: fix stack_solve_algo=4 when a “solve backward/forward” block follows a “solve two boundaries” block
When solving a “Solve two boundarise” block with stack_solve_algo=4, the
“slowc” variable is modified. This would affect the resolution of further
“solve backward/forward” blocks, which would yield results.

The fix consists in saving and restoring “slowc”.
2022-03-15 17:42:03 +01:00
Johannes Pfeifer ecbfb7d083 Manual: clarify potential naming issues in steady state files 2022-03-14 20:33:19 +01:00
Sébastien Villemot 52dfad35f9 Merge branch 'selec_draws' into 'master'
posterior moments: fix bugs that cause crashes

See merge request Dynare/dynare!2006
2022-03-14 15:16:57 +00:00
Johannes Pfeifer 28536314c0 posterior moments: fix bugs that cause crashes
- Delete non-existing output argument
- prevent info from being overwritten
2022-03-14 14:50:49 +01:00
Stéphane Adjemian (Ryûk) 882091cc97
Return more info about nonlinear solver failures (solve1). 2022-03-03 22:30:38 +01:00
Stéphane Adjemian (Ryûk) 7072359241
Fix fifth output introduced in e815fb2 (exitflag was not updated). 2022-03-03 21:56:44 +01:00
Stéphane Adjemian (Ryûk) afd8359dbf
Do not compute g twice in solve1.
When jacobian is evaluated numerically.
2022-03-03 20:26:06 +01:00
Stéphane Adjemian (Ryûk) 9be328aeda
Cosmetic changes. 2022-03-03 20:24:18 +01:00
Stéphane Adjemian (Ryûk) f2193e8ec8
Add more checks on the initial evaluation. 2022-03-03 18:33:34 +01:00
Stéphane Adjemian (Ryûk) 3c85695b99
Use isinf() instead of isfinite() in solve1 routine. 2022-03-03 18:30:36 +01:00
Stéphane Adjemian (Ryûk) e815fb2901
Display exitflag returned by fsolve.
When the Newton fails in the simulation of backward models.
2022-03-03 18:19:33 +01:00
Stéphane Adjemian (Ryûk) e6592b3943
Display more info if Newton fails in backward model simulations. 2022-03-03 16:57:59 +01:00
Stéphane Adjemian (Ryûk) 7ee124bbba
Fix bug.
Return the paths for the endogenous only before the nonlinear solver crash.
2022-03-03 10:57:40 +01:00
Stéphane Adjemian (Charybdis) 90ae54a6ff
Translate to English. 2022-03-03 09:35:30 +01:00
Stéphane Adjemian (Charybdis) 9d1e07a2e4
Fix headers. 2022-03-03 09:35:30 +01:00
Sébastien Villemot ae1e31b7e0
Restore the possibility of calling the “resid” function without argument
Can be useful when writing “z = resid;” in a .mod file (i.e. not using the
preprocessor syntax).
2022-03-01 16:40:51 +01:00
Sébastien Villemot 3d7299c1e4
New option “non_zero” to the “resid” command
When this option is given, the “resid” command only displays non-zero residuals
2022-03-01 14:26:16 +01:00
Sébastien Villemot 7f44a28209
Emacs mode: add missing “resid” keyword 2022-03-01 11:59:17 +01:00
Sébastien Villemot e49cada341
Testsuite: run_block_byte_tests_{matlab,octave}.m were not actually checking the results 2022-03-01 11:29:52 +01:00
Sébastien Villemot 65e18fe883
Bytecode: fix stack_solve_algo=4 on linear blocks
Only one iteration is performed on linear blocks. But in the case of
stack_solve_algo=4 it is not enough, since it will not find the right optimal
path lenght at the first iteration (even though that optimal path length is
ufnitary).
2022-03-01 11:29:29 +01:00
Sébastien Villemot dbbbb75874
Bytecode: fix typo, replace “substract” by “subtract” 2022-02-28 18:47:20 +01:00
Sébastien Villemot 67a003aa73
Bytecode: fix stack_solve_algo=1 (relaxation method)
There were various issues with the construction of sparse submatrices.

By the way, refactor and document the code to make it more readable.
2022-02-28 18:47:20 +01:00
Sébastien Villemot 811e53f9ad
Bytecode: document matrix computation routines 2022-02-28 18:47:20 +01:00
Sébastien Villemot 59b8ee9c33
Bytecode: remove unused matrix subtraction routine 2022-02-28 18:47:20 +01:00
Sébastien Villemot a7cc466285
Bytecode: fix bug in sparse matrix multiplication routines
Since those routines compute Aᵀ·B, the number of rows of the output is equal to
the number of columns of A.
2022-02-28 12:18:58 +01:00
Sébastien Villemot 0147faad5f
Fix stack_solve_algo=1 without bytecode, on solve two boundaries simple/complete blocks
The result for the last simulation period was wrong.
2022-02-25 16:32:16 +01:00
Stéphane Adjemian (Charybdis) c9825c803a
Fix description of the conditional_forecast command.
Closes #1844
2022-02-24 20:33:47 +01:00
Sébastien Villemot 4d39c6fab5 Merge branch 'error_message' into 'master'
get_error_message.m: condition on index being non-zero

See merge request Dynare/dynare!2003
2022-02-24 16:23:16 +00:00
Sébastien Villemot 63bcd2558e
Testsuite: when running Octave, use --no-window-system option rather than forcing gnuplot toolkit
In practice --no-window-system currently implies the gnuplot toolkit with dumb
terminal, but it is cleaner this way.
2022-02-23 12:13:27 +01:00
Johannes Pfeifer a60ce435bd get_error_message.m: condition on index being non-zero
dsge_likelihood will expand the vector due to entry four of info containing the penalty, creating a 0 for entry 2
2022-02-22 12:22:51 +01:00
Sébastien Villemot f52ce51168
Preprocessor: fix error message when “ramsey_policy” follows a “ramsey_model” statement 2022-02-21 16:46:37 +01:00
Sébastien Villemot a4f4d4462c
Merge branch 'disp_dr' of git.dynare.org:JohannesPfeifer/dynare
Ref. !2002
2022-02-21 16:19:36 +01:00
Sébastien Villemot 0b053f1ebf
Windows package: bump dependencies 2022-02-21 16:02:04 +01:00
Johannes Pfeifer d79895b66a Display of decision rules: deal with overflow of fields 2022-02-20 11:00:34 +01:00
Sébastien Villemot 1a9abc247f
Merge branch 'mom' of git.dynare.org:JohannesPfeifer/dynare
Ref. !2001
2022-02-18 14:22:53 +01:00
Sébastien Villemot 8f5815d01d
Preprocessor: for bytecode, fix temporary terms for dynamic derivatives in “evaluate” mode 2022-02-18 14:22:28 +01:00
Sébastien Villemot 8536b63827
Bytecode: remove superfluous debug information 2022-02-18 14:17:37 +01:00
Stéphane Adjemian (Charybdis) e7d11dd7b1
Remove aux variables from target definition (PAC). 2022-02-18 09:13:17 +01:00