Commit Graph

333 Commits (b7c74f8e9af9d0a13bbd195a3ff457be4d98e941)

Author SHA1 Message Date
Houtan Bastani 2aa85f978a change dyn_figure to take a nodisplay argument as opposed to options_. #1415 2017-03-23 14:30:16 +01:00
Marco Ratto 99dbc8c74d bug fix with redundant call to prior_bounds 2017-03-22 23:08:18 +01:00
Marco Ratto 1e3e2f70a9 set posterior sampler options when load_mh_file 2017-03-18 00:06:15 +01:00
Stéphane Adjemian (Charybdis) cc34e16458 Set temporarily mode_compute and mh_replic to zero if estim_params_ is empty. 2017-03-16 15:45:08 +01:00
Stéphane Adjemian (Charybdis) 9fbef0c107 Removed penalty_hessian routine.
+ Code factorization.
 + Added an option for using the penalized objective when computing numerically
 the hessian at the mode.

Previous behaviour (introduced with penalty_hessian routine) was to compute the
hessian matrix at the mode with the penalized objective function (instead of
the original objective function). This behaviour hides problematic situations,
where the computed hessian (using the original objective) would not be full
rank. For instance, if the estimation ends up with a parameter on (or very
close to) the bounds of its possible values (which is often not a desirable
outcome), the estimated posterior variance would be zero for this
parameter (with the original objective) because the hessian is not finite in
this direction, while the posterior variance would be positive if the penalized
objective is used instead. But this estimate would not be reliable by
construction of the penalty which is quite ad-hoc (more fundamentally I do not
think that there exists any rational for approximating the covariance matrix
with the inverse of the hessian matrix if the mode is on the border of the set
of possible values).

This commit restore the behaviour previous to 2446ab02ba.

An option is available for computing the hessian with the penalized
objective function.
2017-02-08 13:07:25 +00:00
Johannes Pfeifer 7b4fc9ec4a Moving loading of MCMC_jumping_covariance to after display of standard errors and computation of Laplace approximation
Closes #1255
2016-12-27 12:07:22 +01:00
Johannes Pfeifer 352786c2b4 load_mh_file: recompute results by default and load on request
Prevents general overwriting of results in oo_ and having stale results
2016-12-19 19:37:34 +01:00
Johannes Pfeifer 2f717b5adc Eliminate global variables from shock_decomposition.m 2016-12-18 09:57:51 +01:00
Johannes Pfeifer 98cf1bfc1d Add smoothed state uncertainty to Kalman smoother routines 2016-11-04 09:23:55 +01:00
Johannes Pfeifer 1f0c2e3b1c Make sure that options_.qz_criterium is not affected by calls to dynare_estimation.m 2016-10-02 10:51:47 +02:00
Marco Ratto eae0828a40 make computations around invhess more robust numerically. 2016-09-05 12:16:07 +02:00
Johannes Pfeifer 08d53206a9 Port textwidth figure format change to dynare_estimation_1.m 2016-08-23 17:22:41 +02:00
Johannes Pfeifer 73afe7d02f Change fixed LaTeX figure width into \textwidth scaling
Improves readability
2016-08-23 17:22:41 +02:00
Johannes Pfeifer fa3a71bcae Make warning message in dynare_estimation_1.m more informative 2016-08-22 19:24:35 +02:00
Johannes Pfeifer 6368636ee0 Move Kalman filter options consistency checks to dynare_estimation_init.m 2016-08-22 19:24:35 +02:00
Johannes Pfeifer 8aaca040b3 Expand check of fast_kalman_filter for presence of block-option 2016-08-22 19:24:35 +02:00
Johannes Pfeifer df8ad833fb Transform automatic loading of optimal_mh_scale_parameter.mat into option scale_file
Closes #503
2016-08-22 16:27:32 +02:00
Johannes Pfeifer f2f44a0989 Save log_density at the mode and document oo_.posterior-fields 2016-07-20 20:48:24 +02:00
Johannes Pfeifer 4486d098b5 Save dsge_var objects at the mode 2016-06-15 00:30:28 +02:00
Johannes Pfeifer 2cf882fec5 Remove comments on dynare_estimation_1.m after implementing store_smoother_results 2016-06-15 00:30:28 +02:00
Johannes Pfeifer d08fd37986 Do not set oo_.posterior.optimization-fields when mh_posterior_mode_estimation is used 2016-06-15 00:30:28 +02:00
Johannes Pfeifer 552a9b5230 Fix bugs previously introduces in dynare_estimation_1.m related to penalty function 2016-06-15 00:30:28 +02:00
Johannes Pfeifer 2446ab02ba Transform persistent variables of newrat.m into function arguments 2016-06-15 00:30:28 +02:00
Johannes Pfeifer 329b91d717 Harmonize output of objective functions
Closes #1149
Mirrors 1ad8df4635
2016-06-15 00:30:28 +02:00
Houtan Bastani b454c28096 fix latex compilation on linux. #1207 2016-06-14 11:37:16 +02:00
Stéphane Adjemian (Charybdis) 67b808207c Added new algorithm for the estimation of nonlinear models. 2016-06-01 16:29:53 +02:00
Johannes Pfeifer 2baf88da47 Remove adaptive_metropolis_hastings 2016-05-19 23:16:29 +02:00
Johannes Pfeifer 86fcde0879 Cosmetic changes to dynare_estimation_1.m and store_smoother_results.m 2016-05-19 14:37:05 +02:00
Marco Ratto 7b3c42c6e1 provisions for reworked posterior sampling options:
- handle sub lists of individual samplers
- split checks in dynare_estimation_init.m and before running posterior_sampler.m [invhess checks]
- posterior sampler options checks moved from initial_estimation_checks.m to check_posterior_sampler_options.m
- added use_mh_covariance_matrix to imh and rwmh
- slice re-sets mode_compute=0 cova_compute=0
- updated test function
2016-05-19 14:37:05 +02:00
Marco Ratto 8bd963de64 Fill in posterior_mode with info from posterior samples. 2016-05-19 14:34:09 +02:00
Marco Ratto 46908d20c6 Provisions for new posterior sampler routines that factorize the individual iteration of individual samplers.
I contains a quick fix to adaptive_posterior_sampler.m, which cannot be embedded in the new structure.
2016-05-19 14:34:09 +02:00
Marco Ratto 951dfe8ff4 When mh_posterior_mode_estimation, trap cases where the prior mode is at the boundary. 2016-05-19 14:34:09 +02:00
Marco Ratto a3ab6de6c8 Added function to compute of inefficiency factors, used in McMCDiagnostics.m
Requires missing autocorr (available in some MATLAB toolboxes).
Requires factor out CutSample in dynare_estimation_1.m
2016-05-19 14:34:09 +02:00
Houtan Bastani 25121bca4f fix copyright dates 2016-05-04 16:05:31 +02:00
Johannes Pfeifer 6ad876cc18 Rename write_smoother_results to store_smoother_results.m to avoid confusion about its purpose 2016-04-12 11:37:12 +02:00
Johannes Pfeifer 6f8ca74490 Factorize saving of smoother results
Also takes care of prefilter and loglinear option for calib_smoother
Closes #803 and #804
2016-03-23 10:31:11 +01:00
Johannes Pfeifer fb20b464d4 Remove bayestopt_.mean_varobs and use dataset_info instead
Closes #255
2016-03-23 10:31:09 +01:00
Johannes Pfeifer dcf0d75d55 Add output of trend to DsgeSmoother.m and use it to reconstruct smoothed and filtered values 2016-03-23 10:19:41 +01:00
Johannes Pfeifer 1c816aef24 Various interrelated bugfixes dealing with detrending 2016-03-23 10:19:40 +01:00
Stéphane Adjemian (Charybdis) a1aa2bcd6e Changed second input of prior_bounds routine.
Do not pass options_ structure but only the required field (prior_trunc).
2015-12-11 18:50:54 +01:00
Stéphane Adjemian (Charybdis) 5fb1b1cc23 Added Weibull prior. 2015-12-04 14:50:44 +01:00
Michel Juillard c373d1e1be adding new option 'fast_kalman_filter' implementing Ed Herbst 2012 approach 2015-11-28 17:38:00 +01:00
Michel Juillard 105100c7fe remove global in dyn_forecast() and change input and output arguments 2015-11-28 17:38:00 +01:00
Johannes Pfeifer ca5c714e29 Replace global variables in CutSample.m and metropolis_draw.m by function arguments
Makes them usable outside of their current environment
2015-07-28 15:36:59 +02:00
Johannes Pfeifer 84e04522bf Account for options_.nk potentially being empty. 2015-07-21 10:41:47 +02:00
MichelJuillard 80253835a7 Merge pull request #738 from JohannesPfeifer/Kalman
Kalman
2015-07-20 15:02:40 +02:00
MichelJuillard f94910173d Merge pull request #937 from JohannesPfeifer/graph_fix
Various fixes related to graphs and eps-TeX-loaders
2015-07-20 14:36:20 +02:00
MichelJuillard c15e8f65c7 Merge pull request #769 from JohannesPfeifer/filtered_vars_ML
Do not create classical filtered variables at posterior mean if Bayesian...
2015-07-20 14:21:30 +02:00
Johannes Pfeifer b0bbab68f3 Add likelihood value to mode-file 2015-07-20 13:06:22 +02:00
Johannes Pfeifer bcc1008d3d Only create eps-loaders if eps-figures have been created (leaves table TeX-output unaffected) 2015-06-08 17:57:15 +02:00
Johannes Pfeifer be567c92a3 Fix description of generating function in eps-loader in dynare_estimation_1.m 2015-06-08 17:57:15 +02:00
Johannes Pfeifer 3c9b031bd1 Fix bug in dynare_estimation_init.m if steady state does not solve
There was no check in dynare_estimation_init.m whether the steady state solved, but the noconstant option was set nevertheless. This gave rise to cases where a steady state file returned 0 for the observables, but the steady state did not exits. Due to later using use_calibration, this problem with the initial values was not detected, but the observation equation featured no constant although it should. The solution is to move the use_calibration option before the first steady state computation and then issue an error if the parameterization does not work
2015-06-08 16:35:50 +02:00
Frédéric Karamé df67efcb7c add an exception for the use of gaussian filters and gradient-based estimation methods 2015-05-27 14:37:50 +02:00
Johannes Pfeifer 39ed3eb3f0 Fix bugs related to allowing mode_compute to be a string
Crashes otherwise
2015-04-06 11:24:42 +02:00
Marco Ratto c881cfff17 Fixed issues related to newratflag.
This options relates to alternative numerical hessian computations:

optim=('Hessian',1) is the default dynare numeric Hessian
optim=('Hessian',0) is the outer product gradient
optim=('Hessian',2) is the 'mixed' outer product gradient, where diagonal elements using second order derivation formula,

Both 0 and 2 cases require univariate filters, to ensure using maximum number of individual densities.
2015-03-12 17:24:21 +01:00
Johannes Pfeifer fe938c902a Fixed another bug related to options_.optim_opt being now initialized as an empty array
Finalizes  392486273e
2015-03-01 13:34:39 +01:00
Stéphane Adjemian (Charybdis) 0bb413e8fa Merge branch 'experimental-optimizers' 2015-02-24 20:44:39 +01:00
Stéphane Adjemian (Charybdis) 0ffb9dd6e2 Changed order of the input arguments in dynare_mimimize_objective.
It is more standard to have the name of the routine (defining the
objective to be minimized) as a first argument.
2015-02-23 14:35:41 +01:00
Stéphane Adjemian (Charybdis) 5865d46a74 Fixed bug. Wrong number of returned arguments when calling
dynare_minimize_objective (missing options_).
2015-02-21 18:14:15 +01:00
Houtan Bastani f72910ae33 fix preprocessor implimentation of filter_algorithm option to estimation. closes #843 2015-02-09 03:20:37 +01:00
Johannes Pfeifer dc7cfd3f0d Adjust smoother to data now being a column vector 2014-12-08 11:28:46 +01:00
Johannes Pfeifer dd6f8c182c Move call to optimizers in mode-computing to separate file to allow other function to access all integrated optimizers
- also moves several options to subfields of options structure
- allows setting options of newrat
- requires newrat to have compatible kalman_algo specified in order for it to not change options_
- explicitly disallows using analytical derivation with numerical gradient (before the numerical gradient request was overwritten)
- always outputs hessian returned by optimizer (empty matrix if not computed) and deletes subsequent overwriting if cova_compute=0
2014-12-04 19:36:12 +01:00
MichelJuillard 8e9cd95a89 Merge pull request #760 from JohannesPfeifer/fix_smoother
Fix bug when calling non-Bayesian smoother after Bayesian estimation
2014-11-20 10:27:15 +01:00
Johannes Pfeifer 86cac40362 Harmonize field length for FilteredVariables for calibrated smoother
Analogous to 4f5e0321228c0e4aca19fcd114f26dbaa1bbbfaf
2014-11-16 21:11:06 +01:00
Johannes Pfeifer 4b1e815728 Always display value of posterior/likelihood at the mode
Also clarifies that minus the posterior/likelihood is displayed
2014-11-16 21:11:06 +01:00
Johannes Pfeifer 1cbb17f929 Make sure classical filtered variables have the same length as the Bayesian ones, i.e. nobs. 2014-11-16 21:08:18 +01:00
Johannes Pfeifer 7c59edead2 Make simplex_optimization_routine.m usable outside of estimation
Removes hard-coded parameter names extracted from bayestopt_ by handing them over explicitly
2014-11-10 19:53:55 +01:00
Johannes Pfeifer 8443eb58cd Do not create classical filtered variables at posterior mean if Bayesian filtered variables were requested
The check for running the smoother on the model at the posterior mean is only based on whether the smoother option was set. But filtered_vars is a separate option. If not also checking whether Bayesian filtered variables have already been requested, oo_.FilteredVariables will contain both "ML" and Bayesian fields, which is confusing. The change only saves the filtered variables from the classical smoother if the user did not use Bayesian estimation.
2014-10-29 19:07:49 +01:00
Stéphane Adjemian (Karaba) f48566aeae Fixed prior bounds (according to the doc in master branch).
* Second  and  third  positional  arguments  after the  name  of  the
   estimated  parameter   in  the  estimated_params   block  are  only
   considered in the optimization stage (not in the MCMC)

 * Do not  store bounds  in bayestopt_, because  bounds do  not always
   reflect restrictions implied by prior shapes.

 * prior_bounds routine  returns a structure  (with fields lb  and ub)
   instead of a matrix.
2014-10-20 16:18:54 +02:00
Johannes Pfeifer 2c01113e8c Fix bug when calling non-Bayesian smoother after Bayesian estimation
Because xparam1 is used by the smoother, but xparam was set to the posterior mean, the non-Bayesian smoother results were based on the parameters at the mode, which are stored in xparam1.
2014-10-15 09:49:07 +02:00
Johannes Pfeifer 79c5e18bfe Cosmetic changes
- Suppresses spurious output from dynare_estimation_1.m
- Removes unset output argument from dynare_estimation_init.m (which seems to be totally unused as it was not set at all and nobody reported any crashes)
- Corrects header of dynare_estimation_init.m
2014-09-19 16:20:43 +02:00
Johannes Pfeifer 8655df67a9 Clean up use of verbosity option
- in dr_block.m and ep_residuals.m the option was hardcoded and disabled
- for csminwel1.m, no verbosity option exists anymore, thus definitions preceeding calls to it were redundant as was the options_.osr.verbose
2014-09-12 10:33:37 +02:00
Stéphane Adjemian (Scylla) 576ed55dda Merge branch optimizer_number_5. 2014-09-11 17:38:03 +02:00
Stéphane Adjemian (Scylla) 5e4b7d8d42 Added filter_algorithm (estimation command, sets the particle filter algorithm). 2014-09-08 22:36:41 +02:00
Marco Ratto f346b734d9 when flag==0 (or options_.hess==0), we force to use the hessian from outer product gradient computed in optimizer == 5. 2014-08-07 17:49:04 +02:00
Stéphane Adjemian (Scylla) afbd0bd47a Cosmetic change (added white space). 2014-07-17 22:05:08 +02:00
Stéphane Adjemian (Charybdis) 03975f7d01 Fixed bug (wrong definition of rawdata). 2014-07-09 15:34:53 +02:00
Stéphane Adjemian (Scylla) d727ba7246 Fixed bug (missing input). 2014-06-23 12:24:36 +02:00
Stéphane Adjemian (Scylla) b11f6e2505 Adapted code for dsge-var models. 2014-06-23 10:55:08 +02:00
Stéphane Adjemian (Charybdis) efcf6bd9c0 Use dseries object in the estimation routines. 2014-06-16 17:41:59 +02:00
Stéphane Adjemian (Scylla) 66d08ac3bf Merge branch 'master' into use-dynSeries
Conflicts:
	matlab/dynare_estimation_init.m
	matlab/global_initialization.m
	matlab/prior_posterior_statistics.m
	matlab/read_variables.m
	matlab/set_prior.m
	matlab/utilities/dataset/initialize_dataset.m
	preprocessor/ComputingTasks.cc
2014-04-30 10:10:30 +02:00
Stéphane Adjemian (Scylla) bb18c9386d Fixed bug.
MCMC convergence diagnostics should be computed even if mh_replic is less than 2000, provided that the total number of iterations is greater than 2000 (if option load_mh_file is used).
2014-02-25 17:26:08 +01:00
Stéphane Adjemian (Scylla) c57aa43ca8 Bug fix.
<M_.fname>_optimal_mh_scale_parameter.mat was not deleted if mode_compute>0.
2014-02-25 15:44:34 +01:00
Johannes Pfeifer 221660dfea Fix capitalization error in dynare_estimation_1.m that leads to crashes if reached 2014-02-21 19:19:36 +01:00
Stéphane Adjemian (Scylla) f8543c0a97 Fixed typo. 2014-02-21 12:23:36 +01:00
Stéphane Adjemian (Scylla) 2ee11fa860 Changed the handling of optimization options in dynare_estimation_1.m. Removed calls to strsplit. Closes #605. 2014-02-03 12:25:29 +01:00
Stéphane Adjemian (Scylla) 63986a0ebf Closes #567. 2013-12-18 16:44:31 +01:00
Stéphane Adjemian (Scylla) 130125c5da Changed the error message issued when the initial conditions for the estimated parameters are outside the bounds (the error message depends on the value of options_.prior_trunc). 2013-11-27 12:27:51 +01:00
Stéphane Adjemian (Scylla) bd630d7210 Removed MC_record field from oo_ structure and the output argument from MCMC routines.
Details about the MCMC can be loaded in the workspace with the following command:

>> internals --load-mh-history <NAME_OF_THE_MOD_FILE>

under the name mcmc_informations, or printed in the command window, using the following
command:

>> internals --display-mh-history <NAME_OF_THE_MOD_FILE>
2013-11-26 12:56:41 +01:00
Stéphane Adjemian (Charybdis) ad0c29262b Cosmetic. Renamed DsgeVarLikelihood as dsge_var_likelihood. 2013-11-16 23:33:37 +01:00
Stéphane Adjemian (Charybdis) 9238523c26 If a DSGE-VAR is estimated, check that the user do not try to estimate/calibrate correlations between structural innovations and that there is no measurement errors. Closes #521. 2013-11-16 23:26:19 +01:00
Stéphane Adjemian (Penelope) 0c00151092 Merge branch 'master' into remove-dynDate-class
Conflicts:
	preprocessor/DynareBison.yy
2013-11-14 16:41:08 +01:00
Sébastien Villemot ea6ee19402 More Octave compatibility fixes wrt catch 2013-11-08 16:35:52 +01:00
Sébastien Villemot ecdbc42319 Fix error message when initial values of estimation are not suitable.
Ref #512
2013-11-08 16:09:16 +01:00
Sébastien Villemot 179af0e4ab Octave compatibility fix: catch does not accept an argument 2013-11-08 15:02:30 +01:00
Houtan Bastani 0fdc18e7fb Merge branch 'ifc'
Conflicts:
	matlab/dynare_estimation_1.m
	matlab/global_initialization.m
2013-11-06 13:58:57 +01:00
Johannes Pfeifer b03697b342 Add possibility to initialize parameters from calibrated model 2013-11-06 13:50:46 +01:00
Stéphane Adjemian (Scylla) 8429321547 Merge branch 'master' into remove-dynDate-class 2013-11-06 12:43:06 +01:00
Sébastien Villemot a72cc3ff48 Merge remote-tracking branch 'github/master' 2013-11-05 17:17:53 +01:00
Stéphane Adjemian ead332ed97 Merge pull request #511 from JohannesPfeifer/Correlated_errors_preprocessor
Bugfixes for correlated shocks
2013-11-05 07:49:37 -08:00