MODEL_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one redundant equation entered

Hello everyone,there are something wrong when I was running my mod.

MODEL_DIAGNOSTICS:  The Jacobian of the static model is singular
MODEL_DIAGNOSTICS:  there is 2 collinear relationships between the variables and the equations
Relation 1
Collinear variables:
c
M
Ex
h
w
mu
B
q
yh
I
k
F
FDI
rf
y
yz
x1
x2
Nb
D
L
Relation 2
Collinear variables:
M
Ex
h
w
B
q
yh
I
k
F
FDI
rf
y
yz
x1
x2
Nb
D
L
Relation 1
Collinear equations
    29    30    31    32    33

Relation 2
Collinear equations
    29    30    31    32    33

MODEL_DIAGNOSTICS:  The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS:  redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS:  is missing. The problem often derives from Walras Law.
警告: 矩阵接近奇异值,或者缩放错误。结果可能不准确。RCOND =  1.787801e-21。
var c M Ex lam h w pih pif pi mu v x mun mub Rstar R B S q yh I k F FDI Rk rf mc y ystar yz x1 x2 vp pir Nb D L RL  Omega Phi lev Q A thetaX u ; varexo eA er erstar eystar eu ; parameters beta lams mus sigmh cs ws hs Ds Bs qs Ss vf chi etaf gammc xs vs ys yhs ystars yzs deltaF alphkf Fs rfs rks deltaK kappk kappb rhoM Ms Exs theta zeta epsip mcs ks Is FDIs omegaB levs etaB thetaB Qs Rs Rstars RLs Rks Ls Nbs Phis Omegas thetaXs muns mubs rhoA rhor rhoy rhorstar rhoS rhou phipi phiy sA sr srstar sy su ;  load 'param_sw.mat'; set_param_value('beta',beta); set_param_value('lams',lams); set_param_value('mus',mus); set_param_value('sigmh',sigmh); set_param_value('cs',cs); set_param_value('chi',chi); set_param_value('rhoM',rhoM); set_param_value('gammc',gammc); set_param_value('ws',ws); set_param_value('hs',hs); set_param_value('Bs',Bs); set_param_value('qs',qs); set_param_value('Ss',Ss); set_param_value('vf',vf); set_param_value('vs',vs); set_param_value('ys',ys); set_param_value('yhs',yhs); set_param_value('yzs',yzs); set_param_value('Ms',Ms); set_param_value('Exs',Exs); set_param_value('ystars',ystars); set_param_value('deltaF',deltaF); set_param_value('alphkf',alphkf); set_param_value('Fs',Fs); set_param_value('xs',xs); set_param_value('deltaK',deltaK); set_param_value('kappk',kappk); set_param_value('theta',theta); set_param_value('zeta',zeta); set_param_value('epsip',epsip); set_param_value('etaf',etaf); set_param_value('mcs',mcs); set_param_value('ks',ks); set_param_value('Ds',Ds); set_param_value('Is',Is); set_param_value('FDIs',FDIs); set_param_value('omegaB',omegaB); set_param_value('levs',levs); set_param_value('etaB',etaB); set_param_value('thetaB',thetaB); set_param_value('thetaXs',thetaXs); set_param_value('Qs',Qs); set_param_value('Rs',Rs); set_param_value('Rstars',Rstars); set_param_value('RLs',RLs); set_param_value('Rks',Rks); set_param_value('rks',rks); set_param_value('rfs',rfs); set_param_value('Ls',Ls); set_param_value('Nbs',Nbs); set_param_value('Phis',Phis); set_param_value('Omegas',Omegas); set_param_value('muns',muns); set_param_value('mubs',mubs); set_param_value('kappb',kappb); set_param_value('rhoA',rhoA); set_param_value('rhoM',rhoM); set_param_value('rhoy',rhoy); set_param_value('rhor',rhor); set_param_value('rhorstar',rhorstar); set_param_value('rhoS',rhoS); set_param_value('rhou',rhou); set_param_value('phipi',phipi); set_param_value('phiy',phiy); set_param_value('sA',sA); set_param_value('sr',sr); set_param_value('srstar',srstar); set_param_value('sy',sy); set_param_value('su',su);   model; 1/c=chi*(h^sigmh)/w; mu=1/c; lam=beta*mu/mu(-1); R*lam(+1)/pi(+1)=1; q/q(-1)=S/S(-1)*pif/pih; k=(1-deltaK)*k(-1)+I-kappk/2*(I/k(-1)-deltaK)^2*k(-1); F=(1-deltaF)*F(-1)+FDI-0.5*vf*(FDI/F(-1)-deltaF)^2*F(-1); yh=A*(k(-1)^(zeta)*(u*F(-1))^(1-zeta))^(alphkf)*h^(1-alphkf); w=(1-alphkf)*yh/h*mc; rf=alphkf*(1-zeta)*yh/(u*F(-1))*mc; Rk=((1-deltaK)+alphkf*zeta*yh/k(-1)*mc)*Q/Q(-1); RL=Rk; y=yh*vp; pir=(epsip/(epsip-1))*x1/x2; x1=mc*yh+theta*lam(+1)*pih(+1)^(epsip)*x1(+1); x2=yh+theta*lam(+1)*pih(+1)^(epsip-1)*x2(+1); 1=(1-theta)*pir^(1-epsip)+theta*pih^(epsip-1); vp=(1-theta)*pir^(-epsip)+theta*(pih^(epsip))*vp(-1); pi=(q/q(-1))^(gammc)*pih; L=Nb+D+q*B; v=lam(+1)*Omega(+1)*R; mun=lam(+1)*Omega(+1)*(RL(+1)-R/pi(+1)); mub=lam(+1)*Omega(+1)*(R/pi(+1)-Rstar); x=mun/mub*((1+(2/kappb)*(mub/mun)^2)^(1/2)-1); x=q*B/L; Omega=1-omegaB+omegaB*(v+lev*(mun+x*mub)); Nb=omegaB*(RL*L(-1)-R(-1)*D/pi-Rstar(-1)*B(-1)*q)+etaB*L; thetaX=thetaB*(1+(kappb/2*x^2)); thetaX*L=v*Nb+lev*(mun+x*mub)*Nb; lev=v/(thetaX-mun-x*mub); Phi=1-v/(thetaX*lev); lev=L/Nb; v/(1-Phi)=v+lev*(mun+x*mub); Q=1/(1-kappk*(I/k(-1)-deltaK)); Q*k(-1)=L; yz=1/((1-gammc)^(1-gammc)*gammc^gammc)*yh^gammc*M^(1-gammc); yz=c+I+M-Ex+kappk/2*(I/k(-1)-deltaK)^2*k(-1); Ex=(1/q)^(-etaf)*ystar; rf*(u*F(-1))+Rstar*q(-1)*B=q*B(+1)+FDI+Ex-M; log(R)=(1-rhor)*log(Rs)+rhor*log(R(-1))+(1-rhor)*(phipi*log(pi)+phiy*log(y/y(-1)))+sr*er; log(Rstar)=(1-rhorstar)*log(Rstars)+rhorstar*log(Rstar(-1))+srstar*erstar; log(ystar)=(1-rhoy)*log(ystars)+rhoy*log(ystar(-1))-sy*eystar; log(A)=rhoA*log(A(-1))-sA*eA; log(u)=rhou*log(u(-1))-su*eu; S=Ss; end;  steady_state_model; y=ys; yh=yhs; ystar=ystars; vp=1; h=hs; S=Ss; I=Is; lam=lams; c=cs; F=Fs; FDI=FDIs; k=ks; w=ws; pi=1; pih=1; pif=1; pir=1; mc=mcs; mu=mus; mun=muns; mub=mubs; v=vs; x1=mcs*yhs/(1-theta*beta); x2=yhs/(1-theta*beta); Q=Qs; R=Rs; Rstar=Rstars; RL=RLs; Rk=Rks; D=Ds; B=Bs; rf=rfs; lev=levs; Omega=Omegas; M=Ms; Ex=Exs; yz=yzs; Nb=Nbs; thetaX=thetaXs; L=Ls; x=xs; Phi=Phis; A=1; q=qs; u=1; logY=log(ys); logF=log(Fs);  end;  steady; check(qz_zero_threshold=1e-20); model_diagnostics;  shocks; var eA=1; var er=1; var eystar=1; var erstar=1; var eu=1;  end; stoch_simul(qz_zero_threshold=1e-20,order=1,irf=40,nograph);

You did not properly upload the files to run the code.

Sorry,Mr.jpfeifer,Here is my code to run the .mod
SOE.mod (4.8 KB)
SOErun.m (1.6 KB)

Dynare points you four problematic equations related to leverage. Could it be that one of them is redundant because to other three already contain that information?

OK,I will check it,thank you Mr jpfeifer!

SOE.mod (4.8 KB)
SOErun.m (1.6 KB)
Dear Mr Jpfeiter,I checked my four problematic equations related to leverage and then delete one of them,then there is still something wrong in it
MODEL_DIAGNOSTICS: The Jacobian of the static model is singular
MODEL_DIAGNOSTICS: there is 2 collinear relationships between the variables and the equations
Relation 1
Collinear variables:
c
M
Ex
h
w
mu
B
q
yh
I
k
F
FDI
rf
y
yz
x1
x2
Nb
D
L
Relation 2
Collinear variables:
M
Ex
h
w
B
q
yh
I
k
F
FDI
rf
y
yz
x1
x2
Nb
D
L
Relation 1
Collinear equations
3 4 20 21 22 23 24 25 26 27 28 29 30 31 32 39 40

Relation 2
Collinear equations
3 4 20 21 22 23 24 25 26 27 28 29 30 31 32 39 40

MODEL_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS: redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS: is missing. The problem often derives from Walras Law.

  1. The collinearity seems to be caused by a unit root. Is that unit root expected? If yes, you can ignore that warning.
  2. The model shows instability now. That may be a timing or parameter issue.