Commit Graph

172 Commits (237aa465d23fb3113a27cf2d8f9932bd3c2e2e8f)

Author SHA1 Message Date
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
Sébastien Villemot 4ba0f0a9c3
LMMCP: don’t report a wrong maxerror, rather put NaN 2020-10-20 18:27:19 +02:00
Sébastien Villemot 46da76c0ce
LMMCP: fix bug when periods=1
The fix in commit 24cc67e585 was incorrect.
2020-10-20 18:20:04 +02:00
Sébastien Villemot 87cc519321
LMMCP / linear perfect foresight: fix bug for models with a single equation
The routines use the find() function applied to a subset of columns of the
Jacobian, which in this case is a row vector. When passed a row vector, find()
returns row vectors (while it returns column vectors when passed a column
vector or a matrix). This case was not correctly handled.
2020-10-20 18:20:02 +02:00
Stéphane Adjemian (Odysseus) 248ad18846 Merge remote-tracking branch 'Dynare/master' into enterprise
Fixed conflicts in:

 - .gitlab-ci.yml
 - matlab/dynare_config.m
 - matlab/dynare_solve.m
 - matlab/initvalf.m
 - matlab/perfect-foresight-models/make_ex_.m
 - matlab/perfect-foresight-models/perfect_foresight_setup.m
 - mex/build/matlab/Makefile.am
 - mex/build/matlab/configure.ac
 - mex/build/octave/Makefile.am
 - mex/build/octave/configure.ac
 - mex/sources/Makefile.am
 - preprocessor
 - tests/Makefile.am
2020-09-17 14:53:32 +02:00
MichelJuillard 0391dbbeb1 fix bug with lag on exogenous variables on more than one period
(cherry picked from commit 492124ce9886e6aef4f4cefef302241d7edfe024)
2020-09-04 14:02:04 +00:00
Sébastien Villemot 41fe087106
Block decomposition: static and dynamic files are now pure wrappers around the per-block files
Systematically call top-level static/dynamic files, instead of per-block ones.
2020-06-19 18:46:56 +02:00
Sébastien Villemot 0305b427a6
Block decomposition: use same orientation convention as oo_.endo_simul for matrix of simulated paths
Improves consistency, but also efficiency (less transpose needed).
2020-06-17 18:19:35 +02:00
Sébastien Villemot 20431ed312
Block decomposition: in the dynamic file, y and T are now vectors as in non-block mode 2020-06-17 18:19:21 +02:00
Sébastien Villemot 7bec234f7f
Block decomposition: for evaluate blocks, move the iteration loop outside the dynamic file 2020-06-15 18:29:42 +02:00
Sébastien Villemot fae433fb18
Block decomposition: fix bug introduced in 0d11f8182a 2020-06-04 18:15:54 +02:00
Sébastien Villemot 0d11f8182a
Block decomposition: no longer compute deterministic simulation from dynamic.m file
By the way, fix bug where oo_ was not modified by solve_one_boundary.

Also convert oo_.deterministic_simulations.status to a boolean in the block
routines, for consistency with the non-block case.
2020-06-02 17:46:29 +02:00
Stéphane Adjemian (Charybdis) 9a66f3ebd9
Allow shocks with initval_file. 2020-05-18 12:21:43 +02:00
Michel Juillard b70d99d1b4
Refactoring of initval_file and histval_file
initval_file and hisvfal_file are now more flexible and have functionalities
similar to option datafile in estimation.

Closes: #1671
2020-05-14 16:45:54 +02:00
Michel Juillard fd09b98150 fix bug when no convergence and backward model 2020-03-31 15:40:49 +02:00
Houtan Bastani eb6ab0696a
gui: added fields to `oo_` to indicate which commands have been run 2020-03-03 11:45:46 +01:00
Johannes Pfeifer 8aad715183 det_cond_forecast.m: always set options_.qz_criterium
Closes https://git.dynare.org/Dynare/dynare/issues/1701
2020-02-02 14:15:01 +01:00
Sébastien Villemot 7e770f69e7
Remove workaround for errors in MEX files
Because at some point throwing exceptions from MEX files (with mexErrMsgTxt())
was not working under Windows 64-bit, we had designed a workaround to avoid
using exceptions.

Most MEX files were returning an error code as their first (or sometimes last)
argument, and that code would have to be checked from the MATLAB code.

Since this workaround is no longer needed, this commit removes it. As a
consequence, the interface of many MEX files is modified.

For some background, see https://www.dynare.org/pipermail/dev/2010-September/000895.html
2020-01-10 18:33:11 +01:00
Sébastien Villemot a95358accc Merge branch 'sim1' into 'master'
sim1.m: provide missing function input to nested function

See merge request Dynare/dynare!1691
2020-01-06 13:22:29 +00:00
Johannes Pfeifer 632c0a3943 sim1.m: provide missing function input to nested function 2020-01-06 09:06:18 +01:00
Sébastien Villemot 49dc997073
Global reindentation of MATLAB code (excluding submodules)
Also convert to Unix end-of-lines, and remove trailing whitespaces.
2019-12-20 16:30:27 +01:00
Sébastien Villemot efa6c6c682
“datafile” option of “perfect_foresight_setup” (and “simul”) now equivalent to “initval_file”
Ref. #1663
2019-12-19 14:58:54 +01:00
Michel Juillard d0247277f9 after check, oo_.dr isn't empty but oo_.dr.ghx + friends don't exist 2019-11-25 21:54:53 +01:00
Michel Juillard f6daa359b7 fix tolf and tolx options for sim1_purely_forward 2019-11-23 22:47:17 +01:00
Michel Juillard 2652cb0dd7 fix tolf and tolx options for sim1_purely_backward 2019-11-23 22:44:10 +01:00
Houtan Bastani 7712a02f02
add print and noprint option to perfect_foresight_solver. closes #1647 2019-09-12 14:50:14 +02:00
Houtan Bastani 3d6091b3a1
remove unused return arguments 2019-09-12 14:01:52 +02:00
Houtan Bastani e043c60903
pass M_, options_, oo_ as arguments to stoch_simul, simult_, discretionary_policy. closes dynare#1197 2019-09-12 11:57:01 +02:00
Sébastien Villemot f8af21819e
Simplify the interface to perfect_foresight_problem MEX 2019-07-09 14:33:17 +02:00
Sébastien Villemot 2ad6b31d76
Option endogenous_terminal_period is only available for stack_solve_algo=0 2019-07-04 18:37:27 +02:00
Sébastien Villemot 7d9b2a557b
perfect_foresight_problem MEX: number of threads is now configurable 2019-06-27 17:00:12 +02:00
Sébastien Villemot 5b591fac42
New perfect_foresight_problem MEX file
It constructs the stacked residuals and jacobian of the perfect foresight
problem.

It is an almost perfect replacement for the perfect_foresight_problem.m
routine, while being much more efficient.

Note however that the DLL never return complex numbers (it instead puts NaNs at
the place where there would have been complex). This may create problems for
some MOD files; the algorithms will need to be adapted to use a more
line-search method.
2019-06-24 17:53:59 +02:00
Sébastien Villemot aedc9fb2e4
Bugfix: perfect_foresight_setup safety check does not correctly index M_.lead_lag_incidence 2019-06-18 17:01:06 +02:00
Sébastien Villemot 5a36d57b90
Perfect foresight: remove unused nnzJ argument in several stacked problem functions 2019-05-13 18:33:26 +02:00
Sébastien Villemot 088826a332
Perfect foresight: remove useless model evaluation 2019-05-13 18:33:26 +02:00
Stéphane Adjemian (Charybdis) 64dc44740b Efficiency change. 2019-04-26 16:20:45 +02:00
Stéphane Adjemian (Charybdis) 99edfc52ed Removed unused routine. 2019-04-26 15:55:48 +02:00