Parameter dependence and # operator

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.

Parameter dependence and # operator

Postby econ86 » Fri Aug 21, 2015 4:51 pm

Dear all,

When estimating DSGE model, I'm taking into account parameter dependence. My question is: where are the calculated SS relations that make use of # operator stored after the estimation?

Best,
econ86
 
Posts: 78
Joined: Sun Apr 26, 2015 10:32 am

Re: Parameter dependence and # operator

Postby jpfeifer » Fri Aug 21, 2015 6:17 pm

They are not stored at all. If you want them to be stored, you need to define them as parameters and use a steady_state_model block to make sure they are correctly updated in every draw.
------------
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: Parameter dependence and # operator

Postby econ86 » Sat Aug 22, 2015 6:41 am

Dear J. Pfeifer,

If I understand you correctly, this is the same as using # operator with the only difference being that in this case the calculated SS relations are stored. Am I right?

Best.
econ86
 
Posts: 78
Joined: Sun Apr 26, 2015 10:32 am

Re: Parameter dependence and # operator

Postby jpfeifer » Sat Aug 22, 2015 9:08 am

Yes. The #operator is basically a placeholder where the preprocessor, whenever such an expression is encoutered, is replaced by the right-hand side of the definition. Thus, the model-local do not exist anymore when the model is run as they are simply replaced by the expression involving the original parameters.

In contrast, the steady_state_model block allows storing such expressions. The reason is that you are defining a separate parameter that is stored, but because the steady state file is executed every time the model is solved the parameters are correctly updated when you specify the dependencies correctly.
------------
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: Parameter dependence and # operator

Postby econ86 » Sat Aug 22, 2015 12:00 pm

Ok, but I still have a problem. Now I have the following:

var mu_zhat epsilon Upsilon z_tildestar zeta_c ...

varexo epsilon_muz epsilon_epsilon epsilon_Upsilon ...

parameters beta alpha eta_c sigma_a sigma_L ... (b_w and y_bar are not declared here)
beta=0.995;
//b_w = (lambda_w*sigma_L-(1-lambda_w))/((1-beta*xi_w)*(1-xi_w)); // Wage equation parameter
//y_bar =(1/lambda_d)*((mu_z)^(-alpha))*((k_H)^(alpha))*H; // SS output
etc.

model(linear);
....
#b_w = (lambda_w*sigma_L-(1-lambda_w))/((1-beta*xi_w)*(1-xi_w)); // Wage equation parameter
#y_bar =(1/lambda_d)*((mu_z)^(-alpha))*((k_H)^(alpha))*H; // SS output

etc.

When using the steady_state_model I would have:

var mu_zhat epsilon Upsilon z_tildestar zeta_c ...

varexo epsilon_muz epsilon_epsilon epsilon_Upsilon ...

parameters beta alpha eta_c sigma_a sigma_L ... b_w and y_bar
beta=0.995;
//b_w = (lambda_w*sigma_L-(1-lambda_w))/((1-beta*xi_w)*(1-xi_w)); // Wage equation parameter
//y_bar =(1/lambda_d)*((mu_z)^(-alpha))*((k_H)^(alpha))*H; // SS output
etc.

model(linear);
....

end;

steady_state_model;
b_w = (lambda_w*sigma_L-(1-lambda_w))/((1-beta*xi_w)*(1-xi_w)); // Wage equation parameter
y_bar =(1/lambda_d)*((mu_z)^(-alpha))*((k_H)^(alpha))*H; // SS output

end;
etc.

I'm not sure whether this is correct.
econ86
 
Posts: 78
Joined: Sun Apr 26, 2015 10:32 am

Re: Parameter dependence and # operator

Postby jpfeifer » Sat Aug 22, 2015 1:04 pm

Looks good to me.
------------
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: Parameter dependence and # operator

Postby econ86 » Sun Aug 23, 2015 10:12 am

I placed all the parameters and SS relations that are dependent on the estimated parameters under the steady_state_model block as described in my previous post, but when running the estimation, I encounter the following problem:

Error using print_info (line 72)
The steadystate file did not compute the steady state

Error in print_info (line 72)
error('The steadystate file did not compute the steady
state')

Error in initial_estimation_checks (line 69)
print_info(info, DynareOptions.noprint, DynareOptions)

Error in dynare_estimation_1 (line 179)
oo_ =
initial_estimation_checks(objective_function,xparam1,dataset_,M_,estim_params_,options_,bayestopt_,oo_);

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in model1 (line 1058)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;
econ86
 
Posts: 78
Joined: Sun Apr 26, 2015 10:32 am

Re: Parameter dependence and # operator

Postby jpfeifer » Sun Aug 23, 2015 4:06 pm

When your model is linear, this is impossible. Please provide the files.
------------
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: Parameter dependence and # operator

Postby econ86 » Sun Aug 23, 2015 5:35 pm

Yes, I use the well-known model of Adolfson et al. which is also included in the Macroeconomic Model Data Base (name EA_SR07). It is log-linearized, variables are expressed as percentage deviations from SS (hat variables).

So, with that model the best way is to use the pound operator # in front of the parameters and SS relations that are dependent on the estimated parameters?
econ86
 
Posts: 78
Joined: Sun Apr 26, 2015 10:32 am

Re: Parameter dependence and # operator

Postby jpfeifer » Sun Aug 23, 2015 5:47 pm

I need the files to replicate the issue.
------------
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: Parameter dependence and # operator

Postby jpfeifer » Sun Aug 30, 2015 3:21 pm

This has to do with the fact that you have a linear model with variables that contain constant terms. You need to provide analytical solutions for these variables when you use a steady_state_model block. You could use the initval-block values from my other response to your model: http://www.dynare.org/phpBB3/viewtopic.php?f=1&p=21202#p21202
------------
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: No registered users and 8 guests