Observable Shocks in Dynare

Hello,

I am trying to estimate a linear model using the Dynare MH algorithm. In one of the equations, I have the variable for exchange rate (ER), which I want to impose as exogenous. However, this is actually an observed exogenous variable, so I cannot declare ER as varexo
Let me show you the part of code representing the trick. Say I want to estimate the parameter beta

var y, ER;
varexo v1, v2;
parameters beta;

model;
y = beta*ER + v1;
ER = v2;
end;

shocks;
var v1; stderr 1;
var v2; stderr 1;
end;

varobs y, ER;

ER and y are provided to dynare in a datafile. Here is the alternative, but quite similar part of code that should generate the same result as with the code above.

var y, ER, ERobs;
varexo v1, v2;
parameters beta;

model;
y = beta*ER + v1;
ER = v2;
ERobs = ER
end;

shocks;
var v1; stderr 1;
var v2; stderr 1;
end;

varobs y, ERobs;

However, these two codes do not return the same results. I have two questions.

  1. Is any of these two codes answer to my question? If not, what should I change in the code?
  2. Why do these two codes return different results?

I tried to be clear as much as I could, but am willing to provide any information that I might have missed. Thanks in advance.

Both setups should be equivalent. How do you judge that they return different results?

Posterior distributions for beta are different between the two setups. However, one thing to notice is that, the full model includes an unobserved variable and the distributions for the unobserved variable are different over the setups. So I might as well say that I am confused a bit, because, I think, posterior distribution for beta must be same as well.

By the way, is there a more direct way of including observable shocks in dynare?

No, there isn’t. Have you checked the mode_check plots and convergence of the MCMC?

I am extending my dataset a bit at the moment so I cannot run my file now, but you asking for me to check them implies that mode_check plots and MCMC convergence statistics should be equivalent over the setups, right?

edit: Check the edit on my previous post, marked by red colour. The unobserved variable generated by the two setups are different as well.

I cannot provide the datafile I am using, unfortunately. I can provide my models with dummy data, however. So, anyone can check for what is causing this.

Please send the files to my email.

I just sent you the mod files and the datafile, using the email address: k...koca@metu.edu.tr

The different seems to purely come from the randomness of the MCMC. The posterior mode is identical.