Commit Graph

106 Commits (master)

Author SHA1 Message Date
Sébastien Villemot 3ebf824f3f
simul_static_model: use the sparse representation of the static model 2024-02-07 13:57:22 +01:00
Stéphane Adjemian (Ryûk) 4982ce06b4
Remove unnecessary square brackets. 2023-12-18 10:49:49 +01:00
Stéphane Adjemian (Ryûk) 735bd66d4d
Remove unused output arguments. 2023-12-18 07:48:27 +01:00
Johannes Pfeifer c3268c0279
Move various functions from main matlab folder to subfolders 2023-12-14 18:29:04 +01:00
Johannes Pfeifer b3ce518433 Further naming consistency improvements 2023-10-25 11:22:50 +02:00
Johannes Pfeifer 879d92fbf8 Move many functions towards consistent naming
Related to #1776
2023-10-24 22:21:15 +02:00
Johannes Pfeifer e65662151f Eliminate set_dynare_seed.m calls with globals 2023-09-28 17:00:21 +02:00
Johannes Pfeifer 9b86dd4c33
bug: simul_backward_model_init.m: fix error message 2023-09-25 17:17:37 +02:00
Johannes Pfeifer d386bb9f76 Cholesky decomposition: only add to diagonal if really necessary
Closes #1891
2023-06-23 11:26:14 -04:00
Stéphane Adjemian (Ryûk) 15027db136
Add missing initialization. 2023-05-11 15:59:38 +02:00
Sébastien Villemot 91fa8d079e
calibrateresiduals: use the sparse representation of the dynamic model 2023-04-13 17:24:47 +02:00
Sébastien Villemot 7e1c25d775
backward_model_inversion: use the sparse representation of the dynamic file 2023-04-13 15:51:09 +02:00
Sébastien Villemot ed75e4c176
dynamic_backward_model_for_inversion: turn into a local function of backward_model_inversion 2023-04-13 15:47:43 +02:00
Sébastien Villemot 66b648157f
Purely backward models simulation: use the sparse representation of the dynamic file 2023-04-13 15:47:43 +02:00
Stéphane Adjemian (Ryûk) 4f3a0df884
Do not overwrite solve_algo option. 2023-04-12 09:53:46 +02:00
Stéphane Adjemian (Ryûk) 51ffe77fb7
Add error flag (new output) to simul_backward_model routine. 2023-04-05 11:09:59 +02:00
Stéphane Adjemian (Ryûk) 7583790851
Improve error message. 2023-03-09 11:25:04 +01:00
Sébastien Villemot d574705b4a
Design and performance improvement to solve_algo={12,14}
Use the new time-recursive block decomposition computed by the preprocessor
for:
- the simulation of backward models with “simul_backward”
- the perfect foresight simulation of purely backward/forward/static models

Also note that in this case, the preprocessor now defaults to “mfs=3” (i.e. it
minimizes the set of feedback variables and tries to renormalize equations).

This replaces the previous algorithm based on Dulmage-Mendelsohn (dmperm), plus
an ad hoc identification of some equations that can be evaluated (those with a
LHS equal to a variable, the log of a variable, or the diff-log of a variable).

By the way, the block_trust_region MEX has been modified so that it accepts a
boolean argument to decide whether it performs a Dulmage-Mendelsohn
decomposition (if not, then it performs a simple trust region on the whole
nonlinear system).

This provides a significant performance improvement (of almost an order of
magnitude for solve_algo=14 on a 700 equations model).
2022-11-30 14:47:57 +01:00
Johannes Pfeifer 73ca68e052 model_inversion: Header cosmetics 2022-09-15 10:16:05 +02:00
Stéphane Adjemian (Charybdis) 584e661fff
Ensure that the ordering of the exogenous variables is correct...
in model inversion routines.
2022-06-17 17:48:00 +02:00
Stéphane Adjemian (Charybdis) 4d646ba30b
Fix evaluation of the dynamic model.
Call the wrapper instead of the dynamic routine.
2022-04-19 19:15:21 +02:00
Stéphane Adjemian (Charybdis) 63224ed45d
Bug fix (display of problematic equations). 2022-04-19 16:33:29 +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
Stéphane Adjemian (Ryûk) b09e91ff55
Add routine description in headers. 2022-04-10 21:22:51 +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) 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) 882091cc97
Return more info about nonlinear solver failures (solve1). 2022-03-03 22:30:38 +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
Stéphane Adjemian (Charybdis) 1d916b1fe2
Bug fix.
[skip ci]
2022-01-27 11:07:09 +01:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Stéphane Adjemian (Charybdis) 27ee801a67
Add specialized version of sim1 for static models.
Also add an integration test and fix homotopy error message.
2021-05-28 14:11:34 +02:00
Stéphane Adjemian (Charybdis) 8683790927
Throw error if solve_algo={12,14} is used without JSON output. 2021-04-08 20:31:40 +02:00
Sébastien Villemot 7bbe67748b
simul_backward: Octave compatibility fix 2021-02-02 17:02:04 +01:00
Sébastien Villemot f662c17c5d
shock_decomposition_backward: Octave compatibility fix 2021-01-27 18:25:27 +01:00
Sébastien Villemot d52a35889c
shock_decomposition_backward: workaround for bug in MATLAB ≤ R2019a
Ref. dseries#45
2021-01-27 18:25:27 +01:00
Sébastien Villemot 4c2b906962
Add routine for shock decomposition of backward models
Closes: Enterprise/dynare#2
2020-09-18 17:40:45 +02:00
Stéphane Adjemian (Charybdis) 04b0e8aaa1
Bug fix related to missing aux variables if fourth argument is empty. 2020-05-26 17:43:07 +02:00
Stéphane Adjemian (Charybdis) 84ec142463
Return paths for the exogenous variables. 2020-04-09 10:40:46 +02:00
Stéphane Adjemian (Charybdis) f8bb514632
Return paths for all the endogenous variables if fourth argument is empty. 2020-04-08 17:59:23 +02:00
Sébastien Villemot 43ed7b2b69
Merge remote-tracking branch 'community/master' into enterprise 2020-03-27 16:28:41 +01:00
Stéphane Adjemian (Charybdis) 6ffbda470e
Use merge instead of horcat. 2020-03-13 17:44:35 +01:00
Stéphane Adjemian (Charybdis) 4bd775948e
Allow empty argument. 2020-03-13 17:44:09 +01:00
Stéphane Adjemian (Charybdis) 492b0fffea
Cosmetic change. 2020-03-11 12:34:21 +01:00
Stéphane Adjemian (Charybdis) 864d4c25c7
Updated simulation routine for nonlinear backward models.
Changes necessary for the latest patches on dynare_solve (solve_algo={12,14}).
2020-02-27 22:58:19 +01:00
Stéphane Adjemian (Charybdis) 84e7d4bd3d
Adapted code to use solve_algo={12,14}. 2020-02-20 13:12:16 +01:00