Commit Graph

8451 Commits (b7c74f8e9af9d0a13bbd195a3ff457be4d98e941)

Author SHA1 Message Date
Sébastien Villemot ee0a4eb001
Reporting: fix detection of pdflatex on Debian Bookworm 2021-09-09 11:30:04 +02:00
Sébastien Villemot d54f2dd609
dseries submodule update
— fix detection of x13as on Debian bookworm/sid
— add ability to use self-compiled x13as on macOS
— add ISO 8601 weeks
— generalize isleapyear routine for vector of integers
2021-09-09 11:03:35 +02:00
Sébastien Villemot e42cf2e5b4
Various MATLAB R2014a compatibility fixes 2021-09-08 14:15:49 +02:00
Stéphane Adjemian (Charybdis) f1bf12c601
Apply patch from d440b7082 for (VAR based) expectations in PAC.
Fix the computation of h1 and h0 if the auxiliary model (VAR) has a constant.
2021-09-07 18:39:52 +02:00
Stéphane Adjemian (Ryûk) d440b70820
Fix var expectation weights when auxiliary model has a constant.
Increment index variables_id_in_var if constant is present in VAR model (first position in the Companion representation)..
2021-09-07 00:36:34 +02:00
Stéphane Adjemian (Ryûk) 4cf1a358ee
Fix growth neutrality correction in PAC/MCE equation. 2021-09-01 11:27:42 +02:00
Stéphane Adjemian (Ryûk) 380fd84cb3
Fix NLS estimation routine.
Closes #1798
2021-09-01 10:37:17 +02:00
Sébastien Villemot 7c0af1ce48
Merge branch 'gsa' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1920
2021-08-31 13:52:20 +02:00
Sébastien Villemot 757c0dd4cb
Merge branch 'k_order_simult' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1914
2021-08-31 13:51:43 +02:00
Johannes Pfeifer cba00755b1 stab_map_2.m: Only do skipline if actual printing happens 2021-08-31 11:13:37 +02:00
Johannes Pfeifer 54203f499e dynare_sensitivity.m: fix dead link 2021-08-31 11:13:02 +02:00
Johannes Pfeifer a2c60dba11 simult_.m: simulate user-requested order with k_order_solver
Also prevent inconsistent simulations
2021-08-30 19:36:51 +02:00
Sébastien Villemot 55850f465d
Merge branch 'noconstant' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1916
2021-08-30 16:37:55 +02:00
Sébastien Villemot b8a9dae60a
Merge branch 'mode_check' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1915
2021-08-30 16:36:57 +02:00
Sébastien Villemot f60043768b
Merge branch 'lyap' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1913

Closes: #1078
2021-08-30 16:16:27 +02:00
Sébastien Villemot d6483ef3f8
Merge branch 'mom_namespace' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1903
2021-08-30 16:13:29 +02:00
Johannes Pfeifer 83ea804fcc estimation: remove invalid check for presence of constant
a zero steady state is a local property depending on the parameter vector; if initial evaluation to true, the constant was ignored
2021-08-20 13:31:48 +02:00
Johannes Pfeifer 459fce927b mode_check.m: take care of almost binding bounds 2021-08-20 13:29:37 +02:00
Johannes Pfeifer 58b336b263 mode_check.m: fix logical condition that may otherwise lead to 0 size of interval 2021-08-20 13:09:06 +02:00
Stéphane Adjemian (Charybdis) d3678edbbe
Add try/catch block (cherry-picking failures).
Close and delete generated file if cherry picking fails for any reason.
2021-08-19 13:03:44 +02:00
Johannes Pfeifer f273c09e71 lyapunov_solver.m: make baseline compatible with sparse matrices 2021-08-19 11:16:24 +02:00
Stéphane Adjemian 8228a32d5c Merge branch 'block_fixes' into 'master'
Fix two bugs for block decomposed models

See merge request Dynare/dynare!1911
2021-08-17 17:18:18 +00: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 5e29a6082f dr_block.m: make sure zx has correct dimensions if no initval is present
Also do earlier check for loglinear option
2021-08-17 14:26:28 +02:00
Johannes Pfeifer 60bf0fd387 block_kalman_filter: request missing output argument 2021-08-17 14:25:31 +02:00
Johannes Pfeifer a27bc872ad
execute_prior_posterior_function.m: move error in correct, transform error into warning 2021-08-17 11:06:01 +02:00
Johannes Pfeifer 0b491b3b09
Estimation: fix header column widths in display of results 2021-08-17 10:57:53 +02:00
Johannes Pfeifer e944b783b9 method_of_moments: move to separate namespace 2021-08-16 14:08:31 +02:00
Johannes Pfeifer 341aca25ad
Liu West: Remove redundant option 2021-08-16 12:34:10 +02:00
Johannes Pfeifer bfd92e79a7
Occbin: udpate options 2021-08-16 11:37:53 +02:00
Stéphane Adjemian (Charybdis) 1c54eb21d2
Cosmetic change (remove trailing spaces). 2021-08-16 11:19:28 +02:00
Willi Mutschler a5995aec03
MoM: Check availability of optim toolbox for default mode_compute
lsqnonlin is an optimization algorithm that is specifically well suited for minimizing quadratic objectives, so I would like to have it as default. However, we fallback to csminwel if the optimization toolbox for Matlab or optim for Octave are not available.
2021-08-16 10:58:35 +02:00
Willi Mutschler 31f3bfa3d0
MoM: Changed some defaults and cosmetical changes
//wip
2021-08-16 10:58:35 +02:00
Willi Mutschler fdba1170ae
MoM: Refactor check for duplicate moments, fix display of results
As we have a working interface now, this commit improves the provisional handling of finding duplicate moments. Previously, indices for GMM were created, but this is not really needed. This commit cleans this up and similar to SMM makes use of the matched_moments block.

As a by-product of the previous provisonal handling higher-order moments for SMM where not correctly displayed as no labels were created. This is now fixed. The comparison of data moments and estimated model moments is also in the same ordering as the inputed orthogonality conditions in matched_moments.

Signed-off-by: Willi Mutschler <willi@mutschler.eu>
2021-08-16 10:58:35 +02:00
Johannes Pfeifer 3c02d0c5b0 Occbin: remove redundant output 2021-08-10 13:54:59 +02:00
Stéphane Adjemian (Ryûk) ebfa72740f
Changed default for initial step bound factor.
Should fix simulation failure in pac/trend-component-10/example1, that
seems to be caused by a too large value of this parameter.
2021-07-24 12:20:29 +02:00
Stéphane Adjemian (Ryûk) 873a9b1a38
Fix call to solve1 routine. 2021-07-23 22:16:43 +02:00
Stéphane Adjemian (Ryûk) 993872d5af
Update dseries submodule (track master branch). 2021-07-23 20:39:00 +02: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
Stéphane Adjemian (Ryûk) e72dde69d3
Add option for trust region algorithm (mex).
trust_region_initial_step_bound_factor is determinining thye initial
step bound. Default value is 100 (previous hard coded value was 1).
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
Johannes Pfeifer 3d5601caec check_model.m: fix logic of check for non-contemporaneous variables and remove redundant checks
Closes https://git.dynare.org/Dynare/dynare/-/issues/1792
2021-07-23 11:25:43 +02:00
Sébastien Villemot 41814becf1 Merge branch 'moments_varendo' into 'master'
dsge_simulated_theoretical_correlation/dsge_simulated_theoretical_covariance:...

Closes #1769

See merge request Dynare/dynare!1888
2021-07-22 16:25:01 +00:00
Johannes Pfeifer 4d43e1850d dsge_simulated_theoretical_correlation/dsge_simulated_theoretical_covariance: only do computations once
Closes https://git.dynare.org/Dynare/dynare/-/issues/1769
2021-07-22 17:03:27 +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 11c75592fb evaluate_planner_objective.m: compute required moments directly 2021-07-22 15:01:15 +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
Johannes Pfeifer a04c348d73 smoother2histval.m: provide warning when smoothed variables are missing 2021-07-22 12:22:18 +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
Sébastien Villemot dc45ac6361 Merge branch 'master' into 'master'
occbin fixes and two small new features

See merge request Dynare/dynare!1883
2021-07-21 18:21:16 +00:00
Marco Ratto 4caebd76c9 added 2 new occbin.simul options (defaults preserve current behavior):
1) algo_truncation: sets the number of iterations for a truncated guess-verify algorithm (i.e. if max_iter<=algo_truncation, no error is triggered on output, but the user is happy with the last regime in the algorithm)
2) reset_regime_in_new_period: is set to true, it resets the guess regimes to unconstrained when a new shock arrives, instead of starting with a guess regime consistent with the one identified in previous time periods. this sometimes allows more robust convergence/identification of the regimes
2021-07-21 18:03:23 +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
Marco Ratto ebdfcc80ec fixed bug introduced in 229282a1c4 2021-07-21 17:59:01 +02:00
Marco Ratto c48f737633 make header names compatible with earlier versions of MATLAB (e.g. it would crash with MATLAB 2017b) 2021-07-21 17:51:05 +02:00
Marco Ratto 85e35b1654 1) if not using relaxation, initial guess regime in verify step(occbin simul) is set equal to the guess regime used to updated states and shocks
2) fixed treatment of periodic solution in algo=3, now harmonized to algo=1
2021-07-21 17:51:03 +02:00
Marco Ratto d3e5e7b8ef Initialize state space matrices with occbin smoother, when realtime regimes are computed, otherwise they are set to 0 for t<first_period_occbin_update! 2021-07-21 17:51:00 +02:00
Marco Ratto bec52fe731 with occbin smoother do not overwrite updated variables that have been already computed with reduced state space 2021-07-21 17:50:58 +02:00
Sébastien Villemot 4c94da514e
CI: bump to Octave 6.3.0 2021-07-21 17:29:12 +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
Sébastien Villemot a142907e44
Particles / Alternative samplers: header fixes and indentation 2021-07-21 16:37:56 +02:00
Johannes Pfeifer 944bf2b68e occbin: work with non-demeaned data and in constraints 2021-07-21 13:42:38 +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
Sébastien Villemot d5c35e3664
Occbin: fix function header 2021-07-19 15:30:54 +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) 1d60c271d7
Add trap if equation has leads.
NLS estimation does not work if the equation has expected variables.
2021-07-15 17:36:02 +02:00
Stéphane Adjemian (Ryûk) 4b7a0ee29e
Change definition of islaggedvariables.
Previous definition could detect lags in an equation without any lag, for
instance if we have the following expression in the RHS: +(-1)*x.
2021-07-15 17:31:55 +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
Johannes Pfeifer b2c6a6f7a1 initial_estimation_checks.m: error out if data is complex
Prevents cryptic message that likelihood became complex
2021-07-14 19:30:50 +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
Stéphane Adjemian (Ryûk) d9298ca03a
Bug fix, wrong definition of the growth neutrality correction...
In PAC equations with optimizing and rule of thumb agents (division
by lambda was missing). Also add comments.
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 43607acf38
Merge branch 'resolveheader' of git.dynare.org:JohannesPfeifer/dynare
See merge request !1875
2021-06-16 17:41:40 +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 820df39ff7
Compatibility fix for MATLAB < R2019b
MATLAB < R2019b does not accept “bar(1, [2 3])”.
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
Johannes Pfeifer 32e1f34579 dynare_resolve.m: correct header and change naming of globals 2021-06-16 13:17:29 +02:00
Stéphane Adjemian (Ryuk) 8611143409
Updated particles submodule (fix for the online filter). 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
Stéphane Adjemian (Ryuk) edeb7911f3
Fix bug (initial period in extended path).
extended_path was crashing in preceeded by a call to the set_time command.
2021-06-15 14:24:38 +02:00
Sébastien Villemot be38866487
Fix handling of heteroskedastic_shocks block with several declared periods
Closes: #1791
2021-06-15 12:54:54 +02:00
Johannes Pfeifer e5b51f3257 DsgeSmoother.m: header cosmetics
[skip CI]
2021-06-15 11:16:41 +02:00
Sébastien Villemot 6258699060
Merge branch 'disclyap' of git.dynare.org:JohannesPfeifer/dynare
See merge request !1872
2021-06-14 15:29:01 +02:00
Sébastien Villemot 68bca0cd2a Merge branch 'pruned_state_space' into 'master'
pruned_state_space: handle shocks with 0 variances

See merge request Dynare/dynare!1871
2021-06-14 10:37:45 +00:00
Johannes Pfeifer e8c3758fc7 disclyap_fast.m: fix check for convergence with NaN
[skip CI]
2021-06-11 14:22:10 +02:00
Johannes Pfeifer 0116870399 pruned_state_space: handle shocks with 0 variances 2021-06-11 14:15:31 +02:00
Sébastien Villemot 45933779a4 Merge branch 'simult_' into 'master'
simult_.m: fix error message at order>3

See merge request Dynare/dynare!1870
2021-06-10 15:24:45 +00:00
Johannes Pfeifer 907066ae95 simult_.m: fix error message at order>3 2021-06-10 14:40:19 +02:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Sébastien Villemot 4733d97ceb
dseries: fix concatenation with empty dates objects 2021-06-09 17:33:25 +02:00
Sébastien Villemot 04c3fb3a31
Merge branch 'slice_record' of git.dynare.org:JohannesPfeifer/dynare
See merge request !1869
2021-06-09 14:41:03 +02:00
Johannes Pfeifer f38a1edaee posterior_sampler.m: trap case where record.ProposalCovariance is not filled (slice sampler) 2021-06-08 21:03:08 +02:00
Johannes Pfeifer e546d686eb dynare_solve.m: allow calling function directly 2021-06-04 21:24:53 +02:00
Johannes Pfeifer 4e0f2bf695 dynare_solve.m: have csolve honor selected options 2021-06-02 16:21:16 +02:00
Johannes Pfeifer f4c0781f45 calibrate_mh_scale_parameter.m: Expand header 2021-06-01 11:34:39 +02:00
Johannes Pfeifer f51a57374a mh_tune_jscale: fix display of stepsize and provide warning if no updating can occur. 2021-06-01 11:23:07 +02:00
Johannes Pfeifer fad86785da evaluate_planner_objective.m: do not evaluate non-existing terms for linear models
Closes https://git.dynare.org/Dynare/dynare/-/issues/1781
2021-05-28 17:00:44 +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
MichelJuillard 5ab724d38f
Following a change in the calling sequence. Fixes #1789 2021-05-28 13:49:58 +02:00
Stéphane Adjemian 77612e6bb7 Merge branch 'particle' into 'master'
non_linear_dsge_likelihood.m: filter out explosive initial simulation

See merge request Dynare/dynare!1861
2021-05-28 11:42:24 +00: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
Johannes Pfeifer cac6f82e34 non_linear_dsge_likelihood.m: filter out explosive initial simulation 2021-05-27 21:04:35 +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 7541b1b116 prior_draw.m: cosmetic fix 2021-05-27 16:46:40 +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
Sébastien Villemot ae574fff78 Merge branch 'diagnostics' into 'master'
model_diagnostics.m: only provide message if imaginary component reaches tolerance level

See merge request Dynare/dynare!1855
2021-05-27 14:23:55 +00:00
Stéphane Adjemian (Charybdis) 3e7cd877d3
Fix error message consistently with 2743ca8fd.
[skip ci]
2021-05-26 19:11:01 +02:00
Stéphane Adjemian (Charybdis) 2743ca8fdb
Fix workspace if dynare is called from a function. 2021-05-26 19:07:44 +02:00
Marcoo Ratto 1645f38269
Implement heteroskedastic filter and smoother 2021-05-26 18:45:16 +02:00
Sébastien Villemot ba3522a9ba Merge branch 'compute_decision_rules' into 'master'
Use of the compute_decision_rules function to factorize code

See merge request Dynare/dynare!1856
2021-05-25 16:18:43 +00:00
Selma Malmberg 9c6cc04b0d Use of the compute_decision_rules function to factorize code (Ref.#1173) 2021-05-20 11:36:29 +02:00
Johannes Pfeifer 7e72b52677 model_diagnostics.m: only provide message if imaginary component reaches tolerance level 2021-05-20 11:23:48 +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
Johannes Pfeifer 7d4b01883d get_identification_jacobians.m: remove unnecessary reordering of equations 2021-05-14 13:35:01 +02:00
Johannes Pfeifer c8bc12ab6c forcst.m: fix case with measurement error 2021-05-12 17:44:35 +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
Johannes Pfeifer cc045caa6f
loglinear: Take care of non-logged lagged/leaded exogenous variables
Closes: #1783
2021-05-11 17:47:25 +02:00
Johannes Pfeifer 5a2fbe2f89 dynare.m: remove non-working line feed 2021-05-11 14:24:02 +02:00
Sébastien Villemot bdb743eaa7
Merge branch 'rattoma/dynare-fast_realtime_shock_decomp'
Closes !1842
2021-05-10 15:55:28 +02:00
Marco Ratto 2d39991a0a
allow for a more accurate (and more expensive) fast realtime modality, triggered by fast_realtime=INTEGER_VECTOR and where vector fast_realtime controls periods for which the smoother is run. If max(fast_realtime)<nobs, the smoother is also run for the full sample. Manual updated accordingly. 2021-05-10 15:55:03 +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 088fd64114
Merge branch 'rattoma/dynare-smoother_fixes'
Ref. !1847
2021-05-07 16:35:36 +02:00
Marco Ratto 551917581f
Bug fixes in fitered variances of smoother
- kalman_algo=1: kstep-ahead variances were WRONG, since Pf was initialized using P in PREVIOUS period
- kalman_algo=2: output argument for filtered varainces should be P1, not P (P are UPDATED variances, there).

For kalman_algo=2, also make a small factorization fix (compute P(:,:,t+1) before defining Pf, so to compute 1-step ahead variance only once)
2021-05-07 16:34:53 +02:00
Marco Ratto d43a057af3
store_smoother_results: fix header explanation of output arguments
Variances are now in declaration order.
2021-05-07 16:34:35 +02:00
Sébastien Villemot ca43df16e0 Merge branch 'dot_error' into 'master'
Filter out "Dot indexing is not supported for variables of this type." error...

See merge request Dynare/dynare!1846
2021-05-06 14:49:39 +00:00
Sébastien Villemot 58db4a4c21
Merge branch 'rattoma/dynare-parallel_without_psexec'
Ref. !1843
2021-05-06 16:31:15 +02:00
Marco Ratto 9ed9aa5963
For local clusters only, allow using start instead of psexec with windows, to properly allocate affinity when there are more than 32 cores. Manual updated accordingly. 2021-05-06 16:31:06 +02:00
Johannes Pfeifer f43ee91ed8 Filter out "Dot indexing is not supported for variables of this type." error if variable conflicts with namespace 2021-05-06 10:59:19 +02:00
Sébastien Villemot f9fb3bb386
Octave compatibility fix: xlswrite() from the io package does not return a 2nd output 2021-05-05 15:47:14 +02:00
Sébastien Villemot 96ad0fbec5
SUR / pooled OLS: workaround for Octave bug in dbstack(N)
See https://savannah.gnu.org/bugs/?60531

By the way, also add a safety check in pooled OLS for the case where the
function is directly called from the top-level.
2021-05-05 15:27:15 +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 0a7d60e7a6
Stochastic solution under block decomposition: minor simplification 2021-05-04 16:33:15 +02:00
Sébastien Villemot f617631b68 Merge branch 'mode_compute6' into 'master'
gmhmaxlik.m: show mode value in addition to change in mode

See merge request Dynare/dynare!1845
2021-05-04 09:12:27 +00:00
Johannes Pfeifer 9a4bbfef09 gmhmaxlik.m: show mode value in addition to change in mode 2021-05-03 20:33:21 +02:00
Sébastien Villemot 1e4d2f5aef
dseries: fix double() method for dates at yearly frequenc
Ref. dseries#47
2021-05-03 15:03:42 +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
Sébastien Villemot 0cef790498
Preprocessor: fix treatment of “series” option of “initval_file”
As a consequence, adapt histval_initvalf.m to the new format.
2021-04-20 10:44:18 +02:00
Stéphane Adjemian (Charybdis) 6fe97182da
Deactivate unit tests for gamrnd if statistical toolbox is available. 2021-04-09 12:44:59 +02:00
Stéphane Adjemian (Charybdis) 237aa465d2
Fix precision in perfect_foresight_solver for backward models. 2021-04-08 20:31:40 +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
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 d5c8e8115e
Preprocessor update
— Properly escape some characters in JSON. As a consequence, remove the
  workaround that was in matlab/loadjson_.m
— Fix JSON output for load_params_and_steady_state
— Add maximum lead/lag and varobs to JSON output
2021-04-08 14:51:49 +02:00
Stéphane Adjemian (Charybdis) 3a823c488f
Fix PAC equations with lags on exogenous variables. 2021-04-02 15:52:30 +02:00
Johannes Pfeifer 3c11ee9581 posterior_sampler.m: make sure proposal density fields are set in parallel 2021-03-25 17:11:48 +01:00
Sébastien Villemot a42a9fff75 Merge branch 'foresight_debug' into 'master'
perfect foresight: provide debugging information for singular Jacobian

Closes #1732

See merge request Dynare/dynare!1834
2021-03-22 09:41:24 +00:00
Sébastien Villemot baa6c8dbbd
Provisions for MATLAB R2021a 2021-03-17 17:47:27 +01: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
Sébastien Villemot 47477e152a
Bump minimal Octave version to 6.2.0 2021-03-12 16:21:57 +01:00
Stéphane Adjemian (Charybdis) 3859ea0de0
Fix read_key_value_string if commas are followed by spaces. 2021-02-26 17:50:47 +01:00
Stéphane Adjemian (Charybdis) 6752426809
Bug fixes in particles submodule. 2021-02-26 10:40:37 +01:00
Stéphane Adjemian (Charybdis) 9e37e07075
Updated dseries submodule (time aggregation routines). 2021-02-26 09:44:24 +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
Sébastien Villemot 75882bcc11
Improve command suggestion for installing statistics package from Octave Forge
The “io” package is a dependency, hence must be explicitly installed first.

[skip ci]
2021-02-19 14:24:32 +01:00
Sébastien Villemot 3939544498
Remove remnants from estimation DLL 2021-02-18 14:26:10 +01: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
Sébastien Villemot 6d95abdb95
Merge remote-tracking branch 'origin/JohannesPfeifer-master-patch-11225'
Ref. !1830
2021-02-16 16:58:04 +01:00
Sébastien Villemot 9ddad32e4e
Merge branch 'shock_decomp_fixes' of git.dynare.org:rattoma/dynare
Ref. !1829
2021-02-16 16:56:52 +01:00
Sébastien Villemot 9d06016dc3
Merge branch 'fixes_4.7' of git.dynare.org:rattoma/dynare
See !1827
2021-02-16 16:55:31 +01:00
Nikola Bokan 592cd69e25
Bug-fix: staticmodel type. 2021-02-16 15:06:43 +01:00
Johannes Pfeifer 99c7d88c53 dyn_forecast.m: set first_obs and allow for Bayesian smoother input 2021-02-16 11:26:35 +01:00
Johannes Pfeifer 6b2555f0ad smoother2histval: fix computation of data length 2021-02-16 09:00:11 +00:00
Marco Ratto 50e80fe496 write xls output in Output subdir 2021-02-16 09:56:22 +01:00
Johannes Pfeifer a0d0270679 smoother2histval.m: suppress output
[skip CI]
2021-02-16 08:11:13 +00:00
Marco Ratto f592cca59d fixed wrong naming of shock decompositions 2021-02-13 19:07:28 +01:00
Marco Ratto b1ae98845d fixed bug in var list for expand menu 2021-02-13 19:07:02 +01:00
Marco Ratto dbcdaf75a6 fixed bug when SteadyState is not used for shock decompositions
fixed names of files, removing spaces and dots
use writetable with mac OS
2021-02-13 19:05:54 +01:00
Marco Ratto c8cd0a06ce allow to export expand groups to excel (instead than plotting them) 2021-02-13 19:04:39 +01:00
Marco Ratto f8b8ec6c18 fixes around init2shocks in plotting utilities 2021-02-13 19:04:01 +01:00
Marco Ratto faa203e029 condition computation of posterior statistics also to (options_.load_mh_file && ~options_.load_results_after_load_mh) and apply it to all cases 2021-02-13 18:53:17 +01:00
Marco Ratto 5c3b0ebc95 better handle newrat options, avoiding to treat newratflag in two places 2021-02-13 16:44:50 +01:00
Marco Ratto 915502ce13 copyright year and indentation 2021-02-13 11:29:40 +01:00
Marco Ratto d56bba724c autocov is initialized NaN with the original order and then only loop up to updted order compatible with sample size. 2021-02-13 11:27:18 +01:00
Marco Ratto 15ab85788c adjusted message in case of diffuse filter, where cointegration is most of the time the reason for such a warning 2021-02-12 19:10:45 +01:00
Marco Ratto 22ef0b1413 get statistics also when load_mh_file 2021-02-12 18:55:50 +01:00
Marco Ratto b9a6462462 bug fix in trapping option newratflag 2021-02-12 18:54:07 +01:00
Marco Ratto ebec3ede8a allow negative lag (i.e. a lead) 2021-02-12 18:50:55 +01:00
Marco Ratto 1519e4673a trap case when order is too big wrt sample size 2021-02-12 18:49:33 +01:00
Sébastien Villemot 2ee03c7e28
OLS: Octave compatibility fix
Cell arrays cannot be used for derefencing fields in a structure.

For some unknown reason, this was nevertheless accepted by MATLAB in this
context.
2021-02-04 16:54:09 +01:00
Sébastien Villemot 78fdd50894
cherrypick.m: Octave compatibility fix
The plus sign (+) was unescaped in the regular expression, which was confusing
Octave.

By the way, also remove unneeded parenthesis groupings.
2021-02-04 16:01:54 +01:00
Sébastien Villemot 901d8355e3
PAC iterative OLS: compatibility fix for Octave < 6 2021-02-04 16:01:30 +01:00
Sébastien Villemot 50a7507f9b
options_.bnlms.set_dynare_seed_to_default is a boolean 2021-02-04 12:37:36 +01:00
Sébastien Villemot 8e9085eea4
PAC NLS estimation: Octave compatibility fix
In regular expressions, the end-of-word operator (\>) does not behave the same
under Octave and under MATLAB. See:
https://savannah.gnu.org/bugs/index.php?59992

In this case, we can simply drop the \> operator, since there is no risk of
matching a partial variable name (since there is already “(-1)” at the end of
the pattern).

By the way, remove a useless parenthesis grouping in the regexp.
2021-02-02 17:02:04 +01:00
Sébastien Villemot 7bbe67748b
simul_backward: Octave compatibility fix 2021-02-02 17:02:04 +01:00
Sébastien Villemot 00e36dd342
var_expectation.update: Octave compatibility fix
There was a conflict between matlab/+var_expectation/update.m and
matlab/+var_expectation/+update/. So we renamed the (single) file in the latter
directory.
2021-02-02 17:01:59 +01:00
Sébastien Villemot 44a2e6463b
lyapunov_solver: increase tolerance for 2 unit tests, for MATLAB R2014a 2021-02-02 15:05:41 +01:00
Sébastien Villemot 1bb5612474
Merge branch 'resol' of git.dynare.org:JohannesPfeifer/dynare 2021-01-29 15:34:57 +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
Sébastien Villemot 3e6224e0b6
plot_contributions.m: compatibility fixes for Octave
— use zeros instead of NaNs when decomposing between positive and negative
  contributions; otherwise some contributions are not plotted
— the bar() function returns a column-vector of graphic handles, while on
  MATLAB it returs a row-vector
2021-01-29 15:20:18 +01:00
Sébastien Villemot 5da473ac66
plot_contributions.m: compatibility fix for MATLAB ≤ R2019a 2021-01-29 14:55:06 +01:00
Sébastien Villemot dcfd45bd25
missing/unique_stable.m: also support cell arrays and 2nd output argument
Needed by aggregate.m.
2021-01-29 14:06:40 +01:00
Sébastien Villemot 3e98918690
aggregate.m: compatibility fix for MATLAB R2014a
The importdata function returns empty lines on R2014a, while it omits them in
R2020a. Moreover, importdata is not meant to parse arbitrary text file. We thus
replace it by repeated calls to fgetl.
2021-01-29 12:29:39 +01:00
Sébastien Villemot 5fc29ace8f
Merge branch 'octave_typo' of git.dynare.org:JohannesPfeifer/dynare 2021-01-29 11:19:13 +01:00
Johannes Pfeifer 585781bd4c dynare_minimize_objective.m: use analytic gradient if specified
Bug introduced in ce3e4412

[skip CI]
2021-01-29 11:10:59 +01:00
Sébastien Villemot 20c00d5a02
dynare_minimize_objective: fix analytic derivatives in mode_compute=13 for Octave and MATLAB < R2016a 2021-01-29 11:02:23 +01:00
Johannes Pfeifer 827a7fcaa8 resol.m: reduce inheritance of decision rule info 2021-01-29 10:16:04 +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 3e7c0b1eef
Merge branch 'optimizer' of git.dynare.org:JohannesPfeifer/dynare 2021-01-28 16:54:58 +01:00
Sébastien Villemot 6ac1af7035
Merge branch 'filtered_variables' of git.dynare.org:JohannesPfeifer/dynare 2021-01-28 16:53:30 +01:00
Johannes Pfeifer ce56305318 mr_hessian.m: only compute inverse of A once 2021-01-28 15:07:05 +01:00
Johannes Pfeifer b56b7760b1 mr_hessian.m: don't manually increase run index of loop 2021-01-28 15:06:32 +01:00
Johannes Pfeifer 1ca5aad981 mr_hessian.m: account for non-scalar output 2021-01-28 14:45:13 +01:00
Johannes Pfeifer e766ad053e mr_hessian.m: add comments and remove redundant line 2021-01-27 22:13:15 +01:00
Johannes Pfeifer 7df35bca35 newrat.m: only compute eig(hh) if output is actually required 2021-01-27 22:02:45 +01:00
Johannes Pfeifer ef14cdb1e9 mr_hessian.m: remove redundant lines and try-catch statement 2021-01-27 21:42:48 +01:00
Johannes Pfeifer 9a86f316c6 newrat.m: only find index once 2021-01-27 21:38:04 +01:00
Johannes Pfeifer 96b1ca3bee mr_hessian.m: honor Save_files option 2021-01-27 21:38:03 +01:00
Johannes Pfeifer 1fc33a4c63 newrat.m: check for valid initial parameter 2021-01-27 21:38:03 +01:00
Sébastien Villemot 11f7ae2236
Merge branch 'octave_optim' of git.dynare.org:JohannesPfeifer/dynare 2021-01-27 18:28:35 +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 0402c56ee7
Compatibility fix for MATLAB R2014a when estimating with empty estim_params
The tests kalman_filter_smoother/fs2000_smoother_only.mod and
kalman_filter_smoother/fs2000_smoother_only_ns.mod would fail under MATLAB
R2014a.

They both run the estimation command without having declared an estim_params
block.

Their execution would fail in check_bounds_and_definiteness_estimation, at the
point where we check if initial values are below the lower bound.

The problem is that xparam1 would be of size 0×1, while bounds.lb would be
empty (0×0), and the comparison fails on older MATLABs.

The fix consists in ensuring that xparam1 remains of size 0×0 in that case.
2021-01-27 18:25:27 +01:00
Sébastien Villemot 0f19774b55
check_bounds_and_definiteness_estimation: rename last argument to BoundsInfo
The previous name was misleading, since this is not the same as bayestopt_.

The confusion was introduced in cfe1069367.
2021-01-27 18:25:27 +01:00
Johannes Pfeifer 59dd96db83 Bayesian smoother: fix field naming for Filtered_Variables_X_step_ahead
Naming used length of vector instead of actual steps
2021-01-27 17:41:37 +01:00
Johannes Pfeifer ce3e441205 dynare_minimize_objective.m: restore octave compatibility 2021-01-27 14:56:24 +01:00
Sébastien Villemot 8f47b276a0
Merge branch 'online_filter' of git.dynare.org:JohannesPfeifer/dynare 2021-01-26 16:54:03 +01:00
Johannes Pfeifer 847eb8050a Check measurement error for mode_compute=11 2021-01-26 16:51:39 +01:00
Sébastien Villemot e1bdc87ff9
Merge branch 'lmmcp' of git.dynare.org:JohannesPfeifer/dynare 2021-01-26 16:27:43 +01:00
Johannes Pfeifer c304dea35f stoch_simul.m: filter out mcp-tag solvers 2021-01-26 11:40:46 +01:00
Johannes Pfeifer a5c8fa54b6 dsge_likelihood.m: error out with non-empty gradient for analytic_derivation
Matlab optimizers require it
2021-01-26 08:31:31 +01:00
Sébastien Villemot 09f992d584
Merge branch 'moments_varendo' of git.dynare.org:JohannesPfeifer/dynare 2021-01-25 18:18:46 +01:00
Sébastien Villemot f9437f89c2
Merge branch 'analytic_derivation' of git.dynare.org:JohannesPfeifer/dynare 2021-01-25 18:17:52 +01:00
Sébastien Villemot 992e375bfa
Merge branch 'use_mh_covariance' of git.dynare.org:JohannesPfeifer/dynare 2021-01-25 18:16:23 +01:00
Johannes Pfeifer 1245d41a6a moments_varendo: store var_list in files
Allows identifying changes in var_list in the future
2021-01-25 15:56:44 +01:00
Johannes Pfeifer c27c4fd932 moments_varendo: delete stale files from previous runs 2021-01-25 15:55:10 +01:00
Johannes Pfeifer 1ee788e61b dynare_minimize_objective.m: reorder 13 to come before 101 2021-01-24 17:41:17 +01:00
Johannes Pfeifer 25803a6842 dynare_minimize_objective: fix use of analytic derivatives by employing wrapper function 2021-01-24 17:40:24 +01:00
Johannes Pfeifer ff4278070a dynare_minimize_objective.m: replace optimset by optimoptions to allow for both Pre and post R2016a option names 2021-01-24 09:21:09 +01:00
Johannes Pfeifer d2a55d1e49 method_of_moments: adapt analytic jacobian output to interface used elsewhere 2021-01-24 09:21:09 +01:00
Johannes Pfeifer 2b79eb2850 solvopt.m: suppress incidental output 2021-01-24 09:21:08 +01:00
Johannes Pfeifer 916058cbfd initial_estimation_checks.m: Do not allow quadratic equation solver for non-quadratic problems 2021-01-24 09:21:08 +01:00
Johannes Pfeifer b652b6d932
csminwel1.m: two small fixes
- gh always exists, no need to check
- allow having non-bad gradient in first iteration
2021-01-23 22:18:45 +01:00
Johannes Pfeifer 5bee25c06e
weibull prior: fix second derivative output and suppress display of output 2021-01-23 09:57:17 +01:00
Johannes Pfeifer 82aa669b30
prior densities: make sure derivative output has correct dimensions 2021-01-23 09:57:17 +01:00
Stéphane Adjemian (Charybdis) 2b7dbff459
Cosmetic change.
[skip ci]
2021-01-23 09:53:54 +01:00
Johannes Pfeifer f19decf297
non_linear_dsge_likelihood.m: consistently use options_.particles.pruning
Closes https://git.dynare.org/Dynare/dynare/-/issues/1756
2021-01-22 21:19:07 +01:00
Johannes Pfeifer 29537b761b
csminwel1.m: fix bug with user-supplied gradient function
transformation to function handle made subsequent ischar-checks non-functioning
2021-01-22 21:19:07 +01:00
Johannes Pfeifer de16e9c00a
dynare_estimation_1: restore exiting with mode_compute=0 and order=1 2021-01-22 21:19:07 +01:00
Johannes Pfeifer ade1dfce5e
compute_moments_varendo: cosmetic fix to display 2021-01-22 21:19:07 +01:00
Johannes Pfeifer b38d6f8139
compute_moments_varendo: use pruned state space at higher order 2021-01-22 21:19:07 +01:00
Johannes Pfeifer 314948ce34
compute_moments_varendo: skip computations for various unsupported cases 2021-01-22 21:19:07 +01:00
Johannes Pfeifer dedfd0c08f
compute_moments_varendo: skip variance decomposition at higher order 2021-01-22 21:19:07 +01:00
Johannes Pfeifer 9f903db283
disp_th_moments_pruned_state_space.m: cosmetic fix to header 2021-01-22 21:19:07 +01:00
Johannes Pfeifer 417f038cc5
Particle filters: do not compute Kalman smoother
Related to https://git.dynare.org/Dynare/dynare/-/issues/1757
2021-01-22 21:19:07 +01:00
Johannes Pfeifer 0b87f66443
non_linear_dsge_likelihood.m: do not set use_k_order_solver with pruning
local_state_space_iteration_k does not support it, use local_state_space_iteration_2 at order=2 instead and error out with order=3
2021-01-22 21:19:07 +01:00
Sébastien Villemot dfa6359dd3
Merge branch 'solve_opt' of git.dynare.org:JohannesPfeifer/dynare 2021-01-22 18:33:12 +01:00
Sébastien Villemot 565d61aad3
Merge branch 'kalman_analytic_bug' of git.dynare.org:JohannesPfeifer/dynare 2021-01-22 18:32:42 +01:00
Sébastien Villemot 35df056905
histval_file: workaround for bug in MATLAB ≤ R2019a
Ref. dseries#45
2021-01-22 18:31:31 +01:00
Johannes Pfeifer 731a168f69 Make mh_tune_jscale work with use_mh_covariance_matrix 2021-01-22 15:01:23 +01:00
Johannes Pfeifer fa739c3a63 posterior_sampler_initialization.m: update record if different sampler is used
Also removes redundant field
2021-01-22 15:01:23 +01:00
Johannes Pfeifer c78890d5ca posterior_sampler_initialization.m: Allow running different samplers after each other
Transform error to warning
2021-01-22 15:01:22 +01:00
Johannes Pfeifer 32bdb82cf8 Make load_mh_file honor use_mh_covariance option 2021-01-22 15:01:02 +01:00
Johannes Pfeifer a89f21b53d solvopt.m: prevent returning with inf 2021-01-22 14:56:49 +01:00
Johannes Pfeifer 371fdb227b solvopt.m: use gradient as second output instead of expecting separate function 2021-01-22 14:56:49 +01:00
Johannes Pfeifer c6c9b4e356 kalman_filter.m: fix bug when using analytic_derivation 2021-01-22 14:54:17 +01:00
Sébastien Villemot bc053018a0
Remove risky steady state (unfinished) code
Incidently, remove the possibility of passing model derivatives as arguments to
the k_order_perturbation. That possibility was only used by the risky steady
state code.

Closes: #1338
2021-01-22 11:32:36 +01:00
Sébastien Villemot cc38c4e9f7
Merge branch 'kalman_headers' of git.dynare.org:JohannesPfeifer/dynare 2021-01-19 17:29:24 +01:00
Sébastien Villemot 315bfa6f51
SUR OLS: compatibility fix for MATLAB R2014a
Under MATLAB R2014a, the strjoin() function wants a 1×n cell array, and rejects
a n×1 cell array. Octave and MATLAB R2020b are more permissive.
2021-01-19 16:27:28 +01:00
Sébastien Villemot 57326339e9
SUR Gibbs: do not try to create plot under Octave and MATLAB < R2014b
The histogram() function does not exist there.
2021-01-19 16:27:26 +01:00
Sébastien Villemot f81b330f14
Methods of moments: compatibility fix for MATLAB < R2015a
The mean(…, 'omitnan') syntax does not exist before R2015a. Use nanmean
instead (either provided by the statistics toolbox, or by our fallback under
matlab/missing/stats/).
2021-01-19 15:50:14 +01:00
Sébastien Villemot 4944a711db
MATLAB R2014a compatibility: fix crash of rplot with several variable names
Under MATLAB R2014a, the strjoin() function wants a 1×n cell array, and rejects
a n×1 cell array. Octave and MATLAB R2020b are more permissive.
2021-01-19 15:50:14 +01:00
Sébastien Villemot f946baf6c5
Testsuite: add workaround for crash of MATLAB R2014a with TeX option
The TeX option crashes MATLAB R2014a run with "-nodisplay" option
(as is done from the testsuite). We disable the TeX option in that case.

Since we can’t directly test whether "-nodisplay" has been passed, we test for
the "TOP_TEST_DIR" environment variable, which is set by the testsuite.

Note that it was not tested whether the crash happens with more recent MATLAB
versions, so when OLD_MATLAB_VERSION is increased, one should make a test
before removing this workaround.
2021-01-19 15:50:11 +01:00
Johannes Pfeifer 869147c13a Kalman filter functions: clarify header comments 2021-01-18 17:33:21 +01:00
Stéphane Adjemian (Charybdis) 38e300b94e
Merge #1786.
Do not compute cholesky decomposition of H if the matrix has zeros on
the diagonal.
2021-01-16 11:24:10 +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
Johannes Pfeifer fe93589148
non_linear_dsge_likelihood.m: return in case of exception without computing prior 2021-01-15 22:11:20 +01:00
Stéphane Adjemian (Charybdis) b3e8dbe018
Do not rely on internal representation of @dates, use methods instead...
... Or add a new method if one is missing.
2021-01-15 20:44:09 +01:00
Sébastien Villemot 4c0b2e8c4e
Mitigation for spurious warning in Octave
Because of a bug, Octave wrongly complains that matlab/+pac/+bgp/{get,set}.m
shadow built-in functions (see https://savannah.gnu.org/bugs/?46849).

We disable the warning as early as we can after running the dynare command.
However the warning will nevertheless appear two times in a given Octave
session (the first time when the addpath to Dynare is done, the second time
when the dynare command is run).
2021-01-15 18:08:04 +01:00
Sébastien Villemot e26a5e2805
NLS: compatibility fix for Octave and MATLAB < R2014b 2021-01-15 17:42:00 +01:00
Sébastien Villemot 547969df45
Trust region: compatibility fix for Octave and MATLAB < R2017b
When merging the enterprise code, the dogleg subfunction was modified to
incorporate a call to decomposition(), which does not exist under Octave and
MATLAB < R2017b.

For those cases, we reinstate the old code (which uses a plain matrix right
divide).
2021-01-15 17:30:17 +01:00
Sébastien Villemot 8f07a134a3
OLS + aggregate: compatibility fix for Octave < 6
unique(…, 'stable') does not exist in Octave 5.
2021-01-15 17:19:38 +01:00
Stéphane Adjemian (Charybdis) 6c5d61355b
Updated dseries submodule (new implementation of @dates). 2021-01-15 12:46:02 +01:00
Willi Mutschler 52a57eaf60
MoM: Remove duplicate check in gradient helper function 2021-01-14 14:17:55 +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
Sébastien Villemot 6639cd8a41
Merge branch 'MoM' of git.dynare.org:JohannesPfeifer/dynare 2021-01-13 15:59:05 +01:00
Sébastien Villemot 7476d741a2
Merge branch 'estimation_forecast' of git.dynare.org:JohannesPfeifer/dynare 2021-01-13 15:58:25 +01:00
Stéphane Adjemian (Odysseus) f4508a6ca1 Revert "update jacob_element & hess_element for vector arguments"
This reverts commit 1975e467b5.
2021-01-12 16:48:49 +01:00
Stéphane Adjemian (Odysseus) 47affc94e1 Revert "Matrix notation: fix bug in numerical Hessian of external functions"
This reverts commit 2acacf61f1.
2021-01-12 16:48:21 +01:00
Stéphane Adjemian (Odysseus) 8fd18fa9ba Merge remote-tracking branch enterprise into master. 2021-01-12 16:45:51 +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 ea03868a6b mode_compute=0: run dyn_forecast after smoother when forecast > 0 2021-01-10 19:46:18 +01:00
Johannes Pfeifer fbb1272164 Fix mode_compute=12 and filter out mode_compute=11 2021-01-10 17:30:35 +01:00
Sébastien Villemot c397828eb7
Merge branch 'smoother2histval' of git.dynare.org:JohannesPfeifer/dynare 2021-01-08 19:02:44 +01:00
Stéphane Adjemian (Charybdis) 18b54dfa98
Updated dseries submodule. 2021-01-07 22:00:51 +01:00
Johannes Pfeifer b2efc7a604 smoother2histval.m: fix bug when variable names are similar 2021-01-07 21:44:06 +01:00
Sébastien Villemot 4434edae0b Merge branch 'MoM_testsuite' into 'master'
Method of Moments: Updates to testsuite

See merge request Dynare/dynare!1799
2021-01-07 19:52:13 +00:00
Willi Mutschler b3e3501a6d
MoM: Fix bug in SMM with ME
Occurs by running RBC_MoM_SMM_ME with mode_compute=9
2021-01-07 14:25:26 +01:00