Commit Graph

208 Commits (7dd2dd5e24a343fbeaf3522ea5e535c27d8b9f95)

Author SHA1 Message Date
Johannes Pfeifer 66fa6e6742 sim1_purely_backward.m: fix typo 2022-09-13 13:52:29 +02:00
Sébastien Villemot b071e85214
Merge branch 'lmmcp' of git.dynare.org:JohannesPfeifer/dynare
Ref. !2067
2022-09-12 16:58:05 +02:00
Johannes Pfeifer 0225cb23ac Path solver: trigger lmmcp flag
Solves https://git.dynare.org/Dynare/dynare/-/issues/1720 for PATH solver
2022-09-06 09:34:20 +02:00
Johannes Pfeifer 85a894efde lmmcp: display norm of residuals in homotopy 2022-09-01 13:00:09 +02:00
Stéphane Adjemian (Ryûk) ca31a087f8
Fix typo (remove trailing underscore to option variable). 2022-08-31 15:26:09 +02:00
Stéphane Adjemian (Ryûk) 9301024d71
Do not check steady state if nocheck option used in steady command...
In perfect foresight solvers with linear approximation.
2022-08-31 13:12:25 +02:00
Sébastien Villemot 06f665e231
Perfect foresight: LBJ now available under stack_solve_algo=1 (with/without block/bytecode)
Previously, LBJ was available:

– under stack_solve_algo=6 when neither block nor bytecode were present
– under stack_solve_algo=1 with either block or bytecode (but the documentation
  was not making it clear that it was LBJ)

This commit merges the two values for the option, and makes them
interchangeable. LBJ should now be invoked with stack_solve_algo=1 (but
stack_solve_algo=6 is kept for compatibility, and is a synonymous).
2022-06-15 15:06:33 +02:00
Johannes Pfeifer 74dc4f81f0 perfect_foresight_solver.m: loop over dynamic file when mex cannot be used
Closes https://git.dynare.org/Dynare/dynare/-/issues/1850
2022-05-18 08:59:39 +02:00
Sébastien Villemot 63a116fb28
New += and *= syntaxes in “endval(learnt_in=…)” blocks 2022-05-03 17:46:59 +02:00
Sébastien Villemot b084c2e931
Perfect foresight with expectation errors: move computation of terminal steady states to the setup command
This is more logical, since those values are constraints from the point of view
of the solver.

Also, this allows to have maxit and tolf options for the steady state solver,
at the level of the setup command, without a clash with the same option names
for the deterministic solver at the level of the solver command.
2022-04-29 15:56:11 +02:00
Sébastien Villemot a600336c92
New “add” and “multiply” keywords in “shocks(learnt_in=…)” block 2022-04-26 15:22:15 +02:00
Sébastien Villemot 8488674ce4
New shocks(learnt_in=…) and endval(learnt_in=…) blocks
For use with perfect_foresight_with_expectation_errors_setup.
2022-04-21 17:10:52 +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
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
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
Johannes Pfeifer 1ed765b8c4 perfect_foresight_solver_core.m: fix Fortran not 2022-03-25 14:23:11 +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 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 bef8d80ba8
More conversions to logical values 2022-03-23 16:52:40 +01:00
Sébastien Villemot bb793d87cc
Block decomposition: fix deterministic simulations for block of type “Solve backward”
The results were incorrect for those two kinds of block, when not using bytecode.
2022-02-09 14:07:33 +01:00
Stéphane Adjemian (Ryûk) f5f47cd834
Add new option last_simulation_period to initval_file command.
Also adjust the periods in Simulated_time_series (output of the perfect
foresight solver in the workspace). Note that this dseries object contains the
observations for the initial condition (M_.orig_maximum_lag observations) and
for the terminal condition (M_.orig_maximum_lead observations).

See #1838.

Fix testsuite (wrong file name)
2022-01-21 17:39:47 +01:00
Stéphane Adjemian (Charybdis) 38e1cd5d4e
Do not include auxiliaries in Simulated_time_series...
And add paths for the exogenous variables.
2022-01-21 16:50:42 +01:00
Johannes Pfeifer 8cf6fe0be4 perfect_foresight_setup.m: add line skip 2021-12-30 14:27:12 +01:00
Johannes Pfeifer ce9bb2f09d make_ex_.m: gracefully exit if user attempts to set non-existent period 0 2021-12-06 15:04:30 +01:00
Stéphane Adjemian (Ryûk) 0d092a36a0
Acknowledge option trust_region_initial_step_bound_factor in matlab based trust_region routine. 2021-07-23 19:44:16 +02:00
Sébastien Villemot abd64c256e
New perfect_foresight_with_expectation_errors_{setup,solver} commands
These command solve the problem where agents think they know perfectly the
future (they behave as in perfect foresight), but make expectation errors.
Hence they can potentially be surprised in every period, and their expectations
about the future (incl. the final steady state) may change.

Currently the sequence of information sets needs to be passed through a CSV
file. Another interface may be added in the future.

The algorithm uses a sequence of (true) perfect foresight simulations (not
necessarily as many as there are periods, because if the information set does
not change between two periods, there is no need to do a new computation).

There are two possibilities for guess values:
— the default is to use the initial steady state for the simulation using the
  first-period information set; then use previously simulated values as guess
  values
— alternatively, with the terminal_steady_state_as_guess_value option, use the
  terminal steady state as guess value for all future periods (this is actually
  what the “true” perfect foresight solver does by default)
2021-07-09 18:16:46 +02:00
Johannes Pfeifer f7a232061a
Remove unused options_-output
Prevents accidentally changing something
2021-06-22 18:17:11 +02: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
Johannes Pfeifer f97c138685 sim1_purely_backward.m: for purely static model, do not use past value for first iteration
Index 0 does not exist.
2021-05-27 22:37:45 +02:00
Sébastien Villemot ec28179043
Perfect foresight: add warning when lmmcp and linear option are used together 2021-04-20 16:53:54 +02:00
Stéphane Adjemian (Charybdis) a03b65bab7
Honour option solve_algo with backward models in perfect_foresight_solver. 2021-04-08 20:31:40 +02:00
Johannes Pfeifer b5a4c0695f perfect foresight: provide debugging information for singular Jacobian
Closes https://git.dynare.org/Dynare/dynare/-/issues/1732
2021-03-17 15:02:30 +01:00
Stéphane Adjemian (Odysseus) 0e1c9312e2
Merge remote-tracking branch 'Dynare/master' into enterprise 2021-01-11 11:06:55 +01:00
Johannes Pfeifer 7bdf07631a Provide better warnings when using ramsey_constraints 2020-12-18 12:59:29 +00:00
Stéphane Adjemian (Charybdis) 12ef75314a
Apply d8ddd9ef6 to deterministic exogenous variables.
(cherry picked from commit eceba8d6da)
2020-12-09 14:59:20 +01:00
Stéphane Adjemian (Charybdis) ffa828a659
Fixed multiple periods expected shocks in the case of mshocks.
(cherry picked from commit d8ddd9ef61)
2020-12-09 14:59:20 +01:00
Stéphane Adjemian (Charybdis) a669c3765d
Cosmetic change in doc headers. 2020-12-07 22:25:54 +01:00
Stéphane Adjemian (Charybdis) eceba8d6da
Apply d8ddd9ef6 to deterministic exogenous variables. 2020-12-07 22:25:54 +01:00
Stéphane Adjemian (Charybdis) d8ddd9ef61
Fixed multiple periods expected shocks in the case of mshocks. 2020-11-24 15:04:41 +01:00
Sébastien Villemot fcb52478e4
Preprocessor: replace exogenous with lead/lags by auxiliary variables in deterministic models
Several tests need to be adapted, because they were implicitly making the
assumption that there is no auxiliary variable.

Incidentally, this closes #1731. This commit therefore also removes the
workaround introduced in 0391dbbeb1.
2020-11-09 16:34:12 +01:00
Sébastien Villemot 029ab65e68
Perfect foresight with initval_file: fix another bug when M_.orig_maximum_lag ≠ M_.maximum_lag
Similar to 95dcb5f4b7.
2020-11-05 16:08:57 +01:00
Sébastien Villemot 95dcb5f4b7
Perfect foresight with initval_file: fix bug when M_.orig_maximum_lag ≠ M_.maximum_lag
By the way, remove inexact comment about a similar code in histvalf.m
2020-11-05 15:39:55 +01:00
Sébastien Villemot 5fab01c534
Perfect foresight: fix case where max lead/lag on exo is greater than max lead/lag on endo
Bug introduced in commit e21cb1ad6b

Ref. #1720
2020-10-21 19:12:22 +02:00
Sébastien Villemot e21cb1ad6b
LMMCP: fix the purely backward and purely forward cases
Closes: #1720
2020-10-21 16:30:40 +02:00