Computing Steady State with Estimated Parameters


Hello - I am trying to replicate something along the lines of Chari, Kehoe McGrattan (2007): that is, a DSGE model with wedges. These wedges arise from an underlying stochastic process. One reads in data to recover this process (assumed Markov), and then uses the equilibrium conditions of the model to back out the implied wedges.

I’m having a problem defining the steady state of the model. The issue is that the SS values of k, y, c etc. all depend on the SS values of the endogenous wedges. But these in turn are estimated. However, one needs SS values of model variables to do the estimation.

I am trying to use a steady_state_model block to define the SS. I understand that an alternative is to write a steady state file myself, but I’m not sure how this would improve matters. I am having trouble conceptually specifying how dynare can find the SS in this case.




Thanks for the reference. As always, your github dynare codes are very useful. The specification of wedges is different in my model (I put them in the firm problem and production function, rather than as taxes on the consumer side).

I wrote my code using yours as a template and with everything log-linearized (including the wedges). I am using CKM’s initial parameter values but set the initial guesses for the wedge means to 0. Because my wedges are different from theirs, I shouldn’t be using their initial values. However, I am just getting my code to run. I can’t get the steady state file to compute a SS. The residuals are 0 in all equations but (2). I find this strange because (2) just defines the value of the labor wedge from my pre-set parameter value. If I play around with the initial values for the wedge means, I get residuals on (2) and (3), which set the labor and capital wedge respectively.

I’m not entirely sure what I’m doing wrong here.

exponentiated.mod (10.4 KB)
exponentiated_steadystate.m (2.7 KB)


Where exactly is the wedge in your equation (2). I had


with tau_l being the wedge. You have

exp(w)*exp(c)^(-ssigma) = ppsi*exp(n)^(1/pphi);

You say you put them in the firm problem, but did you adjust the steady state file accordingly?


Yes. I’m using a different utility function. The wedge doesn’t show up in the labor-leisure decision because that decision is undistorted. The firm’s choice of wages is distorted, however, as in the SS file equation (9). I wrote the steady-state file myself, so the equations there correspond to my model.

However, I have managed to get the file running if I don’t log-linearize but just make the model linear in levels. I’m not sure exactly why this is. I have attached the set of files which works.

I have two other questions if you have a moment:
(1) How do you pick good initial values for MLE? I keep getting the message “Warning: Matrix is singular, close to singular or badly scaled. Results may be inaccurate. RCOND = NaN.” Also the estimation routine fails to calculate variances for my estimated parameters (they are just NaN). Based on the plots, it seems to be having particular difficulty with the P0 matrix and all elements of the P matrix (the var-covar of the wedge innovations). Note that I am using the same SS values as CKM despite having a different model.

(2) When you feed the wedges back into the model, why did you log-linearize all of the equations around the model’s steady state? Can’t you just enter these equations directly? E.g. to recover capital, why not just use the capital LOM (rather than its log-linearized counterpart)? And when computing tau_x (lines 329-339 of your code), why are you using the linear solution?

Thanks a lot again!

rough_code_orig.mod (12.2 KB)
rough_code_orig_steadystate.m (2.7 KB)