Correlation mat vs corrcoef

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.

Correlation mat vs corrcoef

Postby Glm » Tue Jan 17, 2012 1:06 pm

Hi!

If I run a simulation using the following simul_stoch command.
stoch_simul(order=1, irf=400, periods=100000, nograph, hp_filter=1600);

The correlation between X and Y in the correlation matrix is not the same as using the Matlab command corrcoef(X,Y). How come?

\\\Glenn
Glm
 
Posts: 47
Joined: Tue Jan 17, 2012 12:54 pm

Re: Correlation mat vs corrcoef

Postby jpfeifer » Tue Jan 17, 2012 4:55 pm

Hi, could you specify in more detail how you compute moments with corrcoef(X,Y)? Which simulated data do you use? And did you HP-filter them? The simulated data provided by Dynare when using the hp_filter option is not filtered yet. This could explain the differences.
------------
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: Correlation mat vs corrcoef

Postby Glm » Tue Jan 17, 2012 6:47 pm

Yeah, you are right, it made a big difference when taking away the hp_filter command. Thank you :). Furthermore, do you know how people do in general when using Dynare output in their papers? Do they use the theoretical moments and correlations or the simulated ones? I mean which is the safe way to go when using Dynare output in a paper?
Glm
 
Posts: 47
Joined: Tue Jan 17, 2012 12:54 pm

Re: Correlation mat vs corrcoef

Postby jpfeifer » Tue Jan 17, 2012 6:54 pm

It depends. Papers usually specify if the moments they use are theoretical ones or generated from simulated data. My personal feeling is that if you have theoretical moments, there is no use in approximating these numbers with a finite sample. Asymptotically, you will converge to the theoretical numbers in any case.
------------
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 5 guests