Commit Graph

1803 Commits (ec908386b67d1b27e0dc4174ef64796f74246318)

Author SHA1 Message Date
Johannes Pfeifer 76b3f53d0b ramst_initval_file.mod: move to non-deprecated syntax 2021-09-22 09:56:33 +02:00
Sébastien Villemot fa3ed38735
Source package: fix bug introduced in d62a09cdef 2021-09-21 17:45:30 +02:00
Sébastien Villemot 872c0424a8
tests/block_bytecode/lola_stochastic_block.mod: increase test tolerance on ghu
Needed for Octave on lupi.
2021-09-21 17:00:39 +02:00
Sébastien Villemot d62a09cdef
tests/ep/rbcii.mod: use supported mechanism for user-provided steady state file
Incidentally, this should fix random crashes under Octave (where the manually
copied steady state file was not correctly detected by the interpreter).
2021-09-21 16:26:58 +02:00
Johannes Pfeifer 2dd6510051 smoother2histval.m: undo logging
Closes https://git.dynare.org/Dynare/dynare/-/issues/1407
2021-09-17 14:43:50 +02:00
Sébastien Villemot 49a396030b
Yet another batch of Octave compatibility fixes 2021-09-16 18:25:00 +02:00
Sébastien Villemot 37467a9b9d
Merge branch 'octave_fixes' of git.dynare.org:wmutschl/dynare
Ref. !1926
2021-09-16 15:16:14 +02:00
Willi Mutschler 5199ea414b
Fix for testsuite on Octave AnScho_matched_moments.mod 2021-09-16 12:45:38 +02:00
Johannes Pfeifer 38a2dcaa8f dynrbc_common.inc: increase maxit and check_ahead_periods
Required for Octave
2021-09-16 10:40:44 +02:00
Johannes Pfeifer 001971bda6 dynrbc_common.inc: provide file ending required in Octave 2021-09-16 08:56:44 +02:00
Sébastien Villemot ff06b9ad10
More Octave compatibility fixes 2021-09-15 18:35:30 +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
Johannes Pfeifer e7b1d4aca5 testsuite: Fix missing dependence 2021-09-11 11:29:18 +02:00
Johannes Pfeifer 334020fc46 evaluate_planner_objective.m: fix wrong timing in setting of shocks 2021-09-11 09:44:36 +02:00
Johannes Pfeifer 0d483ff85f evaluate_planner_objective.m: Factorize setting of initial condition
also takes care of initially set shocks
2021-09-11 09:44:35 +02:00
NormannR acdad93822 Fixing the regression in behavior in evaluate_planner_objective (Ref: #1680)
- evaluate_planner_objective now returns conditional welfare depending on the initial value of the Lagrange multipliers when it is suitable to do so
   - histval blocks are no longer ignored
2021-09-11 09:44:35 +02:00
Sébastien Villemot e42cf2e5b4
Various MATLAB R2014a compatibility fixes 2021-09-08 14:15:49 +02:00
Sébastien Villemot 8d4f5fbd9b
Fix tests/deterministic_simulations/multiple_lead_lags/sim_endo_lead_lag.mod
A bug was introduced in 440a0e460b, erroneously
changing the name of the baseline for a comparison.

The bug was left unnoticed with recent versions of MATLAB and on Octave,
because the first array in the ensuing comparison had zero line, and because of
automatic broadcasting, the error message was not triggered.

However, the bug was exposed on MATLAB < R2016b.
2021-09-08 14:15:49 +02:00
Sébastien Villemot badb36d6d2
Fix typos introduced in c68e4801bd 2021-09-02 20:43:21 +02:00
Sébastien Villemot c68e4801bd
Build system: add several test files to the source package 2021-09-02 17:14:07 +02:00
Johannes Pfeifer cf6621187e
Add example for system prior
(@stepan removed trailing spaces)
2021-08-17 19:39:02 +02:00
Johannes Pfeifer b8c76a96e3 block_kalman_filter: add integration tests 2021-08-17 14:26:58 +02:00
Johannes Pfeifer bfd92e79a7
Occbin: udpate options 2021-08-16 11:37:53 +02:00
Stéphane Adjemian (Charybdis) c00307c8cc
Fix encoding. 2021-08-16 11:23:13 +02:00
Stéphane Adjemian (Charybdis) 1c54eb21d2
Cosmetic change (remove trailing spaces). 2021-08-16 11:19:28 +02:00
Willi Mutschler 0d200f3b39
MoM: Fix AFVRR test cases due to 3c67ad 2021-08-16 10:58:35 +02:00
Willi Mutschler f5ec70a06d
MoM: Refactor AnScho test case
Instead of checking everything in one mod file, this commit separates the checks into individual mod files that test:
- whether the translation from matched_moments works
- whether the duplicate moments are found
- whether GMM and SMM both work with different estimated_params blocks.
wip
2021-08-16 10:58:35 +02:00
Stéphane Adjemian (Ryûk) bdc95dd1d0
Add unit tests (trust_region algorithm).
Using mex implementation (block_trust_region).
2021-07-23 19:44:16 +02:00
Stéphane Adjemian (Ryûk) e8cc23d3af
Bug fixes (typos). 2021-07-23 19:44:16 +02:00
Stéphane Adjemian (Ryûk) a905539f60
Add test functions for nonlinear solvers. 2021-07-23 19:44:16 +02:00
Sébastien Villemot b34be496c5 Merge branch 'evaluate_planner' into 'master'
evaluate_planner_objective.m: correctly rely on lag/lead structure for perfect foresight

See merge request Dynare/dynare!1890
2021-07-23 14:01:22 +00:00
Johannes Pfeifer 440a0e460b
Storage of results: use subfolder
Ref. #1758
2021-07-23 14:12:17 +02:00
Johannes Pfeifer e09d215964 evaluate_planner_objective.m: correctly rely on lag/lead structure for perfect foresight
Also cosmetic changes to indentation
2021-07-23 13:27:30 +02:00
Sébastien Villemot 3206ea9684 Merge branch 'evaluate_planner_objective' into 'master'
Streamline evaluate planner objective

See merge request Dynare/dynare!1887
2021-07-22 14:42:22 +00:00
Johannes Pfeifer a517c1f1de neo_growth_ramsey_k_order.mod: call evaluate_planner_objective 2021-07-22 15:20:30 +02:00
Sébastien Villemot 8b8f919a0f Merge branch 'smoother2histval' into 'master'
Improvements for smoother2histval

See merge request Dynare/dynare!1886
2021-07-22 12:03:59 +00:00
Johannes Pfeifer 3fb41e075f Matlab implementation of the consider_all_endogenous_and_auxiliary option 2021-07-22 13:12:27 +02:00
Sébastien Villemot 0e793faeb2 Merge branch 'pf_options' into 'master'
Particle filter: enable passing of option values and prepare for other samplers

Closes preprocessor#59

See merge request Dynare/dynare!1884
2021-07-22 09:50:10 +00:00
Johannes Pfeifer 80cad32068 Particle filter: enable passing of option values and prepare for other samplers 2021-07-21 23:00:32 +02:00
Stéphane Adjemian (Ryûk) cd2ed823b6
Fix constant in VAR and PAC expectations...
When the VAR auxiliary model has a constant.
2021-07-21 18:02:11 +02:00
Stéphane Adjemian (Ryûk) a69f68bb7c
Modify companion matrix if VAR model has a constant. 2021-07-21 18:02:04 +02:00
Sébastien Villemot 1045c442a9
Merge branch 'occbin_mean' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1882
2021-07-21 16:42:00 +02:00
Johannes Pfeifer 944bf2b68e occbin: work with non-demeaned data and in constraints 2021-07-21 13:42:38 +02:00
Johannes Pfeifer ac3f04c2ff borrcon*.mod: nostrict option is not needed anymore 2021-07-20 22:38:21 +02:00
Sébastien Villemot c4e1d1e802
Occbin: new syntax for constructing multi-regime equations
Ref. #569
2021-07-20 18:19:19 +02:00
Sébastien Villemot 229282a1c4
Occbin: the +<basename>/occbin_difference.m file is now generated by the preprocessor
Some fields have also changed under M_.occbin.

Ref. #569
2021-07-20 12:35:15 +02:00
Marco Ratto 02072dde39
Add Occbin routines
Syntax is not yet finalized (see preprocessor#68).
Documentation still to be done.

Ref. #569
2021-07-16 17:20:11 +02:00
Stéphane Adjemian (Ryûk) 54f80e88d2
Add structural VAR as an auxiliary model for VAR based expectations and PAC expectations.
Ref. #1785

Just add option `structural` to the `var_model` command.
2021-07-16 10:25:18 +02:00
Stéphane Adjemian (Ryûk) 547b7aef45
Activate integration test for NLS estimation. 2021-07-15 17:39:41 +02:00
Stéphane Adjemian (Ryûk) 14bc82b287
Add single equation estimation by NLS.
Ref. #1798.

See example in tests/estimation/example_nls.mod.
2021-07-15 16:55:49 +02:00
Stéphane Adjemian (Ryûk) 2b4572affd
Allow arbitrary nonzero mean exogenous variables in PAC equations.
Previously any nonzero mean exogenous variable had to be centered on
the growth rate (first difference) of the (PAC's LHS) endogenous
variable.
2021-07-11 17:06:53 +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
Stéphane Adjemian (Ryûk) fe63082c42
Add lagged information set in VAR based expectations. 2021-07-06 23:06: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 18a172bd45
Merge branch 'mcp_ramsey' of git.dynare.org:JohannesPfeifer/dynare
See merge request !1874
2021-06-16 17:41:40 +02:00
Sébastien Villemot 88b427f7bc
Compatibility fix for MATLAB R2014a
MATLAB R2014a does not like the syntax “abs(x).data” where “x” is a dseries.
2021-06-16 17:41:40 +02:00
Johannes Pfeifer 1d10659b59 get_complementarity_conditions.m: fix equation numbering with ramsey_model
M_.equation_tags already contains the correct equation number
2021-06-16 13:21:49 +02:00
Stéphane Adjemian (Ryuk) 2a5ed79be5
Do not run MCMC after online filter (integration test) 2021-06-15 22:09:35 +02:00
Normann Rion 3d27672c58
kth-order approximation of conditional welfare
Partially addresses issue #1680:
- unconditional welfare resorts to dynare++ simulation tools, which shall be updated very soon
TO DO:
- implement a function computing kth-order approximation of simulated moments of y
2021-06-15 15:04:31 +02:00
Sébastien Villemot 2952d18343
Testsuite: improve and integrate unit test for A·(B⊗C) MEX files
In particular, add a test for the sparse A·(B⊗C) where B≠C.
2021-06-14 15:28:34 +02:00
Johannes Pfeifer 0116870399 pruned_state_space: handle shocks with 0 variances 2021-06-11 14:15:31 +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
Stéphane Adjemian (Charybdis) 9867203f25
Reduce simulation length in integration test.
Also removed commented codes.

Closes #1857
2021-05-28 13:56:13 +02:00
Johannes Pfeifer f78ac9f5ac
EP with MCP: add test case 2021-05-28 13:49:58 +02:00
Sébastien Villemot abe8a05b43 Merge branch 'smoother_redux' into 'master'
Implement new option smoother_redux, to allow fast smoother for very large...

See merge request Dynare/dynare!1859
2021-05-27 16:33:21 +00:00
Sébastien Villemot c4e0cd0565 Merge branch 'posterior_smoother' into 'master'
prior_posterior_statistics_core.m: filter out cases where model does not solve

See merge request Dynare/dynare!1860
2021-05-27 16:09:19 +00:00
Marco Ratto 5fa6265944 Implement new option smoother_redux, to allow fast smoother for very large models. It runs smoother only for state variables and computes the remaining ones ex-post
Contains improvements, in order to recover as much as possible static unobserved (filtered, smoothed, updated, k-step ahead), Variance, State_uncertainty, k-step ahead variances trying to map lagged states onto current ones using pinv(T). This has exceptions (namely lagged shocks which are ONLY used to recover static NON observed variables). this exception is also trapped.
For such extensions we can only recover smoothed variables starting from d+1. Variances CANNOT be recovered for such variables (the smoother gives ZERO.)
2021-05-27 16:59:15 +02:00
Johannes Pfeifer 5d1d5b8a85 prior_posterior_statistics_core.m: filter out cases where model does not solve
Relax qz_criterium by factor of 10, when taking posterior subdraws. Also makes sure `prior` option works as intended.
2021-05-27 16:46:28 +02:00
Marcoo Ratto 1645f38269
Implement heteroskedastic filter and smoother 2021-05-26 18:45:16 +02:00
Johannes Pfeifer 456dc86ad1 identification: support optimal policy
Related to https://git.dynare.org/Dynare/dynare/-/merge_requests/1837
2021-05-14 13:38:42 +02:00
Sébastien Villemot cf37b5151a
Testsuite: indicate that glibc bug has been fixed in version 2.34
[skip ci]
2021-05-11 18:54:07 +02:00
Sébastien Villemot 0d6bc47158
Merge branch 'rattoma/dynare-mh_initialize_from_previous_mcmc'
Ref. !1841
2021-05-11 18:51:57 +02:00
Marco Ratto a0f2b2399b
New option mh_initialize_from_previous_mcmc that allows to pick initial values for a new MCMC from a previous one
If an additional parameter is estimated, it is initialized using prior_draw.
2021-05-11 18:48:43 +02:00
Sébastien Villemot 3c7865a950
Merge branch 'rattoma/dynare-initial_estimation_checks_errors'
Ref. !1839
2021-05-07 17:52:45 +02:00
Marco Ratto 74121c2aee
New no_init_estimation_check_first_obs option that allows to skip check of singularity in first observation
(like deficient # of shocks in the presence of stockflow observed)
2021-05-07 17:51:03 +02:00
Sébastien Villemot 749fc219e5
Testsuite: increase test tolerance under Octave for ecb/SURGibbs/fulton_fish.mod 2021-05-05 15:43:19 +02:00
Sébastien Villemot 62e42e08a8
Testsuite: more fixes related to stochastic block decomposition + mfs > 0
Ref. #1726
2021-05-05 10:15:52 +02:00
Sébastien Villemot 04ba15e5cc
Preprocessor: forbid check and stoch_simul in block-decomposed mode with mfs > 0
Closes: #1726
2021-05-04 17:18:20 +02:00
Sébastien Villemot 58b2bc78c3
Testsuite: check that stochastic solution in block decomposition mode is correct
Only test with mfs=0, since the result is wrong for other mfs values.

Ref. #1726
2021-05-04 16:31:44 +02:00
Sébastien Villemot ef58f1329a
Testsuite: factorize code between block decomposition tests based on LOLA model
By the way, move tests files under tests/block_bytecode/, which is a more
natural place.

Ref. #1726
2021-05-04 16:17:37 +02:00
Sébastien Villemot d6677f66a4
Testsuite: adapt histvalf_initvalf unit tests following previous commit 2021-04-20 12:17:23 +02:00
Sébastien Villemot caef9e266b
Preprocessor: fix crash in DataTree::operator=() with model local variables
Also add a regression test.

Closes: #1782
2021-04-16 17:36:08 +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
Sébastien Villemot d68fc14fed
Build system: remove trailing whitespace in Makefile 2021-03-29 15:27:47 +02:00
Sébastien Villemot 559b0b5679
Source package: fix name of ms-sbvar datafile
Bug introduced in 11f8f9c7f4
2021-03-17 18:11:40 +01:00
Sébastien Villemot 11f8f9c7f4
MATLAB R2021a compatibility: rename datafile for ms-sbvar tests
The datafile was name “data.m”, and for some unidentified reason, this stopped
working with MATLAB R2021a.
2021-03-17 17:41:27 +01:00
Sébastien Villemot 47477e152a
Bump minimal Octave version to 6.2.0 2021-03-12 16:21:57 +01:00
Sébastien Villemot c9eb6920c9
local_state_space_iteration_k MEX: fix bug in output
In its output, the MEX was returning values for all endogenous variables, but
it was used in a context where only the variables from oo_.dr.restrict_var_list
were expected (as is done with local_state_space_iteration_2 MEX).

This commit fixes this discrepancy, and also fixes the test that was checking
that both MEX are returning the same output.

Closes: #1768
2021-03-10 13:45:29 +01:00
Normann Rion 9db1265892 Asssesing welfare in perfect-foresight frameworks
Ref. #1680
2021-02-25 15:12:28 +01:00
Sébastien Villemot 9066d31dd7 Merge branch 'ramsey_problem' into 'master'
Ref. #1680 : 2nd-order welfare

See merge request Dynare/dynare!1828
2021-02-23 16:08:53 +00:00
Normann Rion f532de0f29 Adds the discretionary case to the evaluate_planner_objective function 2021-02-18 12:00:44 +01:00
Normann Rion e880d1bcc3 Ref. #1680: 2nd-order welfare 2021-02-17 13:53:55 +01:00
Sébastien Villemot a51bdf8948
Merge branch 'smoother2histval' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1831
2021-02-16 16:58:59 +01:00
Johannes Pfeifer 788e05b2fd smoother2histval: add test case for correctness 2021-02-16 11:25:46 +01:00
Sébastien Villemot 7cbb86bb64
Testsuite: rename estimation/univariate/ols/ols.mod
Under Octave, the +ols folder conflicts with the builtin ols() function.
2021-02-09 16:58:07 +01:00
Sébastien Villemot e4af502360
Testsuite / pac: Octave compatibility fix
Use a different random seed under Octave for several tests.

Note that these tests seems fragile. Changing the seed under MATLAB often leads
to a failure.
2021-02-04 16:01:35 +01:00
Sébastien Villemot f094dc71f9
Testsuite / pac/trend-component-19-growth-comb: fix accuracy check
The test was using the comparison operator (>) on a dseries. This would give a
bogus (false) result under MATLAB, and would crash under Octave.
2021-02-04 16:01:30 +01:00
Sébastien Villemot 9b555ec974
Testsuite / BGP tests: compatibility fix tests with MATLAB < R2016a 2021-02-02 15:02:50 +01:00
Sébastien Villemot 1cd3bfbfa8
Merge branch 'kalman_initial_state' of git.dynare.org:JohannesPfeifer/dynare 2021-01-29 15:34:11 +01:00
Johannes Pfeifer 7c8f486727 Allow setting initial state for Kalman filter
Supersedes https://git.dynare.org/Dynare/dynare/-/merge_requests/1522
2021-01-28 17:24:27 +01:00
Sébastien Villemot 6ac1af7035
Merge branch 'filtered_variables' of git.dynare.org:JohannesPfeifer/dynare 2021-01-28 16:53:30 +01:00
Sébastien Villemot af67b4f7c9
Testsuite: Octave 6 compatibility fix
In Octave ≤ 5, it was impossible to take a function handle for a function in a
package (“+” folder). This bug has been fixed in Octave 6, so we can use the
same codepath as MATLAB in that case. See
https://savannah.gnu.org/bugs/index.php?46659
2021-01-28 16:36:43 +01:00
Sébastien Villemot 25d19fef96
Testsuite: increase numerical tolerance for minimal_state_space_system/sw_minimal.mod
This is necessary for MATLAB R2014a on some runners.
2021-01-27 18:24:26 +01:00
Sébastien Villemot 6e6bc3f6c9
Testsuite: rename test files for Octave compatibility
Rename histval_initval_file/ramst_data.mod to ramst_data_generate.mod.
Otherwise, there is a conflict between the +ramst_data folder and the generated
ramst_data.m.

Similarily, rename shock_decomposition/shock_decomposition_backward.mod to
shock_decomposition/shock_decomp_backward.mod (otherwise it conflicts with
matlab/shock_decomposition_backward.m).
2021-01-27 18:24:22 +01:00
Johannes Pfeifer c596b8890e Trend_diagnostics_MCMC_common.inc: do not store smoother results on disk 2021-01-27 17:42:15 +01:00
Johannes Pfeifer 8ad8bf05b3 gsa/ls2003a.mod: reduce run-time 2021-01-26 10:39:38 +01:00
Johannes Pfeifer e9ea837b28 Reduce run-time of tune_mh_jscale/fs2000.mod 2021-01-26 10:10:29 +01:00
Johannes Pfeifer c507eefc23 testsuite: check values of analytic derivation likelihood to prevent regression 2021-01-24 17:41:50 +01:00
Johannes Pfeifer ec69174173
Improvements to particle tests 2021-01-22 21:19:07 +01:00
Sébastien Villemot c9a6637ca5
Testsuite: compatibility fix for MATLAB R2014a
Double quotes strings are not supported under older MATLAB versions.
2021-01-19 16:14:25 +01:00
Sébastien Villemot 783598bdeb
Testsuite / methods of moments: compatbility fix for MATLAB R2014a
MATLAB R2014a does not like some of the variable names that are passed to
table(). Disable that call, as under Octave.
2021-01-19 16:10:40 +01:00
Sébastien Villemot 68af1c80fe
Testsuite: cosmetic changes to TeX and debug options
– Whenever possible, pass the “tex” option to Dynare commands instead of
  fiddling with options_.TeX;
— For the remaining explicit options_.TeX and also for options_.debug,
  use a boolean value instead of an integer.
2021-01-19 15:50:14 +01:00
Sébastien Villemot 654da6ecb8 Merge branch 'octave_fixes' into 'master'
Don't do bgp/solow-1 in Octave

See merge request Dynare/dynare!1780
2021-01-18 11:28:36 +00:00
Stéphane Adjemian (Charybdis) 78a4bca383
Use nonlinear filter. 2021-01-16 17:43:30 +01:00
Stéphane Adjemian (Charybdis) 0f3dd003b7
Run mod files in tests/particle. 2021-01-16 17:42:17 +01:00
Johannes Pfeifer ad17b8ec33
Particle filtering: provide more informative error messages in typical problematic cases
Also adds test cases
2021-01-15 22:11:20 +01:00
Sébastien Villemot 91b0ba64c6
Testsuite: rename all test files that have the name “example.mod”
That filename conflicts with Octave’s builtin example() function.
2021-01-15 17:19:41 +01:00
Sébastien Villemot 23cb1879e9
Testsuite: fix PAC test filename 2021-01-15 17:19:41 +01:00
Willi Mutschler 0a880825a1
MoM: Testsuite fixes for Octave 2021-01-14 10:04:10 +01:00
Willi Mutschler a697002a4e
MoM: Gradient-based optimizers can use analytical Jacobian for GMM
New option analytic_jacobian for mode_compute 1, 3, and 13
2021-01-14 10:03:39 +01:00
Stéphane Adjemian (Odysseus) b87690a9f1 Revert "Add tests for matrix notation"
This reverts commit 8d4a80956c.
2021-01-12 16:47:56 +01:00
Stéphane Adjemian (Odysseus) 0e1c9312e2
Merge remote-tracking branch 'Dynare/master' into enterprise 2021-01-11 11:06:55 +01:00
Willi Mutschler dabe0ada33
MoM: Add test for optimizers
Note that mode_compute=11 and 12 need some fixing
2021-01-07 14:14:13 +01:00
Willi Mutschler 2b554e0511
MoM: cosmetical changes to description of options in testsuite 2021-01-07 13:39:45 +01:00
Willi Mutschler ba8d5d364d
MoM: Update copyright years 2021-01-07 10:32:35 +01:00
Willi Mutschler 562a9c737f
MoM: Improve testsuite
- add Andreasen, Fernandez-Villaverde, Rubio-Ramirez (2017) test models
- move models to dedicated folders
- add `make m/method_of_moments` and `make o/method_of_moments` commands to run testsuite only for method of moments
2021-01-06 14:19:17 +01:00
Johannes Pfeifer 9c52aec23d Adjust output of loglinear option to make clear when a logged variable is used
- use of function for getting labels will allow to accommodate https://git.dynare.org/Dynare/dynare/-/issues/349
- incidentally fixes a bug in the display of the simulated variance decomposition for observables with measurement error
2020-12-23 13:53:44 +01:00
Sébastien Villemot 5deaca993b
Merge branch 'discretion' of git.dynare.org:JohannesPfeifer/dynare 2020-12-22 12:29:38 +01:00
Sébastien Villemot 3d912401d5
Testsuite: Octave compatibility fixes in histval_initval_file_unit_tests.m 2020-12-22 12:27:19 +01:00
Johannes Pfeifer 4b793da2c3 discretionary_policy: allow for non-linear model to be used 2020-12-18 18:22:39 +01:00
Willi Mutschler eae5e2f029
MoM: Add analytical standard errors for GMM
Reset analytic_derivation_mode for steadystate file parameter changes


MoM: Fix GMM analytical standard errors wrong dimensions in autocovs
2020-12-18 16:16:10 +01:00
Johannes Pfeifer 4cf9f7d1a7 stoch_simul.m: reports second moments based on pruned state space at order=2 when pruning is specified
Related to https://git.dynare.org/Dynare/dynare/-/merge_requests/1744
2020-12-17 09:45:28 +01:00
Stéphane Adjemian (Charybdis) e066556d7a
Added integration test for d8ddd9ef6. 2020-12-07 22:25:54 +01:00
Sébastien Villemot 1c0d1409ea
Fix the use of [static]/[dynamic] equations with the “block” option 2020-12-07 16:24:13 +01:00
Sébastien Villemot fdf5bfbb58
Testsuite: cosmetic fix 2020-12-07 15:10:06 +01:00
Sébastien Villemot 4cc946842b
Add further Octave 6 test for intersect(…, 'stable')
Forgotten in c160d2407.

[skip ci]
2020-12-04 18:41:53 +01:00
Sébastien Villemot 8ba1a15262
Remove outdated Occbin files 2020-12-03 10:50:58 +01:00
Sébastien Villemot c160d24074
Octave 6 implements intersect(…, 'stable')
[skip ci]
2020-11-30 18:26:50 +01:00
Willi Mutschler fcef3ca09f
Don't do bgp/solow in Octave
[skip ci]
The levenberg-marquardt algorithm is not available in octave's implementation of fsolve, so we check the verbatim block only in matlab
2020-11-26 17:12:57 +01:00
Sébastien Villemot f27852d1ec
Add test for mshocks block 2020-11-26 15:48:57 +01:00
Willi Mutschler 3c1087a369
Fix for sylvester3a for purely forward-looking models
In purely forward-looking models ghx is empty and sylvester3a gives a "Operands to the || and && operators must be convertible to logical scalar values" error, as e becomes a "1×0 empty double row vector" and not a logical.
2020-11-21 09:46:10 +01:00
Johannes Pfeifer 904296738d bgp-tests: Octave compatibility fixes 2020-11-19 13:42:35 +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
Johannes Pfeifer d38a4428cc Move macro_processor/example1_macro.mod to subfolder 2020-11-02 16:00:03 +01:00
Johannes Pfeifer b4f3eb4a1c Add unit test for ifndef
See https://git.dynare.org/Dynare/dynare/-/issues/1747
2020-11-02 16:00:03 +01:00
Sébastien Villemot cf68570813
Testsuite: workaround for glibc bug #19329
This bug is causing random crashes in the testsuite on our runners.

See https://sourceware.org/bugzilla/show_bug.cgi?id=19329

(cherry picked from commit f46dfba961)
2020-10-23 15:32:07 +02:00
Sébastien Villemot 299769c51b
Testsuite/MATLAB: output stderr to log file
(cherry picked from commit 2a472a0a6b)
2020-10-23 15:32:06 +02:00
Sébastien Villemot f46dfba961
Testsuite: workaround for glibc bug #19329
This bug is causing random crashes in the testsuite on our runners.

See https://sourceware.org/bugzilla/show_bug.cgi?id=19329
2020-10-23 12:35:35 +02:00
Sébastien Villemot 2a472a0a6b
Testsuite/MATLAB: output stderr to log file 2020-10-22 18:25:42 +02:00
Sébastien Villemot 6f415dff61
Testsuite: add missing line continuation symbol in the list of .mod files
This was causing some tests to be skipped.

The bug had been introduced e7162a2a69.
2020-10-21 16:36:18 +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 33d8bc55f3
Redisable tests/pac/trend-component-31/example.mod, it is not yet ready (some fixes are needed in the M code) 2020-10-16 18:11:01 +02:00
Sébastien Villemot 8e3127d69e
Preprocessor rebase
– PAC model: fixes to M_.pac.MODEL.ar (information about autoregressive part)
  + Fix order of items in this structure. Previously, items were ordered
    according to the declaration order of parameters. Now, items are order
    according to lag order (first lag appears first)
  + Gracefully handle the case where there is no autoregressive part
    (Ref. Dynare/preprocessor#52)
– Block decomposition:
  + bugfix for solve one boundary blocks with mfs>0
  + fix evaluation of recursive variables in solved blocks
  (Ref. Dynare/dynare#1726)
— Fix various potential bugs with model local variable
— Ensure that negative constants are never marked as temporary terms

By the way, activate tests/pac/trend-component-31/example.mod, since it should
now work.
2020-10-16 16:53:26 +02:00
Sébastien Villemot 7270f722e4
Activate test for two PAC equations in the same file 2020-10-16 16:30:38 +02:00
Sébastien Villemot 71e3e0d49e
Fix extended_path with bytecode
By the way, document and enforce the fact that stochastic extended_path (i.e.
order > 0) is not compatible with either bytecode or block.

Closes: #1742
2020-10-14 17:25:58 +02:00
Sébastien Villemot 43311a230f
Testsuite: histval_initval_file_unit_tests.m is not a TLS file 2020-10-14 17:16:35 +02:00
Sébastien Villemot 8acdb9f7cc
Testsuite: MATLAB R2014a compatibility fixes 2020-10-08 17:26:17 +02:00
Sébastien Villemot e7162a2a69
Block decomposition: new tests for mfs>0
Ref. #1726
2020-10-07 19:01:09 +02:00
Stéphane Adjemian (Charybdis) 80bfbc0736
Merge non linear shock decomposition for backward models.
Closes #2.
2020-09-29 18:17:25 +02:00
Sébastien Villemot 8d4a80956c
Add tests for matrix notation
Closes: Enterprise/dynare#1
2020-09-29 16:52:20 +02:00
Sébastien Villemot 66361eb28d
Add test for shock decomposition of backward models
Ref: Enterprise/dynare#2
2020-09-28 18:26:29 +02:00
Stéphane Adjemian (Charybdis) e690c5de5a
Merge Enterprise/block_trust_region into enterprise. 2020-09-24 16:05:55 +02:00
Stéphane Adjemian (Charybdis) 17e6421ea3
Merged master into enterprise.
Fixed conflict in
 - doc/manual/source/running-dynare.rst
2020-09-23 15:28:19 +02:00
Stéphane Adjemian (Charybdis) a40f30cada
Closes #1761 (Fixes for histval_initval_file) 2020-09-23 12:19:18 +02:00
Sébastien Villemot d61f4166ad
Testsuite: add a test for a purely forward variable in block+bytecode mode
Closes: #1727
2020-09-22 16:46:58 +02:00
Michel Juillard c2e43c0093 fix histval_initval_file unit tests 2020-09-20 11:11:26 +02:00
Michel Juillard 9e94252d1a fix target values for periods 2020-09-19 12:18:24 +02:00
Michel Juillard 91b4cfd3a8 fixes handling of periods in histval_file/initval_file 2020-09-19 12:14:43 +02:00
Sébastien Villemot 865ab47fa9
Provide block_trust_region MEX under solve_algo 13 and 14
- block trust region solver now available under solve_algo=13
  It is essentially the same as solve_algo=4, except that Jacobian by finite
  difference is not handled. A test file is added for that case
- block trust region solver with shortcut for equations that can be evaluated
  is now available under solve_algo=14 (in replacement of the pure-MATLAB solver)

Closes: Enterprise/dynare#3
2020-09-18 18:01:56 +02:00
Sébastien Villemot fcc3a3cec2
Testsuite: fix repeated typo in equation name
[skip ci]
2020-09-18 17:40:44 +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
Johannes Pfeifer 96be513ecf Remove matched_moments_ as input argument as it is now a field of M_ 2020-08-05 15:58:58 +02:00
Stéphane Adjemian (Odysseus) 579fb9e685 Fixed bug introduced in edede274f2. 2020-07-24 22:30:51 +02:00
Stéphane Adjemian (Charybdis) edede274f2
Make the detection of the target in PAC equation more robust.
In a PAC equation, the error correction term must be written as:

β×(yₜ₋₁-xₜ₋₁)

where x is the endogenous variable determined by the equation and y
the target for x. The ordering matters, if not respected the
preprocessor wll not identify the error correction term (hence the
target) and will throw an error. The target must be an endogenous
variable or the log of an endogenous variable. For a more general
target, ie an expression, one can create an auxiliary variable.

We impose the ordering, target comes first in the error correction
term, so that the stability condition is always β>0 (this constraint
can be enforced when estimating the PAC equation).
2020-07-24 17:36:31 +02:00
Stéphane Adjemian (Charybdis) 7f50b02910
Added test where the PAC equation doesn't have lags on the endogenous variable.
This example is currently failing.
2020-07-22 12:25:05 +02:00
Stéphane Adjemian (Charybdis) 897e2fc63b
Added test with two PAC equations in the same mod file. 2020-07-22 12:21:23 +02:00
Johannes Pfeifer 9fa24aa7be RBC_MoM: filter out additional pathological cases with try-catch 2020-07-17 20:35:53 +02:00
Johannes Pfeifer 791e5e9d97 RBC_MoM-test: filter out pathological cases
[skip CI]
2020-07-17 15:16:05 +02:00
Sébastien Villemot 1dbbef9f2e Merge branch 'moment_estimation' into 'master'
First implementation of moment estimation

See merge request Dynare/dynare!1750
2020-07-16 15:41:15 +00:00
Willi Mutschler 19b7d202d2 testsuite: Add test cases 2020-07-16 14:54:04 +02:00
Sébastien Villemot cda3253d2c Merge branch 'ME_traceplots' into 'master'
Fix trace plots with measurement errors and their correlations

See merge request Dynare/dynare!1752
2020-07-16 09:39:47 +00:00
Sébastien Villemot 499451d50a Merge branch 'pruned_state_space' into 'master'
Speed up pruned_state_space_system.m by e.g. using persistent variables

See merge request Dynare/dynare!1749
2020-07-16 09:39:01 +00:00
Johannes Pfeifer 540f0454d2 Code Review of GMM routines
- fix prefilter option
- Implement iterative GMM
2020-07-16 11:38:40 +02:00
Willi Mutschler 3615962a61 First draft of method of moments toolbox with GMM and SMM 2020-07-16 11:38:38 +02:00
Johannes Pfeifer 8a00ee3dff AnSchorfheide_pruned_state_space.mod: remove test part that only showcases that in Andreasen's code there is an error 2020-07-15 15:37:49 +02:00
Johannes Pfeifer f717712ed6 Fix trace plots with measurement errors and their correlations
Problem was introduced when transitioning to cell arrays
2020-07-15 14:34:04 +02:00
Sébastien Villemot 51278b2f90
Testsuite / External functions: also test coefficients of 2nd order policy function 2020-07-10 18:25:23 +02:00
Sébastien Villemot acdca03e43
Testsuite / External functions: add file missing in previous commit 2020-07-09 18:42:17 +02:00
Sébastien Villemot 5b88113668
Testsuite / External functions: add check for numerical results 2020-07-09 18:40:36 +02:00
Sébastien Villemot 4913cfb3f0 Merge branch 'third_order_moments' into 'master'
Add display of theoretical moments at order=3 with pruning

See merge request Dynare/dynare!1744
2020-06-30 14:38:22 +00:00
Johannes Pfeifer dfc7357636 Add display of theoretical moments at order=3 with pruning 2020-06-30 13:46:54 +02:00
Johannes Pfeifer ac728c0492 Add test cases for moments with measurement errors 2020-06-29 13:21:08 +02:00
Sébastien Villemot ee05ff6c6a
Block decomposition now compatible with 'use_dll' option 2020-06-23 15:49:27 +02:00
Willi Mutschler 42503e102e
✔️ Add unit tests for correct identification analysis 2020-06-20 22:38:47 +02:00
Willi Mutschler 97134cc362
🐛 Fix issue with endogenous params in steady state
Identification should switch to analytic_derivation_mode=-2 if steady state block/file changes parameter values. Dynare/dynare!1732 already adresses this when there is a prior specified. This fix also addresses this when there are no priors.

kim2.mod is now not only an integration test but also a unit test for this.
2020-06-20 22:38:47 +02:00
Sébastien Villemot d0fb9ce5b8
Preprocessor update
— Bug fix: allow external functions in model local variables (also add corresponding
  integration test)
— JSON output:
  + do not append two underscores after model local variable names in their
    definition
  + when writing the model after computing pass, use TEF terms for (not
    derived) external functions
  + write model local variables in parsed model (modfile.json) (Closes: #1723)
— In the driver file, provide mapping between model local variables and indices
  in the temporary terms vector (Closes: #1722)
2020-06-05 17:16:11 +02:00
Sébastien Villemot bd7eb2f88d
Fixes to solve_algo ≥ 9
— allow solve_algo=9 without block nor bytecode
— allow solve_algo≥9 with block without bytecode
— test solve_algo=9
2020-05-25 17:22:17 +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
Sébastien Villemot e5f45ef7b1
Testsuite: fix calls to fataltest.m 2020-05-13 14:58:09 +02:00