Page 1 of 1

Deal with the warning of Log zero

PostPosted: Tue Feb 19, 2013 2:57 am
by wudihappy
I set different initial value to solve this problem, but they don't work.

I hope someone can help me, my dynare code is attached below. I appriciate!

*************************************************************************
var mc rw mrs n a r pi c news;
varexo ms lambda epsilon_a epsilon_news;

parameters sigma delta gamma rho_r gamma_y gamma_pi beta kappa_p rho_a rho_news;

sigma=0.4;
delta=0.5;
gamma=1;
rho_r=0.5;
gamma_y=0.125;
gamma_pi=1.5;
beta=0.99;
kappa_p=0.1;
rho_a=0.5;
rho_news=0.5;

model;
c=c(+1)-sigma*(r-pi(+1));
c=a+(1-delta)*n;
mc=rw+n-c;
mrs=c/sigma+gamma*n;
r=rho_r*r(-1)+(1-rho_r)*(gamma_y*c+gamma_pi*pi)+ms;
mrs=rw;
pi=beta*pi(+1)+kappa_p*(mc+lambda);
a=rho_a*a(-1)+news(-1)+epsilon_a;
news=rho_news*news(-1)+epsilon_news;
end;

initval;
mc=0;
rw=0;
mrs=0;
n=0;
a=0;
r=0;
pi=0;
c=0;
news=0;
end;

steady;

shocks;
var ms=0.009^2;
var lambda= 0.009^2;
var epsilon_a=0.009^2;
var epsilon_news=0.009^2;
end;


stoch_simul(periods=2000, drop=200);

*****************************
Warning: Log of zero.
> In log10 at 20
In dyntable at 33
In stoch_simul at 105
In homework2 at 165
In dynare at 120

Re: Deal with the warning of Log zero

PostPosted: Wed Feb 20, 2013 3:39 pm
by jpfeifer
What exactly is your problem? The code you posted runs fine on my machine.