ZLB DSGE Estimation

Hello. I’m trying to estimate linear DSGE and linear NK models with the zero lower bound in the sample, but I’m having some difficulty figuring out how to properly do this. I’ve seen some suggest doing this by incorporating a second shock to the Taylor Rule (Laseen & Svensson, 2011 IJCB), but I cannot find examples of how to do this in Dynare. Other ZLB estimations (Atkinson et al, 2019 JME; Guerrieri & Iacoviello, 2017) only use nonlinearized models. Can someone please help point me in the right direction on how to do this, or if this is possible, in Dynare?

I am not sure I understand the problem. The Occbin-type implementations as e.g. tests/occbin/filter/NKM.mod · master · Dynare / dynare · GitLab would work with a linearized model as well. Internally, Dynare does linearized these equations as well.

Thank you for your help here, Professor! I’ve made some progress with this thanks to your example file, but am still running into issues. I’m trying to implement and estimate the ZLB in the Smets and Wouters (2007) model. I’m now receiving the error message that the estimation does not converge, regardless of whether I use the inversion filter or Kalman filter. Perhaps I have declared my lower-bound wrong when taken with the observation equations? The error message is below, and my .mod file and dataset are attached.
sw07_0719_ff.mod (21.3 KB)
swdata_ff1.mat (14.6 KB)

nperiods has been endogenously increased up to 229.
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 3.432965e-17.

In occbin.mkdatap_anticipated_dyn (line 104)
In occbin.solve_one_constraint (line 175)
In occbin.solver (line 63)
In occbin.kalman_update_algo_1 (line 124)
In missing_observations_kalman_filter (line 235)
In dsge_likelihood (line 705)
In gmhmaxlik_core (line 154)
In gmhmaxlik (line 100)
In dynare_minimize_objective (line 336)
In dynare_estimation_1 (line 211)
In dynare_estimation (line 118)
In sw07_0719_ff.driver (line 671)
In dynare (line 281)

occbin solver:: period 1::
Did not converge – increase maxit.
Error using print_info (line 32)
Occbin: Simulation did not converge, increase maxit or check_ahead_periods.

Could you maybe provide the full log-file? I am still investigating the issue.

Certainly, thank you again! The full log file is below.

sw07_0719_ff.log (85.3 KB)

How long did your code run, before the error occurred?

My code ran for about 8.5 hours before the error occurred.

This is due to a bug. See Provide error handling to piece-wise linear Kalman filter (#1854) · Issues · Dynare / dynare · GitLab

Thank you for providing the fix to the bug! I’m now running into a new error message with the same above code. It says the matrix is singular or badly scaled, though I haven’t changed any of the parameters from their original calibration. Perhaps I have declared the ZLB incorrectly?

The Matlab error says “Assignment between unlike types is not allowed” though I am admittedly unsure what this means. Thanks for your help so far, and any further help or guidance you can provide is certainly appreciated!
sw07_0719_ff.log (83.7 KB)

Could you maybe provide the full error message?

Absolutely. The full error message is:
Assignment between unlike types is not allowed.
Error in missing_observations_kalman_filter (line 235)
[ax, a1x, Px, P1x, vx, Tx, Rx, Cx, regimes_(t:t+2), info, M_, likx, etax(t,:)] =
Error in dsge_likelihood (line 705)
[LIK,lik] =

Error in gmhmaxlik_core (line 154)
logpo2 = - feval(ObjFun,proposal,varargin{:});
Error in gmhmaxlik (line 100)
[PostMode, PostVariance, Scale, PostMean] = gmhmaxlik_core(fun, OldPostMode, bounds, gmhmaxlikOptions, Scale, flag, MeanPar, OldPostVariance,
Error in dynare_minimize_objective (line 336)
[opt_par_values, hessian_mat, Scale, fval] = gmhmaxlik(objective_function, start_par_value, …
Error in dynare_estimation_1 (line 211)
[xparam1, fval, exitflag, hh, options_, Scale, new_rat_hess_info] =
Error in dynare_estimation (line 118)
Error in sw07_0719_ff.driver (line 670)
Error in dynare (line 281)
evalin(‘base’,[fname ‘.driver’]);


I just wanted to return and see if anyone could help with this? I am beginning to think I’ve not specified the ZLB properly when taken with the observation equations in the model, though I’m unsure the proper way to specify it correctly.

Could you please try the unstable version. This message may have been caused by a bug we recently fixed. See Bug fixes for PKF (!2038) · Merge requests · Dynare / dynare · GitLab

I believe this worked, thank you! I got a few warning messages that the matrix was close to singular or badly scaled. Is this a natural warning message with this estimation, or are my estimates likely inaccurate?

Yes, occasional messages like that are to be expected due to the sampler exploring the parameter space and usually encountering some odd draws.