Forecast function and first order appr

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.ghxtempx+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.ghxtempx+dr.ghu
ex(i,:)’;

should it be written
y_(dr.order_var,i) = dr.ys(dr.order_var)+dr.ghxtempx+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

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

Hi,

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

Best

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.

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

Jukka