Sébastien Villemot
c4bc6316d0
Make matlab/missing/mex/mjdgges/mjdgges.m Octave-compatible
...
[skip ci]
2023-04-04 18:40:37 +02:00
Sébastien Villemot
cdb786017b
Preprocessor update
...
– ramsey_policy is now fully implemented at the preprocessor level
– 🐛 ramsey_policy: lift restriction that order must be ⩽ 2
– 🐛 Extend incompatibility with deterministic exogenous to ramsey_model command
2023-03-29 16:26:02 +02:00
Sébastien Villemot
534515dc66
dyn_ramsey_static.m: simplifications + improve comments
2023-03-29 14:33:01 +02:00
Sébastien Villemot
ffe6eb4d40
Preprocessor: overhaul of M_ fields counting Ramsey/discretionary orig endos/eqs
...
– new fields: M_.ramsey_orig_{eq,endo}_nbr
– drop M_.ramsey_eq_nbr and M_.orig_eq_nbr
– new field: M_.discretionary_orig_eq_nbr
2023-03-29 14:33:01 +02:00
Sébastien Villemot
674ebce84b
🐛 Ramsey steady state computation could fail if expectation or diff operator is present
...
If auxiliary variables were created *before* the Lagrange multipliers (e.g. aux
vars related to the expectation or diff operators), then the vector of
residuals of the reduced Ramsey steady state problem (with respect to original
variables, as computed by the dyn_ramsey_static_1 subfunction) was incorrect.
2023-03-29 14:31:01 +02:00
Sébastien Villemot
4291b4f07e
The preprocessor now sets options_.{ramsey,discretionary}_policy in all cases
2023-03-28 18:30:08 +02:00
Sébastien Villemot
69d0aa670b
Preprocessor update
...
– 🐛 Incorrect stochastic transformation with endo lead ⩾ 2 or exo lead ⩾ 1 in
external functions
– New solution for solving the Ramsey steady state with Lagrange multipliers
with lead or lag ⩾ 2. Now generates a dedicated file for derivatives of static
model w.r.t. multipliers using chain rule derivation (#633 , #1119 , #1133 )
– 🐛 Incorrect cost table used when computing temporary terms in static model
with “use_dll”
– 🐛 Crash when writing the (static) set_auxiliary_variables file in the
presence of external functions
2023-03-28 14:49:28 +02:00
Sébastien Villemot
9fa64ee0d4
ramsey_policy and estimation: remove incorrect check about number of instruments
...
These should only be warnings, and they are already implemented in
model_diagnostics (see 39ae080997
).
2023-03-24 12:31:41 +01:00
Sébastien Villemot
43190b001f
Fix typo in commit 647ff5cd20
2023-03-17 18:19:03 +01:00
Sébastien Villemot
4f52ba0dbc
CI: bump to MATLAB R2023a
2023-03-17 16:32:13 +01:00
Sébastien Villemot
13908ee068
Provisions for MATLAB R2023a
2023-03-17 16:32:09 +01:00
Sébastien Villemot
647ff5cd20
MATLAB compatibility: warning subscripting:noSubscriptsSpecified removed in R2023a
2023-03-17 16:03:37 +01:00
Sébastien Villemot
f07d73e63e
CI: use system-wide Octave binary
2023-03-16 17:43:39 +01:00
Sébastien Villemot
816e94e9f9
Octave fix: do not change the global recursive delete confirmation setting
...
Only change the setting locally, as is done in isolder.m and
parallel/dynareParallelRmDir.m.
2023-03-16 17:24:18 +01:00
Sébastien Villemot
060c694066
model_diagnostics: remove workaround for Octave
...
The rank() and null() functions accept a tolerance argument since at least
Octave 3.8.
2023-03-16 17:24:18 +01:00
Sébastien Villemot
441173ec5a
Remove workaround for eig() function under Octave
...
The eig() function has been been able to return the left eigenvectors since at
least Octave 4.4.
2023-03-16 17:24:18 +01:00
Sébastien Villemot
b7477ac0b6
cmaes: remove broken local isoctave() function
2023-03-16 17:24:18 +01:00
Sébastien Villemot
56ffc87e1c
Remove workaround for gaminv() bug fixed in Octave 4.4
...
See #161 and http://savannah.gnu.org/bugs/?52569
2023-03-16 17:24:18 +01:00
Stéphane Adjemian (Ryûk)
6e0a09f5fa
Add interface to flip endogenous and exogenous variables.
...
Calls to change_type can be done in a file named model-inversion-setup.inc in
the current folder. The file is included, between the declaration of the
exogenous variables and the model block, in the aggregate mod file if and only
if the macrovariable InvertModel exists and is equal to True. To invert a model,
the user just has to run the aggregated mod file with -DInvertModel=True on the
command line.
2023-03-16 14:12:21 +01:00
Johannes Pfeifer
c8045e2c5e
model_diagnostics.m: fix logic of using block information
...
Also fixes bug with rank not working with sparse matrices
2023-03-15 18:11:37 -04:00
Sébastien Villemot
ff318d1163
Merge branch 'model_diagnostics' of git.dynare.org:JohannesPfeifer/dynare
...
Ref. !2125
2023-03-13 17:59:43 +01:00
Johannes Pfeifer
39ae080997
model_diagnostics.m: fix logic of Ramsey instrument checks
...
The mapping from economic to steady state instruments is not one-to-one. Trigger warnings instead of errors.
2023-03-13 10:39:06 -04:00
Stéphane Adjemian (Ryûk)
7583790851
Improve error message.
2023-03-09 11:25:04 +01:00
Stéphane Adjemian (Ryûk)
a3b249c375
Update dseries submodule (fill_ method).
2023-03-08 18:16:11 +01:00
Stéphane Adjemian (Ryûk)
0d39cab9e1
Add option to print parameter values.
2023-03-04 22:31:54 +01:00
Stéphane Adjemian (Ryûk)
c006645c7f
Remove output argument.
2023-03-04 20:10:50 +01:00
Stéphane Adjemian (Ryûk)
2ab19c1aa9
Do not compute variables if they are not returned.
2023-03-04 20:10:06 +01:00
Stéphane Adjemian (Ryûk)
656a7bf867
Cosmetic changes.
2023-03-04 18:03:59 +01:00
Stéphane Adjemian (Ryûk)
f6a76066f9
Remove warning.
2023-03-04 17:52:50 +01:00
Stéphane Adjemian (Ryûk)
0b9141fdca
Remove and rename routine (print_equations).
...
Also:
- rename first input argument,
- remove second argument (always expand expectations).
2023-03-04 17:49:33 +01:00
Stéphane Adjemian (Ryûk)
a0d53277c1
Fix condition (variable name can have less than characters).
2023-03-04 17:13:45 +01:00
Sébastien Villemot
f02d66ce7c
moment_function: remove unused function
2023-03-01 16:47:42 +01:00
Sébastien Villemot
a2591c474e
selif: remove unused function
2023-03-01 16:44:05 +01:00
Sébastien Villemot
845eac99d3
bicgstab_: remove unused function
2023-02-17 22:01:32 -05:00
Sébastien Villemot
f5523c7bab
bksupk: remove unused function
2023-02-17 22:01:32 -05:00
Sébastien Villemot
62805b7183
perfect_foresight_simulation + bksup0: remove unused functions
2023-02-17 22:01:32 -05:00
Sébastien Villemot
f938014e84
bksup1: turn into a local function of sim1_lbj
2023-02-17 22:01:32 -05:00
Sébastien Villemot
24f689b2de
restricted_steadystate: turn into local function of evaluate_steady_state_file
2023-02-17 22:01:28 -05:00
Sébastien Villemot
6bddbca01d
bytecode_steadystate: turn into a local function of evaluate_steady_state
2023-02-17 22:01:25 -05:00
Sébastien Villemot
1a421d93dd
steady: turn homotopy{1,2,3} into local functions
2023-02-16 14:22:27 -05:00
Sébastien Villemot
2c44923384
No longer turn off output pagination
...
The “more off” command is incompatible with MATLAB Online.
Moreover, output pagination is disabled by default on MATLAB and on
Octave (since version 4 for the latter), so in most cases that command would do
nothing.
Incidentally, this allows users to enable output pagination should they want
to.
[skip ci]
2023-02-08 11:02:29 -05:00
Sébastien Villemot
65053667cf
New “homotopy_alt_starting_point” option to “perfect_foresight_solver” command
2023-02-07 14:49:00 -05:00
Sébastien Villemot
d6370a6d28
Merge branch 'occbin_init_smo' into 'master'
...
occbin enhancements and bug fixes
See merge request Dynare/dynare!2123
2023-02-07 14:23:14 +00:00
Sébastien Villemot
be698d5f98
Perfect foresight + homotopy: add missing newline
2023-02-06 15:14:02 -05:00
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
f0aa2fb86f
cosmetic change
2023-02-03 14:25:59 +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
783c237d17
evaluate set_prior only when needed
2023-02-03 14:21:02 +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
22e6fb1814
make sure also ALL updated variables in period 1 are reconstructed with smoother_redux. test model changed accordingly.
2023-02-03 14:20:28 +01:00
Marco Ratto
7132cb593e
bug fix for init variables to be defined only with occbin PKF
2023-02-03 14:20:16 +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
e51a30eaf5
Bug fix for the case where no prior is defined for estim params
2023-02-03 14:19:50 +01:00
Marco Ratto
a346639020
when filter is NOT diffuse, allow likelihood to handle violation of constraints in period 1.
2023-02-03 14:19:28 +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
74acb2d1f5
bug fix using index t
2023-02-03 14:18:54 +01:00
Marco Ratto
21c9d59e8c
incorporate information about states in period 0 for occbin with smoother_redux
2023-02-03 14:18:32 +01:00
Marco Ratto
0622f01f4e
filter out t=1 when storing aalphahat and eetahat
2023-02-03 14:18:21 +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
Sébastien Villemot
5aca770931
perfect_foresight_with_expectation_errors_{setup,solver}: fix bugs with several exogenous
...
Closes : #1883
2023-01-24 15:02:07 +01:00
Sébastien Villemot
538f38d269
Merge branch 'occbin_debug' into 'master'
...
missing_observations_kalman_filter.m: provide debugging information on PKF problems
See merge request Dynare/dynare!2122
2023-01-23 10:39:17 +00:00
Johannes Pfeifer
4307711c60
missing_observations_kalman_filter.m: provide debugging information on PKF problems
2023-01-19 11:57:35 +01:00
Sébastien Villemot
cfaf5a685d
Preprocessor: actually obey the “mfs” option for the static model
...
As a consequence, fix steady state computation when mfs > 0.
2023-01-17 19:08:32 +01:00
Sébastien Villemot
8aabdaee9c
Consolidate functions for solving steady state with block and/or bytecode
2023-01-17 15:25:47 +01:00
Sébastien Villemot
7b6058509f
Drop unused function
2023-01-17 14:48:36 +01:00
Sébastien Villemot
005769210a
Drop unused function
2023-01-17 14:47:52 +01:00
Sébastien Villemot
5342476196
Drop unused function
2023-01-17 14:46:50 +01:00
Sébastien Villemot
023afc7ebb
Drop unused function
2023-01-17 14:46:46 +01:00
Sébastien Villemot
1c5c1639e1
Drop unused function
2023-01-16 14:38:09 +01:00
Sébastien Villemot
e5f100b152
Drop unused function
2023-01-16 14:38:06 +01:00
Sébastien Villemot
c187d0ead9
Drop unused function
...
It should probably have been removed in 9c6e219990
.
2023-01-16 14:38:03 +01:00
Sébastien Villemot
8f1a4cb363
Drop block-decomposed first-order perturbation solution and kalman filter
2023-01-13 16:57:49 +01:00
Stéphane Adjemian (Ryûk)
91dd917d62
Cosmetic/Efficiency changes.
...
- Use bsxfun for centering data if possible,
- Factorise LU decomposition,
- Remove useless operations during the presampling step.
2023-01-12 17:45:51 +01:00
Sébastien Villemot
e250067959
Use sparse representation for block-decomposed perfect foresight and steady state computation
...
Ref. #1859
2023-01-12 16:28:02 +01:00
Sébastien Villemot
3c55aa57e1
Use sparse representation for evaluating the static model
...
We also take advantage of the fact that the non-block version is always
available next to the block one, so when we are only interested in the residual
as a whole, we simplify by using the non-block version.
2023-01-10 16:21:44 +01:00
Sébastien Villemot
b343f0231d
Ensure that generated sparse MEX files are unloaded before the preprocessor is run
...
This workaround already existed for the legacy representation.
2023-01-10 16:07:29 +01:00
Johannes Pfeifer
0b0a4ef386
dsge_likelihood.m: flag analytical_derivation as incompatible with endogenous_prior
2023-01-09 17:57:18 +01:00
Sébastien Villemot
f84753025d
Bytecode: the block and non-block versions now coexist in parallel
...
As a consequence, a new “block_decomposed” option of the bytecode MEX has been
introduced to explicitly select the block-decomposed version.
Note that we do not always use the “block_decomposed” option even when the
“block” option has been passed to the user, in situations where the block
decomposition brings nothing (e.g. when evaluating the residuals of the whole
model).
2023-01-09 15:20:46 +01:00
Stéphane Adjemian (Ryûk)
b7693c3273
Add routine for conditional likelihood (first order).
2023-01-06 14:57:45 +01:00
Sébastien Villemot
f93a7f7192
Merge branch 'disp_aux_4' of git.dynare.org:JohannesPfeifer/dynare
...
Ref. !2118
2023-01-04 10:59:21 +01:00
Johannes Pfeifer
45450651a2
model_info.m: fix display of block decomposition
2023-01-03 16:17:43 +01:00
Sébastien Villemot
ead9023cec
Merge branch 'steady_nan' into 'master'
...
steady state computation: trap cases where parameters are NaN
See merge request Dynare/dynare!2119
2023-01-03 11:24:26 +00:00
Stéphane Adjemian (Guts)
5b72a3041c
Use new unit tests interface.
2023-01-02 22:58:20 +01:00
Johannes Pfeifer
64d61c3268
steady state computation: trap cases where parameters are NaN
2022-12-28 11:48:23 +01:00
Johannes Pfeifer
1866286fb8
subst_auxvar.m: correctly take care of exo leads and lags
2022-12-21 11:16:41 +01:00
Johannes Pfeifer
1219f085e7
disp_dr.m: fix display for type 4 auxiliaries
2022-12-20 13:06:05 +01:00
Stéphane Adjemian (Ryûk)
aee541aabe
Update dseries submodule.
2022-12-15 17:25:29 +01:00
Johannes Pfeifer
a4634cd1b7
dynare_estimation_init.m: set observable mapping for inversion filter if only smoother is used
2022-12-09 13:19:32 +01:00
Johannes Pfeifer
e7ca989b21
prior_posterior_statistics.m: fix logical condition
2022-12-05 14:52:03 +01:00
Johannes Pfeifer
9de0688cfe
Make default jscale depend on number of estimated parameters
...
Related to https://git.dynare.org/Dynare/dynare/-/issues/1849
2022-12-03 16:00:27 +01:00
Sébastien Villemot
d574705b4a
Design and performance improvement to solve_algo={12,14}
...
Use the new time-recursive block decomposition computed by the preprocessor
for:
- the simulation of backward models with “simul_backward”
- the perfect foresight simulation of purely backward/forward/static models
Also note that in this case, the preprocessor now defaults to “mfs=3” (i.e. it
minimizes the set of feedback variables and tries to renormalize equations).
This replaces the previous algorithm based on Dulmage-Mendelsohn (dmperm), plus
an ad hoc identification of some equations that can be evaluated (those with a
LHS equal to a variable, the log of a variable, or the diff-log of a variable).
By the way, the block_trust_region MEX has been modified so that it accepts a
boolean argument to decide whether it performs a Dulmage-Mendelsohn
decomposition (if not, then it performs a simple trust region on the whole
nonlinear system).
This provides a significant performance improvement (of almost an order of
magnitude for solve_algo=14 on a 700 equations model).
2022-11-30 14:47:57 +01:00
Johannes Pfeifer
bbdcdc89a2
sim1.m: use operation that preserves sparsity
2022-11-28 16:20:44 +01:00
Sébastien Villemot
ba9b0e9829
Merge branch 'occbin_IVF' of git.dynare.org:JohannesPfeifer/dynare
...
Ref. !2019
2022-11-28 11:05:03 +01:00
Stéphane Adjemian (Charybdis)
3aeb1ff7e3
Fix pac.estimate.iterate_ols.
...
Was crashing if the auxiliary model contains a constant.
See https://forum.dynare.org/t/iterative-ols-for-pac-equation/21379 .
2022-11-24 16:29:49 +01:00
Johannes Pfeifer
26fbc6c56d
IVF: improve error handling
2022-11-23 16:46:40 +01:00
Johannes Pfeifer
80f6799c38
IVF: only store smoother results if requested
2022-11-23 16:44:18 +01:00