Correlation mat vs corrcoef

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

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.

Yeah, you are right, it made a big difference when taking away the hp_filter command. Thank you :slight_smile:. 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?

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.