Bayesian 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.

Bayesian estimation

Postby Nemo4t » Sat Nov 22, 2014 11:49 am

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
Nemo4t
 
Posts: 9
Joined: Thu Nov 06, 2014 10:55 am

Re: Bayesian estimation

Postby jpfeifer » Sat Nov 22, 2014 1:31 pm

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.
------------
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: Bayesian estimation

Postby Nemo4t » Sat Nov 22, 2014 2:23 pm

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?
Attachments
MarcoRBC_Bayes.mod
(4.23 KiB) Downloaded 40 times
Nemo4t
 
Posts: 9
Joined: Thu Nov 06, 2014 10:55 am

Re: Bayesian estimation

Postby jpfeifer » Tue Nov 25, 2014 7:09 am

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.
------------
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: Bayesian estimation

Postby Nemo4t » Wed Nov 26, 2014 7:21 pm

Thanks a lot, this clarify all of my doubts.
Nemo4t
 
Posts: 9
Joined: Thu Nov 06, 2014 10:55 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 11 guests