 # Specifying observation equations for non-linear models

Hi Dynare team

I am trying to estimate a nonlinear model in Dynare with a mix of filtered and unfiltered data. I read Johannes’ excellent guide of specifying observation equations, and I just wanted to clarify that I’ve specified the equations correctly.

I have the following data:
R_{t}^{obs} : gross nominal interest rate (quarterly) (unfiltered)
\Pi_{t}^{obs} : gross nominal inflation rate (quarterly) (unfiltered)
e_{t}^{obs} : log differences of the real exchange rate (demeaned)
r_{t}^{k,obs} : net rate of return on capital (quarterly) (unfiltered)

Currently, in my Dynare code I have the following observation equations:

``````R_obs = R;
Pi_obs = Pi;
rk_obs = rk + log(Rk_bar);
``````

Where R, \Pi, and e are entered in the other model equations using exp() transformations, and where rk is left as-is.

I am a bit unsure if I have specified the return on capital observation equation correctly. The way it is now, I would have to use Dynare to estimate Rk_bar, as rk is basically – using common notation – “rk_hat”.

1. Why are you matching an empirical log difference of the exchange rate to a percentage deviation from steady state?
2. If you use an exp()-transformation, then your variables will be in logs. This will turn a gross rate into a net one. So you are matching net rates in the model to gross rates in the data.
3. You did not explicitly say what `rk` is in the model. If it’s a log deviation of the gross return on capital from steady state, then adding back the log steady state will result in the net return on capital as observed in the data.

Thanks for the response, Johannes.

So if I understand you correctly, my measurement equations should be:

``````lnR_obs = R;
lnPi_obs = Pi;
e_obs = e - e(-1);
rk_obs = rk;
``````

where `lnR_obs` and `lnPi_obs` is the logged nominal gross interest rate and inflation in the data, respectively.
`rk`, is not in logs in the model and is simply the net return/rental rate of capital.

As for e_{t}^{obs}, since the data is log differences of the real exchange rate, then I would have to specify the measurement equation as `e-e(-1)`. However, I’m not sure if this is doable as I couldn’t find an example in your paper. Have I assumed the timing convention correctly?

1. Yes, the one for the exchange rate looks correct.
2. If `rk` contains the mean, it is also correct.

Thanks you Johannes.

I’m now in the process of estimating the model but I’m getting a “posterior kernel optimisation problem”. I’m not quite sure how to proceed. Would you mind taking a look at the mod file?

ABK_estimation_params.mat (186 Bytes) ABK_estimation.mod (27.8 KB) data_stderr_params.mat (869 Bytes) obs_data.mat (65.3 KB)

Try ABK_estimation_mode.mat (1.4 KB) ABK_estimation.mod (27.9 KB)
You will see that `zeta` runs into an upper bound. You need to understand why that is the case.

`zeta` (or any other parameter for that matter) running into an upper bound can cause a negative Hessian matrix error?

The condition for the Hessian is for an interior maximum. It does not hold at corners. You can see in the mode_file that the entries related to `zeta` are NaN.

Ah! Good point. Thanks Johannes.