Page 1 of 1

Non-linear parameter transformation and estimation

PostPosted: Sat Aug 09, 2014 11:18 pm
by gcandian
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

Re: Non-linear parameter transformation and estimation

PostPosted: Sun Aug 10, 2014 10:18 am
by jpfeifer
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.

Re: Non-linear parameter transformation and estimation

PostPosted: Sun Aug 10, 2014 7:19 pm
by gcandian
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!

Re: Non-linear parameter transformation and estimation

PostPosted: Mon Aug 11, 2014 8:02 am
by jpfeifer
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

Re: Non-linear parameter transformation and estimation

PostPosted: Mon Aug 11, 2014 4:02 pm
by gcandian
Of course, I should have thought about this! Thank you very much for your help, Johannes.