Bayesian estimation

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]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;[/code]

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

You need to correctly define the variables and parameters:

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.

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?
MarcoRBC_Bayes.mod (4.23 KB)

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” sites.google.com/site/pfeiferecon/Pfeifer_2013_Observation_Equations.pdf.

Thanks a lot, this clarify all of my doubts.