Hello all,

I’m trying to estimate the following model under constant-gain-least squares learning, as presented in Milani 2014 and elsewhere:

\pi_t = \beta E_{t-1}\pi_{t+1} + \kappa x_t + u_t \\ x_t = E_{t-1} x_{t+1} - \sigma(i_t - E_{t-1}\pi_{t+1}) + g_t \\ i_t = \rho_t i_{t-1} + (1-\rho_t)(\chi_{pi,t}\pi_{t-1}+\chi_{x,t}x_{t-1}) + \varepsilon_{r,t} \\ u_t = \rho_u u_{t-1} + \varepsilon_{u,t}\\ g_t = \rho_gg_{t-1} + \varepsilon_{g,t}

Wherein agents have the perceived law of motion Z_t = a_t + b_t Z_{t-1} + \eta_t, Z_t \equiv (\pi_t,x_t,i_t)' and agents beliefs \phi_t = (a_t,b_t)' are updated according to the scheme \phi_t = \phi_{t-1} + \gamma R_{t-1}^{-1}X_t(y_t - \phi_{t-1}'X_t)' \\ R_t = R_{t-1} + \gamma (X_tX_t' - R_{t-1}), implying that E_{t-1}Z_{t+1} = a_{t-1} + b_{t-1}a_{t-1} + b_{t-1}^2Z_{t-1}

X_t \equiv (1,\pi_{t-1},x_{t-1},i_{t-1})'

Has anyone else coded a likelihood function for a similar model, or perhaps is there a way to use Dynare to estimate a similar model?

kalman.m (3.8 KB)