Page 1 of 1

Forecast function and first order appr.

PostPosted: Tue Dec 08, 2009 12:24 pm
by JuRa
I have Dynare version 4.0.4. When I run this command:
stoch_simul(irf=0,order=1,noprint);
forecast(periods=20);

I get an error meassege:
??? Attempted to access ex(21,:); index out of bounds because size(ex)=[20,1].

Error in ==> simultxdet at 73
y_(dr.order_var,i) = dr.ys(dr.order_var)+dr.ghx*tempx+dr.ghu* ...

Error in ==> forecast at 120
[yf,int_width] = simultxdet(y0,ex,oo_.exo_det_simul,...

Error in ==> Aino_170107_TempVat_ExpII at 1527
info = forecast(var_list_,'simul');

Using the second order appr. however works
stoch_simul(irf=0,order=2,noprint);
forecast(periods=20);

In simultxdet funtion its written lin lines 73-74:
y_(dr.order_var,i) = dr.ys(dr.order_var)+dr.ghx*tempx+dr.ghu* ...
ex(i,:)';

should it be written
y_(dr.order_var,i) = dr.ys(dr.order_var)+dr.ghx*tempx+dr.ghu* ...
ex(i-ykmin,:)';
?

After this change, I can take first order appr. and run forecast. The results seems to be ok. Is there some other problem with this change.
Jukka

Re: Forecast function and first order appr.

PostPosted: Sat Dec 12, 2009 8:38 am
by pakocica
Dear Yukka,

how do use the exogenous variables in your model, can you send me your code? Don't you use something like e(+1) for an exogenous variable e?

Pavel

Re: Forecast function and first order appr.

PostPosted: Mon Dec 14, 2009 9:06 am
by SébastienVillemot
Hi,

Just for your information, the next release of Dynare (4.1) will accept leads and lags on exogenous variables.

Best

Re: Forecast function and first order appr.

PostPosted: Tue Dec 15, 2009 9:59 pm
by faical
Hi

I want to make forecast of a variable say YGAP, I need numbers in my forecast not graphs, Can you give me a hint ? I wrote these lines but It doesn t help


estimation(datafile=mydata,mh_replic=10000,mode_check,nobs=45,forecast=6,IRF=0);

stoch_simul(order=1,nocorr,nomoments) ;

forecast ;


I thank you in advance.

Re: Forecast function and first order appr.

PostPosted: Wed Dec 16, 2009 10:25 am
by JuRa
viewtopic.php?f=1&t=2376

I'm wondering the same myself in the other topic.

Jukka