Comparing results in dynare 3 and dynare 4

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.

Comparing results in dynare 3 and dynare 4

Postby pb2415 » Fri Mar 19, 2010 4:53 am

Hi I am making a tramsition from version 3 to the latest version 4.
I find that the stoch simul has very different results for cross correlation computaions. What is the reason for this difference? For example cross correlation chnages from -.5 to -.69.
Generally correlations seem like bigger numbers in version 4?
Which one should I report in my work, version 3 or version 4?

Any help?

PB
pb2415
 
Posts: 4
Joined: Fri Mar 19, 2010 4:40 am

Re: Comparing results in dynare 3 and dynare 4

Postby SébastienVillemot » Fri Mar 19, 2010 8:56 am

Hi,

Are you using theoretical moments or simulated moments? In the latter case, the discrepancy probably comes from a sampling error, you should probably increase the number of simulations.

If you are using theoretical moments, please send us the MOD file so that we can determine if this is a bug in Dynare.

Best
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: Comparing results in dynare 3 and dynare 4

Postby pb2415 » Fri Mar 19, 2010 1:44 pm

Dear Sebastien, Thanks for the prompt response. I am using the theoretical moments and the matrix of cross correlations. Can you please explain how dynare computes theoretical moments and cross correlations. I did not see any option to calculate simulated moments.

Anyways I attach the programme again. Thanks again for your help.
-PB
Attachments
AP17_adj_ret1.mod
(2.72 KiB) Downloaded 92 times
pb2415
 
Posts: 4
Joined: Fri Mar 19, 2010 4:40 am

Re: Comparing results in dynare 3 and dynare 4

Postby SébastienVillemot » Mon Mar 29, 2010 12:40 pm

Hi

I tested your MOD file with Dynare 3 and with Dynare 4.1.0, and I get exactly the same results. In particular, the matrix of cross-correlations is the following on both versions:

Code: Select all
MATRIX OF CORRELATIONS

Variables    q        g        infl     iy       ret     
q            1.0000  0.0436 -0.7332  0.9690  0.7440
g            0.0436  1.0000 -0.6889 -0.2044  0.6998
infl        -0.7332 -0.6889  1.0000 -0.5467 -0.9875
iy           0.9690 -0.2044 -0.5467  1.0000  0.5559
ret          0.7440  0.6998 -0.9875  0.5559  1.0000


Best
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: Comparing results in dynare 3 and dynare 4

Postby dony » Thu Apr 01, 2010 3:13 pm

Hi,

I compared the results from Dynare 3 and Dynare 4.0.4 using the example file RBC_Monop_JFV.mod. I got the different results. I used the same MOD file came with Dynare 4.0.4. Both dynares are on Linux built from source.

Dynare 3: RBC_Monop_JFV.mod

AUTOCORRELATION OF SIMULATED VARIABLES

VARIABLE 1 2 3 4 5
c 0.9930 0.9858 0.9769 0.9666 0.9551
i 0.9148 0.8379 0.7624 0.6926 0.6262
k 0.9981 0.9951 0.9902 0.9836 0.9755
l 0.8988 0.8068 0.7170 0.6345 0.5567
r 0.9127 0.8322 0.7531 0.6804 0.6121
w 0.9844 0.9696 0.9535 0.9369 0.9195
y 0.9619 0.9271 0.8920 0.8584 0.8252
y_l 0.9844 0.9696 0.9535 0.9369 0.9195
z 0.9494 0.9033 0.8575 0.8143 0.7724
>>

Dynare 4.0.4: RBC_Monop_JFV.mod

AUTOCORRELATION OF SIMULATED VARIABLES

VARIABLE 1 2 3 4 5
y 0.9678 0.9358 0.9037 0.8721 0.8401
c 0.9960 0.9889 0.9801 0.9700 0.9585
k 1.0005 0.9973 0.9922 0.9855 0.9772
i 0.9240 0.8533 0.7849 0.7200 0.6559
l 0.9084 0.8239 0.7424 0.6657 0.5907
y_l 0.9883 0.9743 0.9591 0.9431 0.9260
w 0.9883 0.9743 0.9591 0.9431 0.9260
r 0.9199 0.8456 0.7739 0.7061 0.6396
z 0.9561 0.9137 0.8718 0.8314 0.7911

Thanks!
Yulan
dony
 
Posts: 7
Joined: Wed Apr 15, 2009 6:46 pm

Re: Comparing results in dynare 3 and dynare 4

Postby StephaneAdjemian » Fri Apr 02, 2010 8:16 pm

Hi Yulan, You are computing 2nd order moments using samples generated by the DSGE model. If you do not fix the seed (see the manual and/or the documentation of matlab) or do not compute theoretical moments (again see the manual) you won't obtain the same results.

There is something weird in your reported results with Dynare 4.0.4, the first order autocorrelation of k is slightly greater than one!!.. This should never happen.

Why don't you use dynare 4.1.0?

Best,
Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.

Re: Comparing results in dynare 3 and dynare 4

Postby dony » Wed Apr 07, 2010 3:15 pm

Thanks Stephane!

I installed Dynare-4.1.0. Configuration (with matlab, without octave) and make are Okay, no errors. But Matlab was crashed when I ran some of the MOD files under tests directory which include example1.mod and example2.mod. The same example1.mod and example2.mod work fine with dyanre-3. Anything wrong with my installation? My system is:

-------------------------------------------------------------------------------------
MATLAB Version 7.4.0.287 (R2007a)
MATLAB License Number:
Operating System: Linux 2.6.9-34.ELsmp #1 SMP Fri Feb 24 16:56:28 EST 2006 x86_64
Java VM Version: Java 1.5.0_04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------

"make check" gives following error message:
...
Making check in tests
make[1]: Entering directory `/apps/dynare/dynare-4.1.0/tests'
make check-local
make[2]: Entering directory `/apps/dynare/dynare-4.1.0/tests'
error: invalid number of indices (= 0) for 2-dimensional array
error: evaluating argument list element number 1
make[2]: *** [check-octave] Error 1
make[2]: Leaving directory `/apps/dynare/dynare-4.1.0/tests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/apps/dynare/dynare-4.1.0/tests'
make: *** [check-recursive] Error 1

Thanks!
Yulan
dony
 
Posts: 7
Joined: Wed Apr 15, 2009 6:46 pm

Re: Comparing results in dynare 3 and dynare 4

Postby SébastienVillemot » Thu Apr 15, 2010 9:49 am

Hi,

Here you report an error message with "make check", which runs the testsuite on Octave, not on MATLAB.

Please report the error message that you get with MATLAB when you run example1.mod or example2.mod

I also encourage you to upgrade to Dynare 4.1.1 which was just released.

Best
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: Comparing results in dynare 3 and dynare 4

Postby dony » Thu Apr 15, 2010 3:50 pm

Hi Sébastien,

Other than those error message, I have only dump files generated from crashed matlab. I also installed 4.1.1, 'example1.mod' and example2.mod' under $DYNARE_ROOT/tests/ also crash matlab. I digged a little bit when running example1.mod, the crashing is coused by line 568 in dr1.m:

B1 = B*A_times_B_kronecker_C(dr.ghxx,hx,hu1);

Before line 568, dr.ghxx, hx and hu1 have following values:

dr.ghxx:
0.0013 -0.0055 -0.0055 -0.0055 0.2264 0.2264 -0.0055 0.2264 0.2264
-0.0001 0.0190 0.0190 0.0190 2.3838 2.3838 0.0190 2.3838 2.3838
0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 -0.0000
0 0.0000 -0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000
-0.0014 0.0310 0.0261 0.0310 2.7097 1.0107 0.0261 1.0107 0.2364
-0.0012 0.0112 -0.0245 0.0112 0.3967 0.0039 -0.0245 0.0039 0.2987

hx:
0.9418 1.4191 1.4191
-0.0000 0.9500 0.0250
0.0000 0.0250 0.9500

hu1:
1.4554 1.4554
1.0000 -0.0000
0 1.0000

And dynare-3 can run this model with no problem.

Your help is very much appreciated.

Yulan
dony
 
Posts: 7
Joined: Wed Apr 15, 2009 6:46 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests

cron