Page 1 of 1

steady state file when estimating a model

PostPosted: Fri Oct 14, 2016 9:53 am
by pepito_bm
Hello there,
I have been trying to estimate a simple NK model. I'm estimating all parameters but those that are functions of other parameters (in this case only kappa) I would like to be read from a different file. I have read a a lot about stady state files but whenever I declare it here it doesn't seem to work. Basically I declare all parameters I would like to estimate in the parameter section before the model except kappa (the slope of the NK Phillips Curve). I know I can do the following:

var c R infl mc n y a;

varexo e_a;

parameters bet phi phip rhoa theta sigma;

setparams_basicnk;

model(linear);
#kappa=(((1-bet*theta)*(1-theta))/theta);


and then go on estimating the model which works fine. But I would like this kappa parameter to be read from a separate matlab file. Whenever I try that it simply can't recognize that such a parameter exists. Could you please help me on that?

Many thanks in advance,
Peter

Re: steady state file when estimating a model

PostPosted: Fri Oct 14, 2016 10:39 am
by jpfeifer
In this case, you need to define
Code: Select all
kappa

as a parameter. While it is no independent parameter, the steady state file is correctly handling the parameter dependence, which is why you are allowed to define a separate parameter.

Re: steady state file when estimating a model

PostPosted: Fri Oct 14, 2016 10:47 am
by pepito_bm
Thanks a lot Johannes for the help. Then a quick follow-up question. I suspected this might be the case and defined "kappa" as a parameter but commented out kappa in the steady state file so the latter contained basiclly nothing. I ran the estimation and got some output which was to me quite surprising since I thought dynare should have crashed since kappa is virtually nothing. So how can I be sure that whenever I provide a steady state file I actually get the right results?

Thanks a lot

Re: steady state file when estimating a model

PostPosted: Fri Oct 14, 2016 12:07 pm
by jpfeifer
Take a look at the steady state file. It first has
Code: Select all
% read out parameters to access them with their name
NumberOfParameters = M_.param_nbr;
for ii = 1:NumberOfParameters
  paramname = deblank(M_.param_names(ii,:));
  eval([ paramname ' = M_.params(' int2str(ii) ');']);
end

which will read in the set parameters.

At the end
Code: Select all
for iter = 1:length(M_.params) %update parameters set in the file
  eval([ 'M_.params(' num2str(iter) ') = ' M_.param_names(iter,:) ';' ])
end

passes the parameters back.

Thus, when you do not reset kappa in the steadystate-file, it will be passed on as it was before. In your case, it should be set to the initial value you assigned. Therefore kappa is not
nothing

but rather the value you initially assigned. I guess this happens in
Code: Select all
setparams_basicnk