Bayesian estimation, nonlinear models

Dear all:

When the equations are nonlinear in model block, and the shock process is log(z)=rho_z*log(z(-1))+eps_z. The data is logged and HP-filtered.

I write the observation equations as y_obs=y, where y is the variable in model, and y_obs is its observation, and add the logdata and loglinear options in command estimation.

Is there any error in my procedure? I am not sure about it.

Thank you.

  1. The usual disclaimer: do not use the two-sided HP filter for estimation. See Pfeifer (2013): “A Guide to Specifying Observation Equations for the Estimation of DSGE Models
  2. The observation equation is problematic. y_obs is a percentage deviation from trend. As it is already logged, the logdata option must be used, when using loglinear. As your model is nonlinear, y will not measure deviations from trend and thus cannot correspond to y_obs (regardless of whether it is logged or not) unless both are mean 1/log mean 0. The loglinear option means that you do not need to use an exp()-substitution to get a log-linearization. As y_obs is logged and should be equal to y, using loglinear correctly logs both variables in the model. The problem still is the mean. You should have
    i.e. a demeand gross growth rate.

Thanks for your great help, and I know how to write the observation in my mod file.
I have another question, supposing y_data is the original data, let
then could I write the observation equation as y/stead(y)=y_obs.?