Error using assignin


#1

Hi,

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

estimation(nograph,nodisplay,datafile=dataGswMpe,nobs=95,order=1,mh_replic=10000,mh_nblocks=2,mh_jscale=0.30,mh_drop=0.25,plot_priors=0);

The estimation part works well.

After that, I simulate the time series using

stoch_simul(periods=200,simul_replic=5,nograph);

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?

Thanks

Fabio


#2

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


#3

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);

Thanks


#4

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