Estimated_para_init command


#1

Dear Prof Pfeifer,
I doing an estimation on a model with command “option-.debug=1” to check for the error with the code. The message is as follows:
Error in computing likelihood for initial parameter values

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 understood that I need to specify the command estimated_params_init. I do not understand how to specify this command in my code. I’ve just entered the command with option use calibration before and after the command estimation but I did not get any outcome.
I will appreciate if you could provide me with an insight on the usage of the command to perform the estimation.


#2

Does the estimation work when you do not use the estimated_params_init section? Just using the prior means…


#3

No the estimation does not run. Though the stock simul command works properly. But when I try to match the model to data, the code crashes.


#4

Please post your code.


#5

These are my code and data file.Data.xlsx (24.7 KB)
Mcode.mod (6.9 KB)


#6

On a quick look, I noticed that your measurement errors also enter your other model equations. For example,

q=rhoq*q(-1)+rhoqp*(r(-1)-pie)-rhoqpf*(r_f(-1)-pie_w)+e_q;
q_obs=q-q(-1)+e_q;
 
tot-tot(-1)=pie_f-pie_h+e_s;
tot_obs=tot-tot(-1)+e_s;

pie_w=gam1*pie_w(-1)+e_pie_w;
pie_w_obs=pie_w+e_pie_w;

This is not the convention. The structural shocks will usually not enter the measurement equations ( unless say it is a stochastic growth shock like in the Lubik and Schorfheide open macro papers…)…and vice versa.

Also another point, your UIP condition looks a bit strange

//Exchange rate and parity condition 
q=rhoq*q(-1)+rhoqp*(r(-1)-pie)-rhoqpf*(r_f(-1)-pie_w)+e_q;

It should be a purely forward-looking equation. Backward-looking terms can be introduced using other strategies, but the basic equation should look like :

//Exchange rate and parity condition 
q(+1) - q = (r -pie(+1))- (r_f -pie_w(+1))+e_q;

Not sure if these are the causes of the problem, but you could try these corrections…
Will have a better look later.

Reuben


#7

Usually, the problem that a model runs with simulations but not estimation comes from a unit root. In that case, you need the diffuse_filter-option.