Estimation Parameter Error

calibration.m (11.6 KB)
datamodel2.xlsx (24.6 KB)
model2.mod (16.2 KB)
model2_steadystate.m (1.5 KB)
paramfile_model2.m (82 Bytes)

Hello,

I am using Dynare for the first time to estimate a DSGE model. The calibrated version of the model works (at least for now), but I am trying to get the estimated version running as well. However, I keep encountering the following error:

ESTIMATION_CHECKS: There was an error in computing the likelihood for initial parameter values.
ESTIMATION_CHECKS: If this is not a problem with the setting of options (check the error message below),
ESTIMATION_CHECKS: you should try using the calibrated version of the model as starting values. To do
ESTIMATION_CHECKS: this, add an empty estimated_params_init-block with use_calibration option immediately before the estimation
ESTIMATION_CHECKS: command (and after the estimated_params-block so that it does not get overwritten):

I followed the recommendation and introduced the estimated_params_init block with the use_calibration option, but I am still unable to resolve the error.

I would greatly appreciate any assistance to help me get past this issue. I have attached my .mod file, data file, and MATLAB file used to solve for the steady state.

Thank you for your help, and I look forward to your response.

You hacked your model to “work” by decreasing the tolerance of the steady state file. But it does not generate sensible IRFs. You first need to make sure your model works as expected with simulations.

After that, you need to provide a working steady state file for estimation. That means not hard-coding estimated parameters. It also seems your observation equations and the data treatment are wrong.

Thank you for the response. I believe i can deal with the first part of getting the model to work with the simulation.

Could you kindly help me correct the observation equations and wrong data treatment?

Please refer to Pfeifer(2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models”

I have read this document. However, i am sure i did not get everything right. My understanding was to express observable data such as output and consumption in per capita terms. Also ensure all observations in the are matched to the variables are stationary by use one-sided filter on the non stationary ones. It was my understanding introducing measurement errors were optional.

I’ll appreciate it very much if you could point out somethings i did wrong the observation equations so i could rectify them.

There are still some variables where the mean does not match. Moreover, for many variables the variance is huge. Did you forget to log some variables to obtain percentages?

I did not take the logs of the variables in the data. I was under the impression that i did not have to take logs since the model equations are in levels and not log s.

The transformation i did on the data are 1. When necessary divide by population
2. When necessary apply one-sided hp filter to find the gap.

Most models feature constant returns to scale and can be arbitrarily scaled using TFP. Thus, pretty much all papers use percentage deviations instead of levels as the latter are not well-defined.

Okay. This is very helpful. I’ll keep in mind the mean and variance of the data during the transformation.

Could you also confirm if how i entered the parameters especially the estimated parameters and the estimated_params_init block was done right. This is because dynare kept referring to that as the error.

That part looked OK. The error message you posted was the generic one. The actual error message was below that one and was about NaN/Inf in the likelihood.