Why I get Warning: Log of 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.

Why I get Warning: Log of zero?

Postby ahnulxy » Fri Feb 21, 2014 7:49 pm

Everything seems ok, but I do not know why I get the warning. I run the model file in v4.4.1. But when I run this in v4.2.0, I get no warning. What is wrong?

Warning: Log of zero.
> In log10 at 20
In dyntable at 36
In disp_th_moments at 65
In stoch_simul at 150
In in_class_dynare at 208
In dynare at 174
---------------------------------------------
Code: Select all
var y i r n w k a R c;
varexo e;
parameters alpha beta delta rho sigma psi eta sigmae;
parameters yss iss rss nss wss kss Rss css;
alpha =1/3;
beta = .99;
delta = .02;
rho = .97; //rho = .5;.999;
sigma = 1; //sigma = .5; 3;
psi =3;
eta = 1; //eta = 0.0; 3;
sigmae = .01;

rss = 1/beta - 1;
Rss= 1/beta - 1 + delta;
kn = (alpha/Rss)^(1/(1-alpha));
wss = (1-alpha)*kn^alpha;
nss = ((kn^alpha - delta*kn)*(psi/wss)^(1/sigma))^(-1/(1+eta/sigma));
kss = kn*nss;
yss = kn^alpha*nss;
iss=  delta*kss;
css = yss - iss;

model;
% (1) Euler equation, capital
exp(c)^(-sigma)=beta*exp(c(+1))^(-sigma)*((R(+1))+(1-delta));

% (2) Euler equation, bonds
exp(c)^(-sigma)=beta*(1+r)*exp(c(+1))^(-sigma);

% (3) Labor supply
psi*exp(n)^(eta)=exp(c)^(-sigma)*exp(w);

% (4) Production func
exp(y)=exp(a)*exp(k(-1))^(alpha)*exp(n)^(1-alpha);

% (5) Capital demand
R=alpha*exp(a)*exp(k(-1))^(alpha-1)*exp(n)^(1-alpha);

% (6) Labor demand
exp(w)=(1-alpha)*exp(a)*exp(k(-1))^(alpha)*exp(n)^(-alpha);

% (7) Resource constraint
exp(y)=exp(c)+exp(i);

% (8) Capital accumulation
exp(k)=exp(i)+(1-delta)*exp(k(-1));

% (9) Productivity shock
a=rho*a(-1)+e;
end;
initval;
k=log(kss);
y=log(yss);
c=log(css);
i=log(iss);
a=0;
r=rss;
R=Rss;
w=log(wss);
n=log(nss);
end;

shocks;
var e = sigmae^2;
end;
resid(1);
steady;
check;
stoch_simul(order =1, hp_filter =1600);
ahnulxy
 
Posts: 43
Joined: Thu May 10, 2012 7:24 am

Re: Why I get Warning: Log of zero?

Postby jpfeifer » Sun Feb 23, 2014 4:35 pm

There is nothing wrong. I guess you are using Octave. The message comes from Dynare command that tries to find the optimal column length for printing tables. One of your values has a mean of 0 and thus zero digits. You can simply ignore this message. It is only about displaying, not computation.
------------
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

Re: Why I get Warning: Log of zero?

Postby ahnulxy » Sat Mar 01, 2014 9:15 pm

jpfeifer wrote:There is nothing wrong. I guess you are using Octave. The message comes from Dynare command that tries to find the optimal column length for printing tables. One of your values has a mean of 0 and thus zero digits. You can simply ignore this message. It is only about displaying, not computation.


Thanks for the reply! But Actually I am using Matlab instead of Octave.
By the way, after I have Dynare v4.4.1 in Matlab, whenever I start up the Matlab, I get the following warnings. I am guessing it has something to do with v4.4.1. It is kind of irritating, could you please help, thanks.

Code: Select all
Warning: Name is nonexistent or not a directory: \Users\tzha\ZhaData\Git\TZcode\MatlabFiles.
> In path at 110
  In startup at 32
  In matlabrc at 272
Warning: Name is nonexistent or not a directory: \Users\tzha\ZhaData\Git\TZcode\MatlabFiles\MSV.
> In path at 110
  In startup at 33
  In matlabrc at 272

>>
ahnulxy
 
Posts: 43
Joined: Thu May 10, 2012 7:24 am

Re: Why I get Warning: Log of zero?

Postby ahnulxy » Sat Mar 01, 2014 9:19 pm

ahnulxy wrote:
jpfeifer wrote:There is nothing wrong. I guess you are using Octave. The message comes from Dynare command that tries to find the optimal column length for printing tables. One of your values has a mean of 0 and thus zero digits. You can simply ignore this message. It is only about displaying, not computation.


Thanks for the reply! But Actually I am using Matlab instead of Octave.
By the way, after I have Dynare v4.4.1 in Matlab, whenever I start up the Matlab, I get the following warnings. I am guessing it has something to do with v4.4.1. It is kind of irritating, could you please help, thanks.

Code: Select all
Warning: Name is nonexistent or not a directory: \Users\tzha\ZhaData\Git\TZcode\MatlabFiles.
> In path at 110
  In startup at 32
  In matlabrc at 272
Warning: Name is nonexistent or not a directory: \Users\tzha\ZhaData\Git\TZcode\MatlabFiles\MSV.
> In path at 110
  In startup at 33
  In matlabrc at 272

>>

I get the problem solved by searching the forum,thanks!
ahnulxy
 
Posts: 43
Joined: Thu May 10, 2012 7:24 am


Return to Dynare help

Who is online

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