Commit Graph

68 Commits (9c3c0d727f7fe336c02e580c57b13f5ab9f29314)

Author SHA1 Message Date
Johannes Pfeifer bda19832cd Integrate error from negative steady state with loglinear model into print_info.m
Prevents crashes during estimation. Instead of directly crashing, error handling is done via print_info.m so that penalizing the error during estimation is possible
2014-12-04 20:04:36 +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
Stéphane Adjemian (Karaba) 97b63105a0 Add a parameter to the lyapunov_symm routine (debug mode). 2014-10-13 17:42:53 +02:00
Stéphane Adjemian (Karaba) 55808060cf Removed useless input (complete commit 438a671c3873e5c4e1bb02a54080e930fbc11886). 2014-10-13 17:42:52 +02:00
Johannes Pfeifer b90f3deed2 Bugfixes and improvements related to method 3 of lyapunov_symm.m
- the function was called with the wrong input argument for this case (Q instead of R*Q*R'), crashing with incompatible matrix dimensions
- the persistent variable X was not updated when the size of it changed, leading to crashes when estimation is followed by calls to DsgeSmoother.m where the state-space is different
- Also eliminates the printed output in lyapunov_symm.m that could not be turned off and clutters estimation
2014-10-13 17:42:52 +02:00
Johannes Pfeifer 2d39fc62e2 Make sure the output arguments of dsge_likelihood.m are actually set
Before, trend_coeff and ys were sometimes returned as empty
2014-09-21 11:54:43 +02:00
Stéphane Adjemian (Scylla) 576ed55dda Merge branch optimizer_number_5. 2014-09-11 17:38:03 +02:00
Stéphane Adjemian (Charybdis) 6d42ec66d5 Account for error code 10 (Inf in Jacobian of the dynamic model) in likelihood functions. 2014-09-10 17:49:33 +02:00
Marco Ratto a6bddb2d57 Improve computation of outer product gradient for univariate Kalman algorithms, by exploiting the larger number of individual densities computed during recursions (used in optimizer number 5). 2014-07-23 16:33:39 +02:00
Stéphane Adjemian (Scylla) 0efcef8f20 Added the possibility to declare non linear prior restrictions over estimated parameters.
If a file <MOD_FILE_NAME>_prior_restrictions.m exists in current folder, the value returned by this routine is
substracted to fval (likelihood-lnprior) at the end of dsge_likelihood. The arguments of this routine are: M_,
oo_, options_, dataset_ and dataset_info. Routines for writing <MOD_FILE_NAME>_prior_restrictions.m will be
provided later.
2014-07-21 12:45:49 +02:00
Sébastien Villemot 939fb78624 Merge pull request #663 from JohannesPfeifer/master
Bugfix and cosmetic fix
2014-07-01 17:56:48 +02:00
Stéphane Adjemian (Scylla) 03395a7425 Fixed bug. Wrong test on the number of input arguments (because of the new input argument dataset_info in dsge_likelihood). 2014-06-25 14:57:20 +02:00
Stéphane Adjemian (Charybdis) efcf6bd9c0 Use dseries object in the estimation routines. 2014-06-16 17:41:59 +02:00
Johannes Pfeifer ca6803b531 Add forgotten case to likelihood functions
Code 25 was not filtered out, leading to cryptic crashes
2014-06-02 14:10:43 +02:00
Johannes Pfeifer 12026b98a5 Add info about constants to dsge_likelihood.m header 2014-03-19 19:34:34 +01:00
Johannes Pfeifer fddee8e1db Bugfixes for correlated shocks
Uses preprocessing capabilities introduced in 07137e804b

Fixes #392 and #494. Also fixes a bug in the checking for positive definiteness of covariance matrices in likelihood functions

Allows for calibrated covariances by reading them out and setting them after covariance matrix has been reconstructed from correlation and variances.

Adds unit test
2013-11-05 15:55:29 +01:00
Stéphane Adjemian (Charybdis) 06ef8fce30 Fixed typo. 2013-06-28 22:02:24 +02:00
Stéphane Adjemian (Charybdis) b281830983 Added new initialization mode ofr the Kalman filter and smoother. 2013-06-28 16:26:53 +02:00
Stéphane Adjemian (Charybdis) 268095276c Factorized code using ispd routine. 2013-06-20 12:59:01 +02:00
Sébastien Villemot 61485ab809 Fix copyright notices 2013-06-12 17:04:46 +02:00
Sébastien Villemot 8c14339a0f Merge pull request #399 from JohannesPfeifer/master
Bugfix for dsge_likelihood with univariate_kalman_filter
2013-05-31 09:24:35 -07:00
Marco Ratto 4923ba0952 Introduced new option that allows to set prior (sign) restrictions to irf's 2013-05-30 10:57:39 +02:00
Johannes Pfeifer 115b16236b Fix bug in dsge_likelihood for univariate_kalman_filter
ÿÿÿ

Lines 399-418 set the measurement covariance matrix and save it to H1.
If it is diagonal, it is not recomputed again as
correlated_errors_have_been_checked is 0. In that case, lines 654-675
are not entered and univariate_kalman_filter tries to use the old H, but
it was named H1 before, leading to a crash. Changing the name of the
matrix H in lines 654-682 to H1 assures that univariate_kalman_filter
uses the correctly updated matrix of the
~correlated_errors_have_been_checked and the previously computed H1 in
the other cases.
2013-05-17 23:54:17 +02:00
Johannes Pfeifer 7094a45f6d Revert "Make error message for prior violation more explicit by adding second argument to info()"
This reverts commit 2815d5fbd4.
2013-05-02 14:31:29 +02:00
Johannes Pfeifer 2815d5fbd4 Make error message for prior violation more explicit by adding second argument to info() 2013-04-26 20:20:23 +02:00
Sébastien Villemot e1f702f83a Various fixes to steady state computation in estimation DLL
Still not working… Valgrind detects unitialized values during the call to
hybridjs…
2013-04-18 18:28:34 +02:00
Johannes Pfeifer 40e5c61ec7 Restrict endogenous prior to stationary models and allow for measurement error 2013-03-18 23:46:15 +01:00
Johannes Pfeifer a090a7c35e Add endogenous priors
Add option and code for endogenous priors according to
Christiano/Trabandt/Walentin 2011, JEDC. Still needs to be integrated to
manual and pre-processor.
2013-03-17 22:51:23 +01:00
Michel Juillard 74c300939a making sure that dsge_likelihood.m always returns a value in fval 2012-10-24 10:02:17 +02:00
Michel Juillard dd8f16c8db Revert "reset penalty to 1.e8." Too big a penaly is not desirable.
This reverts commit fcceec896a.
2012-10-01 14:23:21 +02:00
Marco Ratto fcceec896a reset penalty to 1.e8. 2012-10-01 08:53:50 +02:00
Sébastien Villemot 421e1a39fc Merge remote-tracking branch 'ratto/master' 2012-09-27 16:36:00 +02:00
Stéphane Adjemian (Charybdis) 894b3d69f4 Added an option to decide if dsge_likelihood should call univariate filters when the covariance matrix of
the prediction error is singular (default is yes).
2012-09-27 14:48:07 +02:00
Marco Ratto 16fa6efc8d Replace NaN with numeric penalty when diffuse filter does not kill unit roots. 2012-09-26 16:00:18 +02:00
Sébastien Villemot 8d4c812671 Merge remote-tracking branch 'ratto/master' 2012-09-17 10:29:53 +02:00
Marco Ratto b756ee1819 Analytic derivatives: make them work for lik_init==2 as well
(lik_init =3 and =4 still to be worked out)
2012-09-14 17:07:38 +02:00
Marco Ratto e637319be5 bug fix. the diffuse filter should simply penalize the likelihood with the NaN without breaking the estimation (this is in line with missing_observations_kalman_filter_d.m). 2012-09-14 17:05:35 +02:00
Stéphane Adjemian (Scylla) 3658b02455 Fixed bug. If info==19 (steady state routine returns check=1) info(2) is NaN, so that it is not possible to define an endogenous penalty. In this case we just add one to objective_function_penalty_base.
(cherry picked from commit d2912b264c326b3f349984b605787045b028b992)
2012-09-14 17:05:31 +02:00
Michel Juillard d60202616a fixed problem with penalty in estimation. Created a new global scalar:
objective_function_penalty_base. It is the only simple way that I
found to keep csminwel1.m to be able to handle general functions.
2012-08-28 12:17:07 +02:00
Marco Ratto 6b91301365 Reduce memory requirements for analytic Hessian.
Tested with QUEST III (Ratto et al. 2009): 63 params and 59 state dimension.
2012-08-21 16:00:55 +02:00
Michel Juillard 2e9ae5df28 dealing with info == 8 (Nan in Jacobian) during estimation 2012-08-06 12:00:03 +02:00
Michel Juillard 6b3bd9dd0b penalty is now passed as a field of bayestopt_ (or BayesInfo) 2012-08-02 22:23:29 +02:00
Marco Ratto 47353a276b bug fix: the anlytic hessian was wrong with estimated stderr.
Manual cherry pick from Commit: 36853cb7615de41ca61ed92decf8bbe81ab40cba
2012-08-02 14:57:20 +02:00
Marco Ratto ed4d37341c Fix problem with models where steadystate files change parameter values.
1) allow to compute derivatives starting from NUMERICAL derivatives of jacobian and steady state: this has a minor cost in accuracy and allow apply without errors identification and estimation with numerical derivatives;
2) added trap in dynare_estimation_init: if steadystate changes param values, automaticly shifts to numerical derivs of jacoban and steady state +  analytic derivatives of all the rest;
3) bug fixes for 2nd order derivatives w.r.t. model parameters;
2012-07-05 10:14:10 +02:00
Stéphane Adjemian (Charybdis) 379972d715 Removed prior_penalty in dsge_likelihood.
If options_.prior_trunc is set to zero (the default is strictly positive) then prior_correction is infinite because the prior density is zero (this is not true for the uniform prior)... This does not help the optimizer. Even if we do not fall in this case (because options_.prior_trunc>0 or becuase only uniform priors are used for the bounded parameters) the meaning of this correction is unclear.
2012-07-04 13:04:49 +02:00
Stéphane Adjemian (Charybdis) abad13d020 Kill estimation if the likelihood is complex or NaN. 2012-06-14 15:32:15 +02:00
Ferhat Mihoubi 2a8436aa44 Extends the block Kalman filter to the missing observations case (not called for the moment) 2012-06-11 10:39:25 +02:00
Sébastien Villemot 129553579a Merge remote-tracking branch 'ratto/master' 2012-06-08 18:24:18 +02:00
Sébastien Villemot 1f9cea669a Update copyright notices 2012-06-08 18:22:34 +02:00
Marco Ratto 69d015a777 Asymptotic Hessian now works also for univariate stationary KF. 2012-06-08 15:26:14 +02:00