setting problems: "periods" and "stoch_simul"

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.

setting problems: "periods" and "stoch_simul"

Postby winifred » Mon Aug 10, 2009 11:31 am

Dear all

I am trying to run the Hansen model and have some findings. It would be good if you can confirm what I think.

When I tried to run the stoch_simul in dynare 4, it got two different results with the settings of "periods" and "stoch_simul" and computed results. ( it's kind of I am playing with them). Let me use different situations to explain:

===========================================================================
Situation 1: if i set
--------------------------------------------------------------------------------------------------------
periods 20100;
:
:
:
stoch_simul(hp_filter = 1600, order = 1);
statistic1 = 100*sqrt(diag(oo_.var(1:7,1:7)))./oo_.mean(1:7)';
--------------------------------------------------------------------------------------------------------
The above codes can work but the results are totally out of that of the original paper.
===========================================================================


===========================================================================
Situation 2: if i set
--------------------------------------------------------------------------------------------------------
%periods 20100; <---(which mean i do not run this code):
:
stoch_simul(hp_filter = 1600, order = 1);
statistic1 = 100*sqrt(diag(oo_.var(1:7,1:7)))./oo_.mean(1:7)';
--------------------------------------------------------------------------------------------------------
The above codes cannot work for the last line. But if i change the last line to be
statistic1 = 100*sqrt(diag(oo_.var(1:7,1:7)))./oo_.mean(1:7);
which means not transpose the mean of variables, and the above codes work.
===========================================================================

Now my questions are
(1) when i want to run "hp filter", is that necessary to set the "periods"?
(2) can someone tell me that the Hansen model runs with simulation or not. It seems that the hp_filter does the simulation job already, and i don't need to set "periods" again, otherwise the results (e.g. the standard deviation of variables) will be too big.
(3) if it is no need to run "periods" when i run Hansen model, then what case for setting the "periods" and "stoch_simul" at the same time?
(4) why sometime we need to transpose the mean figures and somtimes don't?


Thanks for all the sharing and solving my confusions.
winifred
 
Posts: 12
Joined: Tue Oct 21, 2008 10:02 am

Re: setting problems: "periods" and "stoch_simul"

Postby StephaneAdjemian » Fri Aug 28, 2009 2:35 pm

Hi,

If the periods keyword is used, then Dynare computes the simulated moments. Without this keyword Dynare computes the theoretical moments. The hp filter option does not affect this, because we are able to compute the theoretical 2nd order moments of hp dentrended data.

The transpose thing is a bug we have to fix...

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: setting problems: "periods" and "stoch_simul"

Postby StephaneAdjemian » Wed Sep 09, 2009 2:20 pm

Hi, the bug is fixed in the trunk. The theoretical mean (stored in oo_.mean) or the simulated mean (again stored in oo_.mean) is a column vector.

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.


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 15 guests