Problam with bvar_forecast

Dear Professor,

My model is working nicely until the estimation. However, when I am adding,

    bvar_forecast(forecast = 12, bvar_replic = 1000) 4; 

am getting the following error:

Nonfinite endpoints or increment for colon operator in index.
Error in bvar_toolbox (line 98)
vprior.sig = std(dataset(options_.first_obs+options_.presample-nlags:options_.first_obs+options_.presample,:))’;

Error in bvar_forecast (line 36)
[ny, nx, posterior, prior, forecast_data] = bvar_toolbox(nlags);

Error in Woodford.driver (line 414)
bvar_forecast(4);

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

Could you please help?

Thank you

Best Regards
Sahil

I would need to see the codes.

Dear Professor,

Thank you for your reply. Please find the attached files.
BVAR.zip (8.3 KB)

Thank you

Best
Sahil

Why are you running a bvar_forecast after estimating DSGE model? You need to estimate a BVAR.

I am doing this because I want to see the forecasting accuracy of the DSGE as compared to the BVAR. I am a bit confused if I am following the right procedure.

You need two different files for that. One for the DSGE model and one for the VAR.

I know that this is a late answer. You made a mistake. If you want to estimate the model with n lags must not include the first n observations.