steady state file when estimating a model

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

steady state file when estimating a model

Postby pepito_bm » Fri Oct 14, 2016 9:53 am

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
Attachments
basicnkest1_steadystate.m
(1.36 KiB) Downloaded 92 times
basicnkest1.mod
(1.03 KiB) Downloaded 103 times
pepito_bm
 
Posts: 20
Joined: Mon Aug 25, 2014 4:10 pm

Re: steady state file when estimating a model

Postby jpfeifer » Fri Oct 14, 2016 10:39 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: steady state file when estimating a model

Postby pepito_bm » Fri Oct 14, 2016 10:47 am

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
pepito_bm
 
Posts: 20
Joined: Mon Aug 25, 2014 4:10 pm

Re: steady state file when estimating a model

Postby jpfeifer » Fri Oct 14, 2016 12:07 pm

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
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 6 guests