Deal with the warning of Log zero

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Deal with the warning of Log zero

Postby wudihappy » Tue Feb 19, 2013 2:57 am

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
wudihappy
 
Posts: 1
Joined: Tue Feb 19, 2013 2:50 am

Re: Deal with the warning of Log zero

Postby jpfeifer » Wed Feb 20, 2013 3:39 pm

What exactly is your problem? The code you posted runs fine on my machine.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests