Something wrong with forecasting

Hello Everyone

I have a problem with my code
If I do not use the forecast command in the estimation command, then Dynare works well
But then I use the command forecast = 4 as following

esimation(…,forecast=4)data_pid data_wp data_c data_i data_R E_t data_y data_pic;

, then Dynare report the following error
"Matrix dimensions must agree.
Error in prior_posterior_statistics_core (line 206)
yf = yf+repmat(SteadyState’,horizon+maxlag,1);
Error in prior_posterior_statistics (line 222)
[fout] = prior_posterior_statistics_core(localVars,1,B,0);
Error in dynare_estimation_1 (line 821)
prior_posterior_statistics(‘posterior’,dataset_);
Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);
Error in ALEstim_pet_modi (line 1010)
dynare_estimation(var_list_);
Error in dynare (line 180)
evalin(‘base’,fname) ;
Error in Main (line 3)
dynare ALEstim_pet_modi "
without forecast=4 inside estimation( ); it works well
Can anyone help me to detect this problem
With best wishes

Are you using Dynare 4.5.1? If yes, please provide the files.

Dear Prof. @jpfeifer

I do not use Dynare 4.5.1. I am using Dynare 4.4

My file has more than 12MB, so that I can not upload here

With best wishes

Then please upgrade and try again. There have been bugfixes associated with forecasting

Dear Prof. @jpfeifer

I use Dynare 4.5, but then Dynare reports

"Error using initial_estimation_checks (line 143)
initial_estimation_checks:: The forecast error variance in the multivariate Kalman filter became singular.
Error in initial_estimation_checks (line 143)
error(‘initial_estimation_checks:: The forecast error variance in the multivariate Kalman filter became singular.’)
Error in dynare_estimation_1 (line 165)
oo_ = initial_estimation_checks(objective_function,xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
Error in dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);
Error in ALEstim_pet_modi (line 1017)
oo_recursive_=dynare_estimation(var_list_);
Error in dynare (line 223)
evalin(‘base’,fname) ;
Error in Main (line 3)
dynare ALEstim_pet_modi nostrict ‘’

I can not upload my file in here since it has more than 12 MB

  1. That indicates that your model is stochastically singular. You should fix this.
  2. Why is your file so big? One only needs the mod-file, the data, the steady state file, and the mode-file (if it exists)

Dear Prof. @jpfeifer

  1. If my model has [quote=“jpfeifer, post:6, topic:10867”]
    stochastically singular. You should fix this.
    [/quote]. How o fix it?

I still confuse that problem, because I can estimate model. All parameters converge. Only thing happens is that I can not run the forecast command

  1. My file is here file.zip (28.3 KB)

With best wishes

No, estimation does not work properly as the error indicates. You just did not see the problem in older versions of Dynare.
See e.g. Performing an estimation of parameters using real data for a discussion of the problem.

Dear @jpfeifer

stochastically singular means that in my model, number of obs.variable is greater than number of shock. My understanding is correct? if not, please correct me

With best wishes

Either that, or your observables imply an exact linear combination (more likely here)

Dear. @jpfeifer

In this case, the solution is to eliminate some obs.variables. is that solution good?or do you have any advice for me how to overcome this problem

Either that or measurement error.

Dear Prof. @jpfeifer

In my model, there is 7 shocks and 6 obs. variables
Seven shocks are
1.eps_epshat
2.eps_lambdafhat
3.eps_upsilonhat
4.eps_zetachat
5.eps_zetahhat
6. eps_epsRhat
7. eps_piThat

Six obs. variables are
1.data_pid
2.data_c
3.data_i
4.data_R
5.E_t
6.data_y

I running dynare 4.5.0 (not 4.5.1), then it reports following error:

"Error using reshape
To RESHAPE the number of elements must not change.
Error in McMCDiagnostics (line 93)
Draws = reshape(Draws,[NumberOfDraws nblck]);
Error in dynare_estimation_1 (line 464)
oo_= McMCDiagnostics(options_, estim_params_, M_,oo_);
Error in dynare_estimation (line 105)
dynare_estimation_1(var_list,dname);
Error in ALEstim_pet_modi (line 1001)
oo_recursive_=dynare_estimation(var_list_);
Error in dynare (line 223)
evalin(‘base’,fname) ;
Error in Main (line 4)
dynare ALEstim_pet_modi nostrict "

I do not know what is this
my file is here q8.zip (28.3 KB)

Do you think, this problem is caused by the steady state file?

With best wishes

I am not sure what you are doing, but you cannot use the load_mh_file-option if you are changing your model features like the observables. You need to start from scratch in this case (except for the mode-file)

Dear Prof. Pfeifer

My model now runs well with not only lastest version but also older version of Dynare

Thank you so much for your advice

With best wishes

Hi @peter
How did you solve the problem?

Hello Matheu

Thank you for your question

Yes, I got it, my proble is over