Commit Graph

58 Commits (4c1af7890bf2a1ea68a218f13890f2f6a2f1b66a)

Author SHA1 Message Date
Marco Ratto 63a299f64e new error codes introduced and applied for occbin smoother.
- 321 when simulation within occbin smoother fails
- 322 when occbin smoother does not converge.
2023-02-06 14:58:42 +01:00
Marco Ratto f565a0a84a bug fix and avoid missing output arguments and when smoother exits after non convergence of simulation. 2023-02-06 11:39:24 +01:00
Marco Ratto b886de92dc trap case when simulation does not converge within smoother 2023-02-03 14:25:32 +01:00
Marco Ratto cdd195576e store binding_indicator_history once it has been set 2023-02-03 14:24:58 +01:00
Marco Ratto 035db8b8c4 bug fixes when using guess regime 2023-02-03 14:20:51 +01:00
Marco Ratto 77e87be48b try with base regime before returning error 2023-02-03 14:20:39 +01:00
Marco Ratto 50aa20c742 eliminate buggy and useless check for existence of guess regime variable. this may create bugs in running PKF update step! 2023-02-03 14:20:02 +01:00
Marco Ratto 6598d615d1 in some cases, order is not yet set to 1 2023-02-03 14:19:16 +01:00
Marco Ratto a91c36f920 first_period_occbin_update is an index, not a boolean 2023-02-03 14:19:05 +01:00
Marco Ratto b90dff1986 retrieve states in period 0 from smoother and deploy this to:
- allow having binding regimes in period 1 with occbin
- further improve recovering of smoothed variables in period 1 under smoother_redux option
2023-02-03 14:18:10 +01:00
Johannes Pfeifer 80f6799c38 IVF: only store smoother results if requested 2022-11-23 16:44:18 +01:00
Johannes Pfeifer 1e2fb88d32 IVF: fix error handling for smoother 2022-11-23 15:37:12 +01:00
Johannes Pfeifer eeecccd29b IVF_core.m: fix header 2022-11-23 15:18:44 +01:00
Sébastien Villemot 3184db12f2 Merge branch 'occbin_smoother' into 'master'
OccBin Smoother: do not write non-converged results to oo_

Closes #1863

See merge request Dynare/dynare!2100
2022-11-16 18:40:05 +00:00
Johannes Pfeifer 4d603fb335 OccBin Smoother: do not write non-converged results to oo_
Closes https://git.dynare.org/Dynare/dynare/-/issues/1863
2022-11-16 17:13:08 +01:00
Marco Ratto b0ce054c00 missing line that stores info on violation of constraint in expectation (needed to check for periodic solutions) 2022-11-15 23:09:48 +01:00
Sébastien Villemot b336fbeb0d
Merge branch 'occbin_features' of git.dynare.org:rattoma/dynare
Ref. !2094
2022-11-04 14:59:06 +01:00
Marco Ratto a1e0c35c1f bug fix when max_check_ahead_periods interacts with curb_retrench 2022-11-04 11:20:52 +01:00
Marco Ratto 2f23604824 new option max_check_ahead_periods (renaming old undocumented option max_periods), that truncates the number of periods for which agents check ahead the regime (a sort of myopic behavior beyond max_check_ahead_periods),
the option is valid for simul, smoother and likelihood.
2022-11-04 11:17:37 +01:00
Marco Ratto e31b313776 cosmetic change 2022-10-20 19:09:52 +02:00
Marco Ratto d0150997f6 accept periodic solution in simulations ONLY IF two regimes differ by one period, to avoid pathological solutions.
We also do not check for periodicity when check ahead periods have been increased endogenously, again to avoid mis-identified periodicity.

Any other type of periodicity, is flagged as non-convergence with error code 313 (infinite loop of solutions).
2022-10-20 16:13:34 +02:00
Marco Ratto 2ccd3d4a0e if max_periods is set to finite number, enforce algorithm to check ahead ONLY until max_periods (i.e. when we want agents to be myopic beyond some future period) 2022-10-20 16:11:01 +02:00
Marco Ratto 3765ef77cd add option reset_check_ahead_periods_in_new_period:
when performing stochastic simulations, check ahead periods may increase endogenously at some point for regimes very long in expectation. such longer check ahead periods may considerably slow down convergence in subsequent periods, so users may want to avoid this.
2022-10-20 16:10:14 +02:00
Marco Ratto eb41618614 trap errors also in univariate update step for occbin 2022-10-20 15:06:36 +02:00
Marco Ratto ce21248e97 set noprint = true when simulating, to avoid crashes; only save info1 file under debug option 2022-10-20 15:06:26 +02:00
Marco Ratto eb6f17e783 check if initial states are empty, and set them to zero. 2022-10-20 15:05:39 +02:00
Johannes Pfeifer 95a15815a8 kalman_update_algo_3.m: correct options name 2022-10-08 18:01:05 +02:00
Marco Ratto 3c0f8ec624 bug fixes in error traps in PKF update steps 2022-07-29 16:39:59 +02:00
Sébastien Villemot ad97361f67
Fix bug under MATLAB < R2016b introduced in 906062cfe5
The logic for testing the MATLAB version was incorrect.
2022-07-26 22:36:30 +02:00
Marco Ratto 906062cfe5 fix bug in ambiguity in the first regime stored, between 01 10 and 11. 2022-07-26 12:44:55 +02:00
Marco Ratto 3575afdf1d save info1 file only under debugging 2022-06-02 09:52:48 +02:00
Johannes Pfeifer c623696b4b kalman_update_algo_1.m: properly set array dimensions 2022-05-25 14:15:18 +02:00
Johannes Pfeifer 0f333f29eb kalman_update_algo_1.m: introduce error handling
Closes https://git.dynare.org/Dynare/dynare/-/issues/1854
2022-05-19 11:56:42 +02:00
Johannes Pfeifer 6536e135cb Occbin: filter out problems in solving the baseline model 2022-04-28 13:33:48 +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 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
Johannes Pfeifer 23c007e716 IVF_core.m: directly use solver option fields 2022-04-11 08:33:28 +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
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
Johannes Pfeifer 3b59253416 occbin: fix bug if there is only a surprise shock in the first period 2022-01-14 08:47:37 +01:00
Marco Ratto 9305cd1ef1 fixed header of occbin solver 2022-01-06 15:02:43 +01:00
Johannes Pfeifer 8a76c689ea IVF: properly deal with error code 2021-12-14 11:21:16 +01:00
Johannes Pfeifer c07508a917
occbin_write_regimes: distinguish between smoother and simulations
Closes: #1828
2021-12-07 12:41:34 +01:00
Johannes Pfeifer 226ed712bd Documentation: add missing author 2021-10-17 15:11:52 +02:00
Sébastien Villemot f164750a91
Old MATLAB compatibility fix
This is a partial revert of 4346903c65. The
xlswrite function is actually not able to write XLS files on GNU/Linux and
macOS, and moreover its CSV fallback does not work with cell arrays.
2021-09-15 17:37:08 +02:00
Sébastien Villemot 4346903c65
Various Octave compatibility issues
Also improve on e42cf2e5b4 for the compatbilitity
with MATLAB < R2016a in occbin.write_regimes_to_xls.m.
2021-09-14 17:55:55 +02:00
Sébastien Villemot e42cf2e5b4
Various MATLAB R2014a compatibility fixes 2021-09-08 14:15:49 +02:00
Stéphane Adjemian 8ae7b23843 Merge branch 'occbin_output' into 'master'
Occbin: remove redundant output

See merge request Dynare/dynare!1910
2021-08-17 17:15:07 +00:00
Johannes Pfeifer bfd92e79a7
Occbin: udpate options 2021-08-16 11:37:53 +02:00
Johannes Pfeifer 3c02d0c5b0 Occbin: remove redundant output 2021-08-10 13:54:59 +02:00