Page 1 of 1

Observable Shocks in Dynare

PostPosted: Tue Jul 04, 2017 9:12 am
by ykkoca
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

Code: Select all
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.

Code: Select all
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.

Re: Observable Shocks in Dynare

PostPosted: Tue Jul 04, 2017 12:24 pm
by jpfeifer
Both setups should be equivalent. How do you judge that they return different results?

Re: Observable Shocks in Dynare

PostPosted: Tue Jul 04, 2017 12:58 pm
by ykkoca
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?

Re: Observable Shocks in Dynare

PostPosted: Tue Jul 04, 2017 1:03 pm
by jpfeifer
No, there isn't. Have you checked the mode_check plots and convergence of the MCMC?

Re: Observable Shocks in Dynare

PostPosted: Tue Jul 04, 2017 1:09 pm
by ykkoca
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.

Re: Observable Shocks in Dynare

PostPosted: Tue Jul 04, 2017 1:27 pm
by jpfeifer
Please send the files to my email.

Re: Observable Shocks in Dynare

PostPosted: Thu Jul 06, 2017 2:00 pm
by ykkoca
I just sent you the mod files and the datafile, using the email address: k...koca@metu.edu.tr

Re: Observable Shocks in Dynare

PostPosted: Fri Jul 07, 2017 4:21 pm
by jpfeifer
The different seems to purely come from the randomness of the MCMC. The posterior mode is identical.