Error messages when building the forecast

Good morning, please, we are trying to forecast the unemployment rate. We are following page 137 in the Dynare pdf manual and are getting an error message when using either basic_plan or flip_plan.

The following is the code for variable U, the rate of unemployment:

var U, U_BAR, U_HAT ;
varexo E_U_HAT, E_U_BAR ;
parameters alphaa ;
alphaa = 0.8 ;

model ;
U_HAT = alphaa * U_HAT(-1) + E_U_HAT ;
U_BAR = U_BAR(-1) + E_U_BAR ;
U = U_HAT + U_BAR ;

var E_U_HAT ; stderr 2 ;
var E_U_BAR ; stderr 0.6 ;

unit_root_vars U, U_BAR ;
varobs U ;

calib_smoother(datafile=IN_AUX) ;
smoothed = dseries('IN_AUX.csv');

Uplan = init_plan(2023Q3:2029Q4);
// Uplan = basic_plan(Uplan, 'E_U_HAT', 'perfect_foresight', 2023Q3:2023Q4, [15 15]); %Var exo
Uplan = flip_plan(Uplan, 'U', 'E_U_HAT', 'surprise', 2023Q3:2024Q3, [10 10.1 10.2 10.1]); %var endo y exo
U_forecast = det_cond_forecast(Uplan, smoothed);

The following is the error message we are getting either using basic_plan or flip_plan:

Error using det_cond_forecast
impossible case

Error in UForecast.driver (line 157)
U_forecast = det_cond_forecast(Uplan, smoothed);

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

Can you please provide the full files to replicate the issue. @stepan-a Do you know what is going on?

Sure, thank you.

IN.xlsx (19.3 KB)
Run_UForecast.m (1.7 KB)
Uploading: Uforecast_F.mod…

@stepan-a Could you please have a look? I think there is either a bug or the manual is wrong. det_cond_forecast seems to always expect three input arguments, i.e. the initial forecast date is mandatory.
UForecast.mod (696 Bytes)
IN_AUX.csv (2.8 KB)

Moreover, the second argument is supposed to indicate the past values of the endogenous variables. But using UForecast_3_arguments.mod (710 Bytes)
I get the error message

the dseries smoothed finish at time 2023Q2 before the last period of forecast 2024Q3

which does not make sense if only past values are needed.


  1. Please see the discussion at Document of fix behavior of det_cond_forecast (#1899) · Issues · Dynare / dynare · GitLab
  2. We are trying to investigate the upload issues. Does the problem persist for you? If yes, could you please state your device/OS/browser?

Thank you. Yes, we are still trying to solve the problem and trying to forecast with init_plan, basic_plan and flip_plan. We look forward for the solution to the problem, even if it takes some time.
Regarding the unit root, we have tried with a stationary version of the same model and the problem is still there.
I am using Windows 10 and Google Chrome.
Thank you very much.