Error using assignin


I want to simulate some time series from an estimated model. I am using Matlab 2015b and dynare 4.5.4.

So first I run the Bayesian estimation of the model using the usual “estimation” command


The estimation part works well.

After that, I simulate the time series using


However I got the following error:

Error using assignin
ASSIGNIN cannot assign to variables with the same name as a
MATLAB keyword

Error in dyn2vec (line 49)
** assignin(‘base’,deblank(M_.endo_names(i,:)),oo_.endo_simul(i,k)’);**

Error in stoch_simul (line 168)
** dyn2vec;**

Error in modelGsw (line 779)
info = stoch_simul(var_list_);

Error in dynare (line 223)
evalin(‘base’,fname) ;

Any clue where the problem can be?



As the message

says, you have a variable that has a name that is not allowed by Matlab. Please provide the names of the endogenous variables

Hi Johannes,

here they are:
lam c pk i ups rk R pip piw w k n l u z muw un s y g4y g4p gy xhp
dY_obs dC_obs dI_obs U_obs dN_obs dW_obs dP_obs R_obs r ra
lamf cf pkf if upsf rkf rf wf kf nf zf yf raf x

I guess variables “i” and/or “if” are the culprit ones

But I do not have any problem if I run stoch_simul(order=1);


The culprit should be if. The reason the problem appears is that you used the periods option.