by qianq_1625 » Mon Jun 12, 2017 8:29 pm
Hi Professor,
Thanks for the response. Basically, I have difficulty to understand dynare process for estimation. Let me use the following example to explain my questions:
parameters bet;
bet=0.253;
rho=0.90253;
model;
# sig = 1/bet;
c = sig*c(+1)+f[...];
a = rho*a(-1)+e_a;
.......
end;
steady_state_model;
a=0;
c=0;
......
end;
steady;
estimated_params;
bet, normal_pdf, 1, 0.05;
rho, uniform_pdf, , , -0.99, 0.99;
stderr e_a, uniform_pdf, , , 0, 0.2;
end;
estimated_params_init;
bet, 0.253;
rho, 0.90253;
end;
In this example, I declare the parameters bet and rho in the parameter block. I also give them values which are from my own calibration. Although both bet and rho are my estimation target, I have to give them values. Based on my observation, if I dont give them values, dynare can not go through the steady state. It will give me the error: the steady_state has NaN or inf. In my new code, after I give all my parameters calibrated values, dynare goes through the steady_state without trggering any error message.
1. Here comes my first question: I have to give all my parameters reasonable values, even I want to estimate them. Correct? If I dont give them values, just provide their distribution with the prior mean, will this work?
Since I already manually loglinearized the all my first order conditions in model block, all the steady state values should be set as 0 in steady_state block. Based on the instruction, when I put steady after steady_state_model block, dynare will use the steady state values I provide in the block as merely approximation and calculate the true steady state values through a nonlinear Newton-type solver.
2. Is my understanding correct?
In the estimated_params block, I tell dynare all parameters' distributions. My understanding is that dynare will use the value I provide in parameter block as initial values, and follow the distribution I provide here to estimate the parameters. Since both bet and rho have initial values being different from the prior mean, I need to declare in the estimated_params_init block.
3. Here comes my third question. When dynare estimate my parameters, will it update the values automatically?
4. The 4th question is that I have difficulty to understand the use_calibration. Based on what you said, if I use this option, I dont need to declare bet and rho's values in the estimated_params_init block. Should I just write the following:
estimated_params_init(use_calibration);
end;
I read the instruction about this option, but still feel really confused about how it works.
5. The last question: Yes, you are absolutely right. When I first time to run my code, dynare does not only provide the potential fix which suggests me to add estimated_params_init with use_calibration option, but also give me the error which is B-K conditions are not satisfied: indeterminacy. I read other posts in the forums, saying that it could be due to the case where I included unnecessary equations in the model block. I carefully reviewed all my equations. All necessary equations should be correctly included. There are 18 equations for 18 endogenous variables. Then I followed the potential fix to add:
estimated_params_init(use_calibration);
bet, 0.253;
rho, 0.90253;
end;
My code is successfully ran through by dynare without any error. By now, I set mh_replic=0 to estimate parameter values. But once I change 0 to any positive integer, dyanre gives me the error message: "Matrix must be positive definite".
I guess this is still due to this indeterminacy error. Is there any other reason could trigger this error?
Thank you very much for your great help!!
Eric