Page 1 of 1

Bayesian estimation

PostPosted: Sat Nov 22, 2014 11:49 am
by Nemo4t
I am trying to execute a bayesian estimation. In particular I would like to estimate a transofmation of the parameter as expressed in the model instead of the parameter itself.
The code I wrote is:

Code: Select all
varobs Y;

parameters alfa;
model;
# Y=z+alfa*N+(1-alfa)*k(-1);
end;

estimated_params;

alfa, beta_pdf, 0.99, 0.02;             //Parametro, Distribuzione, Prior, Standard Error,
stderr e, inv_gamma_pdf, 0.01, inf;
end;


It keeps on returning the following error message:
Y has wrong type, you cannot use it within as left-hand side of a pound ('#') expression

what am I doing wrong?

Thanks,
Nemo4t

Re: Bayesian estimation

PostPosted: Sat Nov 22, 2014 1:31 pm
by jpfeifer
You need to correctly define the variables and parameters:
Code: Select all
var Y N k;
parameters alfa;

Moreover, you need two more equations defining N and k as well as some shocks as otherwise your model would be stochastically singular. You seem to have some shock e in mind as you are trying to estimate its standard deviation.

Re: Bayesian estimation

PostPosted: Sat Nov 22, 2014 2:23 pm
by Nemo4t
I already specified the model as I simulated DSGE, should I re-write the whole solved model?
Isn't "varobs ..." a list of observed variables only?

Re: Bayesian estimation

PostPosted: Tue Nov 25, 2014 7:09 am
by jpfeifer
Just drop the second parameter and model statment. They must not be there. You can only estimate your whole model. With varobs you specify the observed variables, which in your case would be Y.

Note that you need to take the steady state parameter dependency into account, which seems not to be the case as you are only calling Steady_S once. You need either a steady_state_model block or model-local variables or a steady state file. See Pfeifer(2013): "A Guide to Specifying Observation Equations for the Estimation of DSGE Models" https://sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.

Re: Bayesian estimation

PostPosted: Wed Nov 26, 2014 7:21 pm
by Nemo4t
Thanks a lot, this clarify all of my doubts.