Page 1 of 1

simult_ vs stoch_simul

PostPosted: Tue May 24, 2016 4:41 pm
by sidus87
Dear All,

I have a question concerning the simulation of the model using simult_ and stoch_simul.
In particular, i wanna calculate the ergodic mean of a variable "y". For this I consider two possibilities:

rng(1000)
stoch_simul(order=3,periods=10000,drop=8000,replic=0,irf=0,noprint,nomoments,nofunctions,nocorr,pruning);

and then just take mean(y).

Alternatively what I do is:

T=10000;
ex_ = randn(T,2); %I have two shocks in the model. shocks in the model are written as sigma_eps*eps
rng(1000)
simulation=simult_(oo_.steady_state,oo_.dr,ex_,options_.order);
ergo=mean(simulation(:,8000:end));
endonames=cellstr(M_.endo_names); %make them strings to use strcmp
index=find(strcmp('y',endonames));
y_ergo=mean(ergo(index));

strangely the results are very different. With the first procedure I get 0.9122 and with the second I get -7.8219.

Do you have an explanation for this?

Re: simult_ vs stoch_simul

PostPosted: Sat May 28, 2016 8:21 am
by jpfeifer
Did you enable pruning for the second one? If yes, please provide the codes