Commit Graph

8451 Commits (b7c74f8e9af9d0a13bbd195a3ff457be4d98e941)

Author SHA1 Message Date
Sébastien Villemot b7c74f8e9a
Octave 7 now has jsondecode 2022-04-15 14:33:01 +02:00
Sébastien Villemot ec5468c431
Octave 7 compatibility fix: suppress spurious warnings
In this version of Octave, “warning on” really enables all warnings (while this
was not the case in Octave 6, suprisingly; I think this used to be different
with even older Octave releases).

We therefore need to explicitly disable the Octave:array-as-logical warnings,
that is triggered by some internal Octave functions.

We also need to be careful to call “warning_config” instead of “warning on”
when restoring warnings to their default state.
2022-04-15 14:32:54 +02:00
Sébastien Villemot a0e78957da
Octave 7 compatibility fix: “arguments” is a reserved keyword
This confuses the Octave 7 parser in the context of anonymous functions.

Simply rename the variable to “args”.
2022-04-15 14:32:54 +02:00
Sébastien Villemot 10af04c6d8
Use Unicode copyright symbol (in UTF-8 encoding) in all source files
It is now supported by the MATLAB editor (as of R2022a).

The old ASCII notation is left in some files that we copy as-is from other
sources (e.g. in the contrib/ and m4/ subdirectories).

The particles submodule is not updated at this point, because it is in an
inconsistent state.

[skip ci]
2022-04-13 14:54:25 +02:00
Sébastien Villemot b70b864829
perfect_foresight_with_expectation_errors_setup: move terminal condition to last line of CSV file 2022-04-12 15:51:04 +02:00
Sébastien Villemot a8a9051b31
New option “constant_simulation_length” to “perfect_foresight_with_simulation_errors_solver” command 2022-04-12 15:45:50 +02:00
Johannes Pfeifer 23c007e716 IVF_core.m: directly use solver option fields 2022-04-11 08:33:28 +02:00
Stéphane Adjemian (Ryûk) ff9cf3814a
Remove useless copies of options_. 2022-04-10 22:17:45 +02:00
Stéphane Adjemian (Ryûk) b09e91ff55
Add routine description in headers. 2022-04-10 21:22:51 +02:00
Stéphane Adjemian (Ryûk) 87ecfa9ed1
Allow nonlinear solver to fail when simulating a static model.
Print a message instead of throwing an error if the nonlinear solver fails in a
period, since we do not need previous or future values of the endogenous
variables. If the nonlinear solver fails in period t, the endogenous variables
are set to nan in period t.
2022-04-10 20:57:34 +02:00
Stéphane Adjemian (Charybdis) f1aff2b370
Remove calls to dbstack in dynare_solve.
Adding three input parameters for maxit, tolf and tolx.

Closes #1841.
2022-04-10 20:29:57 +02:00
Stéphane Adjemian (Ryûk) 01203f7e39
Stop deterministic simulation if nonlinear solver failure.
Only for purely backward/forward models. In the case of purely static models the
solution for the previous or following period is not required.
2022-04-10 10:55:40 +02:00
Stéphane Adjemian (Ryûk) 23a72d7aaa
Use dynare_solve to simulate purely forward deterministic models. 2022-04-10 09:39:28 +02:00
Stéphane Adjemian (Ryûk) ef2bb4e669
Return and use errorcode from dynare_solve.
Note that the interpretation of the error code depends on the nonlinear solver.
2022-04-09 16:06:24 +02:00
Stéphane Adjemian (Ryûk) fe7d05f46a
Remove unnecessary condition (Octave/fsolve).
Since we already have checked that the initial guess is not a solution.
2022-04-09 16:06:24 +02:00
Stéphane Adjemian (Ryûk) 33b1827ea5
Bug fix (mixed complementarity problems). 2022-04-09 16:06:24 +02:00
Stéphane Adjemian (Ryûk) 48c41e6b0d
Return the initial guess if nonlinear system is ill-behaved...
At the initial guess, and we were not able to find another guess (randomizing).
2022-04-09 16:06:24 +02:00
Stéphane Adjemian (Ryûk) 56863d6e2f
Exit if initial guess is a solution...
Without entering in the nonlinear solvers.
2022-04-09 16:06:24 +02:00
Sébastien Villemot 0779816457 Merge branch 'resid' into 'master'
resid: Fix display of name tags with Ramsey equations

See merge request Dynare/dynare!2017
2022-04-05 06:16:39 +00:00
Johannes Pfeifer a5fe22bd1c resid: Fix display of name tags with Ramsey equations 2022-04-04 22:50:16 +02:00
Johannes Pfeifer c5557b5418 chol_SE.m: fix logical condition and assure symmetry instead of erroring out 2022-04-04 13:52:54 +02:00
Sébastien Villemot b4ce69db3a
Remove options_.slowc field
There was no user interface, and the feature that it provides has lost
relevance over time.

Note that algorithms for block and/or bytecode still internally use some
equivalent of this parameter, but its initial value will no longer be
modifiable (which could lead to bugs, see commit
e49e7e906f).
2022-03-31 17:39:43 +02:00
Sébastien Villemot 82070e4048 Merge branch 'mom_xls2' into 'master'
MoM: fix reading of XLS-files by assigning sheet info to base workspace

Closes #1840

See merge request Dynare/dynare!2014
2022-03-31 06:49:59 +00:00
Sébastien Villemot 3b4ef0df49
Add new “log” option to “var” statement
Ref. #349
2022-03-30 18:01:22 +02:00
Johannes Pfeifer 176baa2215 MoM: fix reading of XLS-files by assigning sheet info to base workspace
Closes https://git.dynare.org/Dynare/dynare/-/issues/1840
2022-03-30 09:59:36 +02:00
Johannes Pfeifer 35c30dc037 Occbin: use data instead of rawdata and gracefully exit if prefilter option is specified
Closes #1842
2022-03-29 12:16:48 +02:00
Stéphane Adjemian (Ryûk) 53324aad69
Return initial guess if trust_region fails. 2022-03-26 09:21:25 +01:00
Stéphane Adjemian (Ryûk) 4cccdd9074
Bug fix. Revert to previous Jacobian matrix if updated one is ill-behaved. 2022-03-25 19:42:40 +01:00
Stéphane Adjemian (Ryûk) f2bf98ee76
Return the value of info as a third argument (block_trust_region). 2022-03-25 19:42:40 +01:00
Stéphane Adjemian (Ryûk) aa8439d4cc
New implementation of the trust region algorithm.
Main difference is the presence of traps for NaN/Inf/Complex numbers in
residuals or the Jacobian matrix. Also added new unit tests.
2022-03-25 19:42:40 +01:00
Johannes Pfeifer 1ed765b8c4 perfect_foresight_solver_core.m: fix Fortran not 2022-03-25 14:23:11 +01:00
Sébastien Villemot facab0f81b
Merge branch 'mom' of git.dynare.org:JohannesPfeifer/dynare
Ref. !2008
2022-03-25 12:51:40 +01:00
Sébastien Villemot e49e7e906f
Forbid changing the value of “slowc” if “block” or “bytecode” is used
The code is buggy and leads to wrong results, so forbid this combination.
2022-03-25 12:36:36 +01:00
Sébastien Villemot 014a3c3f2e
Merge branch 'sensitivity' of git.dynare.org:JohannesPfeifer/dynare
Ref. !2009
2022-03-24 17:53:34 +01:00
Sébastien Villemot 9a4e08fe15
CI: bump to MATLAB R2022a 2022-03-24 17:44:51 +01:00
Sébastien Villemot b31fe76dfd
Provisions for MATLAB R2022a 2022-03-24 17:43:40 +01:00
Johannes Pfeifer f3bf8fb814 MOM: add missing debug option 2022-03-24 15:28:03 +01:00
Johannes Pfeifer a1ebd20a88 dynare_sensitivity.m: provide warning if order is reset 2022-03-24 13:02:25 +01:00
Sébastien Villemot 4da9d1e718
Block (without bytecode): avoid silent failures in some corner cases
Either ensure that oo_.determinstic_simulation.status is set, or really error out.
2022-03-23 17:33:37 +01:00
Sébastien Villemot dd1ec10ec8
Block (without bytecode): use dynatol.f as convergence criterion for perfect foresight
Was incorrectly using solve_tolf.
2022-03-23 17:25:32 +01:00
Sébastien Villemot e5f4d96c71
Fix typo 2022-03-23 16:58:59 +01:00
Sébastien Villemot bef8d80ba8
More conversions to logical values 2022-03-23 16:52:40 +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 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
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