Hi

I’m trying to estimate a simple model where an observable variable depends on the product between a latent state with an AR process and an observable exogenous variable. Here is the code (skipping a few steps, which are included in the attachment):

```
var mi_hh mpti q_inv_hh;
varexo e e_mpti q_inv_hh_obs;
model(linear);
mi_hh = q_inv_hh*mpti + e;
mpti = rrho_1 * mpti(-1) + rrho_2 * mpti(-2) + e_mpti;
q_inv_hh = q_inv_hh_obs;
end;
varobs mi_hh q_inv_hh;
estimation(datafile=country_data);
```

So mpti is the time varying coefficient, and q_inv_hh_obs is the exogenous variable. Dynare says that the model is non-linear which, strictly speaking, is true, given the first equation is the product of two endogenous variables. However, varobs only takes endogenous variables, so I always have to define q_inv_hh as endogenous. Any suggestions on how to solve this conundrum?

thanks

country_data.mat (1.7 KB)

mod_test.mod (588 Bytes)

It seems as if Dynare is not well suited for this exercise. Is the plan to have forward looking aspects in the model? And do you need to solve a full filtering problem? Or could you use a conditional likelihood?

Hi, thanks for the answer.

Yeah, it would seem so, but other toolkits (like Fabio Canova’s toolkit or Julia MacroModelling) have other limitations (e.g., FC does not do the linearization bit that I need, as the final model has non-linear terms, and Dynare has, nor does it allow one to have more than 1 lag with stochastic trend spec). So maybe I need to compromise on the model spec.

To answer your questions: although it would be nice to have the option to incorporate forward-looking aspects into the model, it’s not essential. I do need to estimate the latent variables and their covariances though. Do you have any suggestions for alternative toolkits?

But you are not interested in any stochastic effects the exogenous observed variable may have? Linearization will kill that. So essentially you have a state space system

\begin{align}
x_t&=Gx_{t-1} + \varepsilon_t\\
y_t&=H_tx_t+\nu_t
\end{align}

where H_t is a known fixed matrix.

Yeah that’s a (simpler) version of the model I want to estimate. In practice I’m building up to have something like:

z_t = …

x_t = …

y_t = H_t x_t *f(x_t,z_t) + z_t * g(x_t,z_t) +nu_t

where z_t is another state variable, H_t is observable, and f and g are non-linear functions of x and z. I need estimates of x and z, plus their AR parameters and the covariances.

This is why I need linearization. Otherwise, I need particle filtering or some other non-linear estimation tech, as I understand it. I wish to avoid this because of speed concerns.