List of reserved variable names

I was running into a problem with a model recently and finally figured out that it was because I had a variable named g1, which was causing problems when dynare tried to calculate the jacobian to get the steady state (i.e. in the XX_static.m file for XX.mod). Is there a list of variable names like this that I need to avoid? Obviously I’m not using names like ln, inf, exp, etc., but g1 isn’t really something I could have foreseen.

This should not happen. Can you please send us the example.

Best

Michel

Sorry, forgot all about this. can’t recall the exact code. I’m pretty sure that the problem appeared when using a # variable. I just ran into the same problem when I defined a #y term. It didn’t like that, but when I renamed it #yz everything was fine.

Here’s some code that generates the problem for y. If you replace #y with #g you get a similar error. [code]var pi,k,ik,l;
varexo eps_x;

parameters rfb,z,s2x,s2gam,sxgam,phi_gam,phi_g,dep,alpha,rho,w,kappa,s2g,s2i,eta;

rfb=.01;
z=0;
s2x=.01;
s2gam=0;
sxgam=0sqrt(s2gamsxgam);
phi_gam=0;
phi_g=0.9;
s2g=0.0;
s2i=0.0;
dep=.025;
alpha=.95;
rho=0.5;
w=1;
kappa=0;
eta=.5;

model;

// demand growth

// capital update
exp(k-k(-1) + eps_x) = (1-dep) + ik;

// Output

y = log((alpha*exp(((rho-1)/rho)*k(-1)) + (1-alpha)*exp(((rho-1)/rho)*l))^(rho/(rho-1)));

y1 = log((alpha*exp(((rho-1)/rho)*k) + (1-alpha)*exp(((rho-1)/rho)*l(+1)))^(rho/(rho-1)));

// labor demand
w = (1-alpha)etaexp((1-eta)*(eps_x-y))*exp((y-l)/rho);

// capital euler equation
1+kappaik = exp(-rfb)(alphaetaexp((1-eta)(eps_x-y1))exp((y1-k)/rho)
+(kappa/2)
(ik(+1)^2)
+(1-dep)
(1+kappa*ik(+1)));

// profit function
exp(pi) = exp(etay + (1-eta)(eps_x)) - wexp(l)-exp(k(-1))(ik+kappa*(ik^2)/2);

end;

shocks;
var eps_x; stderr s2x;

end;

initval;
k=3.8;
ik=dep;
l=-.8;
pi=-.7-ik*exp(k);

end;

steady;
check;

stoch_simul(periods=1000,order=1,ar=0,IRF=0,simul_seed=1);
[/code]

You’re right, there is a name conflict when a model local variable (i.e. a variable declared with a #) is called g1, or g2.

This problem will be fixed in the next release of Dynare.

Best,