# Bayesian Estimation of RE models

Dear All

I am estimating a standard RE model. In the example below I estimate coefficients a11,a12,a13,a21,a22,a23.

I can write the model in two versions

version 1:

model(linear);

x(1) = a11x + a12y(-1) + a13eps;
y = a21
x + a22y(-1) + a23eta;

end;

version 2:

model(linear);

# [b11,b12,b13,b21,b22,b23]=BK(a11,a12,a13,a21,a22,a23);

y = b11y(-1) + b12eta + b13 eps;
x = b21
y(-1) + b22*eta + b23 *eps;

end;

In the version 2 I use a matlab subroutine that solves the RE model (performing say Blanchard-Kahn decomposition, or, more generally qz decomposition).

I wonder why the estimates differ SUBSTANTIALLY, both and posteriors of coefficients and marginal data densities? I would have thought that the Dynare translates version 1 into version 2 before the estimation. Am I wrong? (The BK decomposition I use is standard and correct - I cannot see how it can be wrong.)

PS. I work witn Dynare 3 as Dynare 4 does not eat the line # [b11,b12,b13,b21,b22,b23]=BK(a11,a12,a13,a21,a22,a23); I will be also grateful if one explains how to call Matlab routines inside the model block.

Tanya

Hi,

You should obtain the same results, without the files I cannot say why you obtain so different results. The gap may be caused by typos in the models declaration.

Currently it’s not possible to update parameters inside the model block using user defined matlab functions. The trick is to update the parameters in a steady state file. You should read this post, where you will find an example.

Best,
Stéphane.