Non-linear parameter transformation and estimation

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.

Non-linear parameter transformation and estimation

Postby gcandian » Sat Aug 09, 2014 11:18 pm

Hello,

I am trying to estimate a linearized DSGE model with imperfect information. I solve for the evolution of the state vector using a function [M,m] = state_eq(parameters) that I wrote by myself. The law of motion for the state vector is X_t = M X_{t-1} + m u_t.

I would like to call the entries of M and m into the model block in my mod file but I cannot declare them as parameters because they need to change with the 'deep parameters' at every MCMC iteration. I have tried something like this:

var y x ...;
varexo u ...;
parameters alph bet ...;

[M,m] = state_eq([alph bet ...]);

model(linear);
x = M(1,1)*x(-1) + ...
end

but Dynare does not recognize this matrix notation. I would like to avoid writing an external function for each entry of M and m because that would require solving for the whole matrices M and m numerous times at each MCMC.

Do you have any suggestions?

Thanks a lot for your help!

Giacomo
gcandian
 
Posts: 7
Joined: Sat Aug 09, 2014 10:39 pm

Re: Non-linear parameter transformation and estimation

Postby jpfeifer » Sun Aug 10, 2014 10:18 am

Define the required entries as parameters and then use a steady state file to call the function state_eq only once per iteration and then write the results of this into the parameters.
------------
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: Non-linear parameter transformation and estimation

Postby gcandian » Sun Aug 10, 2014 7:19 pm

Thank you very much Johannes - the solution you proposed works!

I have one more issue though. I know that in the estimation we do not declare the standard errors of the structural shocks as parameters and in the estimation we write something like:

stderr ez,inv_gamma_pdf, 0.007, 0.02;

However in my case the standard error of the shocks pins down the entries of the matrices M and m (which now I compute inside the steady state file). Is there a way to call the standard error of the shocks of the current MCMC iteration inside the steady state file even if they are not declared as parameters? Alternatively, is there another work-around?

Thank you very much again for your help!
gcandian
 
Posts: 7
Joined: Sat Aug 09, 2014 10:39 pm

Re: Non-linear parameter transformation and estimation

Postby jpfeifer » Mon Aug 11, 2014 8:02 am

In this case, I would suggest setting the standard deviation of the shock to 1 in the shocks-block and estimating the standard deviation as a parameter premultiplying the shock:
Code: Select all
z=rho*z(-1)+std_eps_z*eps_z;

Alternatively, you could try to access the corresponding entry of M_.Sigma_e, but the first approach is fail-safe
------------
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: Non-linear parameter transformation and estimation

Postby gcandian » Mon Aug 11, 2014 4:02 pm

Of course, I should have thought about this! Thank you very much for your help, Johannes.
gcandian
 
Posts: 7
Joined: Sat Aug 09, 2014 10:39 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests