Dynare ++ versus Dynare in Matlab

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.

Dynare ++ versus Dynare in Matlab

Postby Lars12 » Thu Jun 03, 2010 8:23 pm

Hi

I would like to use the 3rd approximation in dynare++. But by testing dynare++ I ran into the following problem. When I compute the first order approximation in dynare++, the steady state values do NOT agree with the mean values. Why is that? Attached is the mod file and Matlab output.

Thanks
Lars

MOD file:
var k, c, x;
varexo e;
parameters A, beta, rhoX, delta, RRA, nu;
A = -3;
nu = 0.9;
rhoX = 0.95;
delta = 0.03;
beta = 0.99;
RRA = 4;
model;
c^(-RRA) = beta*c(+1)^(-RRA)*(exp(x(+1))*nu*k^(nu-1) + 1 - delta);
c + k = exp(x)*k(-1)^nu + (1-delta)*k(-1);
x = (1-rhoX)*A + rhoX*x(-1) + e;
end;
initval;
k = ( (1/beta+delta-1)/(exp(A)*nu) )^(1/(nu-1));
c = (1-delta)*k;
x = A;
e = 0;
end;
shocks;
var e=0.01^2;
end;
steady;
stoch_simul(order=1);

Matlab output:
dyn_ss

dyn_ss =

3.034153271995179
-3.000000000000000
0.044167191849358

>> dyn_mean

dyn_mean =

3.044558450113021
-2.998402425072781
0.044312741256193
Lars12
 
Posts: 4
Joined: Wed Feb 03, 2010 5:28 pm

Re: Dynare ++ versus Dynare in Matlab

Postby SébastienVillemot » Mon Jun 07, 2010 3:39 pm

Hi,

This is most probably because Dynare++ computes empirical moments of variables, and not theoretical moments.

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: Dynare ++ versus Dynare in Matlab

Postby Lars12 » Tue Aug 24, 2010 1:27 pm

Hi Sebastien

Thanks for you reply.

I am not convinced that dynare++ uses simulation to compute moments (i.e. dyn_mean).
When I rerun the code, I always get the same means up to 15 digits.

Best
Lars
Lars12
 
Posts: 4
Joined: Wed Feb 03, 2010 5:28 pm

Re: Dynare ++ versus Dynare in Matlab

Postby jpfeifer » Tue Aug 24, 2010 2:46 pm

Have you checked if this is due to the re-centering of the decision rules along the so-called "fix point" in the Dynare++ manual. Try invoking Dynare++ with
Code: Select all
dynare++ --no-centralize yxz.mod

If this gives you the same mean as in Matlab, you have found your reason.
------------
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: Dynare ++ versus Dynare in Matlab

Postby SébastienVillemot » Wed Aug 25, 2010 8:57 am

It’s not because you always get the same results for moments that they are not empirical.

The point is, as you may know, that randomness in computers is generally pseudo randomness. Most algorithms (including Dynare++) use pseudo-random generators which are deterministic sequences of apparently random numbers, starting from a "seed".

If the seed is always the same, then the sequence of generated random numbers is always the same too.

This is what happens with Dynare++: it always uses the same seed at start-up by default. I think you can manually change the seed, see the reference manual.

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


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests