Observable Shocks in Dynare

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Observable Shocks in Dynare

Postby ykkoca » Tue Jul 04, 2017 9:12 am

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.
ykkoca
 
Posts: 4
Joined: Tue Jul 04, 2017 8:56 am

Re: Observable Shocks in Dynare

Postby jpfeifer » Tue Jul 04, 2017 12:24 pm

Both setups should be equivalent. How do you judge that they return different results?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Observable Shocks in Dynare

Postby ykkoca » Tue Jul 04, 2017 12:58 pm

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?
Last edited by ykkoca on Tue Jul 04, 2017 1:11 pm, edited 1 time in total.
ykkoca
 
Posts: 4
Joined: Tue Jul 04, 2017 8:56 am

Re: Observable Shocks in Dynare

Postby jpfeifer » Tue Jul 04, 2017 1:03 pm

No, there isn't. Have you checked the mode_check plots and convergence of the MCMC?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Observable Shocks in Dynare

Postby ykkoca » Tue Jul 04, 2017 1:09 pm

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.
ykkoca
 
Posts: 4
Joined: Tue Jul 04, 2017 8:56 am

Re: Observable Shocks in Dynare

Postby jpfeifer » Tue Jul 04, 2017 1:27 pm

Please send the files to my email.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: Observable Shocks in Dynare

Postby ykkoca » Thu Jul 06, 2017 2:00 pm

I just sent you the mod files and the datafile, using the email address: k...koca@metu.edu.tr
ykkoca
 
Posts: 4
Joined: Tue Jul 04, 2017 8:56 am

Re: Observable Shocks in Dynare

Postby jpfeifer » Fri Jul 07, 2017 4:21 pm

The different seems to purely come from the randomness of the MCMC. The posterior mode is identical.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 11 guests