list of reserved variable names
Posted:
Thu Dec 30, 2010 11:54 pm
by ian_db
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.
Re: list of reserved variable names
Posted:
Thu Jan 06, 2011 1:42 pm
by MichelJuillard
This should not happen. Can you please send us the example.
Best
Michel
Re: list of reserved variable names
Posted:
Wed Feb 09, 2011 5:21 pm
by ian_db
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: Select all
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=0*sqrt(s2gam*sxgam);
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)*eta*exp((1-eta)*(eps_x-y))*exp((y-l)/rho);
// capital euler equation
1+kappa*ik = exp(-rfb)*(alpha*eta*exp((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(eta*y + (1-eta)*(eps_x)) - w*exp(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);
Re: list of reserved variable names
Posted:
Mon Feb 21, 2011 3:16 pm
by SébastienVillemot
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,