Problems: Input to EIG must not contain NaN or Inf

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.

Problems: Input to EIG must not contain NaN or Inf

Postby blueice » Sat Dec 12, 2015 1:29 pm

Using dynare4.4.3 for slove two-country DSGE problems, I have already got the steady value, and I also doing the linear, but both two solutions(1.got the steady value then input the model;2.linear the model)have the same error! What does these mean? and how to solve? Thanks very much!!

Warning: Matrix is singular to working precision.
> In stochastic_solvers at 188
In resol at 137
In stoch_simul at 88
In liukun1212 at 376
In dynare at 180
Warning: Matrix is singular to working precision.
> In stochastic_solvers at 190
In resol at 137
In stoch_simul at 88
In liukun1212 at 376
In dynare at 180
Error using eig
Input to EIG must not contain NaN or Inf.
Error in stochastic_solvers (line 192)
dr.eigval = eig(transition_matrix(dr));
Error in resol (line 137)
[dr,info] = stochastic_solvers(dr,check_flag,M,options,oo);
Error in stoch_simul (line 88)
[oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
Error in liukun1212 (line 376)
info = stoch_simul(var_list_);
Error in dynare (line 180)
evalin('base',fname) ;

and the mod below:

var ch yh ih kh wh lh dh qh chh chf ihh ihf shh shf cah nfah vah zh cf yf if kf wf lf df qf cff cfh iff ifh sff sfh caf nfaf vaf zf ;
varexo epszh epszf;
parameters sigma kappa alpha delta phi beta omega rhoh rhof etaa etab etac etad muc muy mui muk muw mul mud muq much mucf muih muif mush musf ;

sigma = 2.00; //elasticity of substitution (consumption)
kappa = 0.34; //captial weight
alpha = 0.85; //home bias
delta = 0.06; //depreciation rate
phi = 2.00; //elasticity of substitution between home and foreign
beta = 0.96; //discount factor
omega = 0.50; //elasticity of labor supply w.r.t. real wage
rhoh = 0.50; //persistence of home
rhof = 0.30; //persistence of foreign

etaa = 1-beta+delta*beta-delta*kappa*beta;
etab = 1-beta+delta*beta;
etac = sigma+omega-kappa*sigma-kappa*omega;
etad = (1-kappa)^(1/(sigma+omega)); //temporary variable

//steady
muc=(etaa^(omega/(sigma+omega)))*((kappa*beta)^((kappa+omega*kappa)/etac))*etad/(etab^((omega+kappa)/etac));
muy=(etaa^(-sigma/(sigma+omega)))*((kappa*beta)^((kappa+omega*kappa)/etac))*etad/(etab^((kappa-sigma+kappa*sigma+kappa*omega)/etac));
mui=delta*(etaa^(-sigma/(sigma+omega)))*((kappa*beta)^((kappa+sigma+omega-kappa*sigma)/etac))*etad/(etab^((kappa+omega)/etac));
muk=(etaa^(-sigma/(sigma+omega)))*((kappa*beta)^((kappa+sigma+omega-kappa*sigma)/etac))*etad/(etab^((kappa+omega)/etac));
muw=(1-kappa)*((kappa*beta)/etab)^(kappa/(1-kappa));
mul=(etaa^(-sigma/(sigma+omega)))*((kappa*beta)^(kappa*(1-sigma)/etac))*etad/(etab^((kappa-sigma)/etac));
mud=(1-beta)*(etaa^(-sigma/(sigma+omega)))*((kappa*beta)^((kappa+sigma+omega-kappa*sigma)/etac))*etad/(beta*(etab^((kappa+omega)/etac)));
muq=(etaa^(-sigma/(sigma+omega)))*((kappa*beta)^((kappa+sigma+omega-kappa*sigma)/etac))*etad/(etab^((kappa+omega)/etac));
much=alpha*(etaa^(omega/(sigma+omega)))*((kappa*beta)^((kappa+omega*kappa)/etac))*etad/(etab^((omega+kappa)/etac));
mucf=(1-alpha)*(etaa^(omega/(sigma+omega)))*((kappa*beta)^((kappa+omega*kappa)/etac))*etad/(etab^((omega+kappa)/etac));
muih=alpha*delta*(etaa^(-sigma/(sigma+omega)))*((kappa*beta)^((kappa+sigma+omega-kappa*sigma)/etac))*etad/(etab^((kappa+omega)/etac));
muif=(1-alpha)*delta*(etaa^(-sigma/(sigma+omega)))*((kappa*beta)^((kappa+sigma+omega-kappa*sigma)/etac))*etad/(etab^((kappa+omega)/etac));
mush=0.5+0.5*((1-kappa)*(2*alpha-1))/(1-kappa*(2*alpha-1));
musf=0.5-0.5*((1-kappa)*(2*alpha-1))/(1-kappa*(2*alpha-1));


model(linear);

//consumption CES home
ch(-1) = alpha*chh(-1)+(1-alpha)*chf(-1); // 1

//consumption CES foreign
cf(-1) = alpha*cff(-1)+(1-alpha)*cfh(-1); // 2

//production function home
yh(-1) = kappa*kh(-1)+(1-kappa)*lh(-1)+zh(-1); // 3

//production function foreign
yf(-1) = kappa*kf(-1)+(1-kappa)*lf(-1)+zf(-1); // 4

//dynamic capital home
kh = (1-delta)*kh(-1)+delta*ih(-1); // 5

//dynamic capital foreign
kf = (1-delta)*kf(-1)+delta*if(-1); // 6

//investment index home
ih(-1) = alpha*ihh(-1)+(1-alpha)*ihf(-1); // 7

//investment index foreign
if(-1) = alpha*iff(-1)+(1-alpha)*ifh(-1); // 8

//wage and output home
wh(-1)+lh(-1) = yh(-1); // 9

//wage and output foreign
wf(-1)+lf(-1) = yf(-1); // 10

//dividend appartment home
yh(-1) =(mud*dh(-1)+mui*ih(-1))/(mud+mui); // 11

//dividend appartment foreign
yf(-1) = (mud*df(-1)+mui*if(-1))/(mud+mui); // 12

//firm optimal home
kh-sigma*ch(-1)+sigma*ch = ((kappa*muy)/(kappa*muy+1-delta))*yh(-1); // 13

//firm optimal foreign
kf-sigma*cf(-1)+sigma*cf = ((kappa*muy)/(kappa*muy+1-delta))*yf(-1); // 14

//budget consumption home
muc*ch(-1)+shh*mush*muq+shf*musf*muq = (wh(-1)+lh(-1))*muw*mul+shh(-1)*mush*muq+(shh(-1)+dh(-1))*mush*mud+shf(-1)*musf*muq+(shf(-1)+df(-1))*musf*mud; //15

//budget consumption foreign
muc*cf(-1)+sff*mush*muq+sfh*musf*muq = (wf(-1)+lf(-1))*muw*mul+sff(-1)*mush*muq+(sff(-1)+df(-1))*mush*mud+sfh(-1)*musf*muq+(sfh(-1)+dh(-1))*musf*mud; //16

//euler of consumption home
sigma*ch-sigma*ch(-1) = (muq*qh+mud*dh)/(muq+mud); //17

//euler of consumption foreign
sigma*cf-sigma*cf(-1) = (muq*qf+mud*df)/(muq+mud); //18

//euler of equity share home/foreign
sigma*(ch(-1)-cf(-1))=sigma*(ch-cf); //19

//euler labor home
wh(-1)-omega*lh(-1) = sigma*ch(-1); //20

//euler labor foreign
wf(-1)-omega*lf(-1) = sigma*cf(-1); //21

//market clean production home
much*chh(-1)+mucf*cfh(-1)+muih*ihh(-1)+muif*ifh(-1) = muy*yh(-1); //22

//market clean production foreign
much*cff(-1)+mucf*chf(-1)+muih*iff(-1)+muif*ihf(-1) = muy*yf(-1); //23

//market clean equity
mush*shh(-1)+musf*sfh(-1) = mush*sff(-1)+musf*shf(-1); //24

//NFA expression home
nfah(-1)=(musf*muq/muy)*(shf(-1)+qf(-1))-(musf*muq/muy)*(sfh(-1)+qh(-1)); //25

//NFA expression foreign
nfaf(-1) = -nfah(-1); //26

//CA expression home
cah(-1) = nfah-nfah(-1)-vah(-1); //27

//CA expression foreign
caf(-1) = cah(-1); //28

//VA expression home
vah(-1) = (musf*muq/muy)*(qf(-1)-qf)-(musf*muq/muy)*(qh-qh(-1)); //29

//VA expression foreign
vaf(-1) = -vah(-1); //30

//consumption chh and chf home
chh(-1) = ch(-1); //31

//consumption cff and cfh foreign
cff(-1) = cf(-1); //32

//investment ihh and ihf home
ihh(-1) = ih(-1); //33

//investment ihh and ihf foreign
iff(-1) = if(-1); //34

//technology shock home
zh(-1) = rhoh*zh(-2)+epszh; //35

//technology shock foreign
zf(-1) = rhof*zf(-2)+epszf; //36

end;


shocks;
var epszh; stderr 0.0210;
var epszf; stderr 0.0150;
corr epszh, epszf = 0.25;
end;



steady;
stoch_simul(order=1,irf=20);
blueice
 
Posts: 1
Joined: Fri Dec 11, 2015 2:36 pm

Re: Problems: Input to EIG must not contain NaN or Inf

Postby jpfeifer » Sun Dec 13, 2015 4:54 pm

model_diagnostics says:
MODEL_DIAGNOSTICS: The following endogenous variables aren't present at the current period in the model:
yh
ih
wh
lh
chh
chf
ihh
ihf
cah
vah
zh
yf
if
wf
lf
cff
cfh
iff
ifh
caf
nfaf
vaf
zf

In particular your timing for the AR(1) shock processes is wrong.
------------
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: No registered users and 8 guests