Page 1 of 1

failure of the rank condition

PostPosted: Thu Mar 03, 2016 3:58 pm
by lilia
Hi,

I am trying to estimate a dsge model with firm entry à la Ghironi and Mélitz. the Blanchard Kahn condition is verified but the rank condition fails. I am sure about timing and have tried with different parameters. what else should I do?

I was thinking of using the Moore-Penrose pseudoinverse (Matlab command: pinv) to bypass the rank failure and obtain the inverse of the square submatrix of Schur vectors. Is this possible and correct?

thanks a lot for any help!

here is the model:

% model in levels


var c, cstar, y, ystar, l, lstar, eps, i, istar, px, pxstar, pd, pdstar, v, vstar, P, Pstar, d, dstar, w, wstar, Pd, Pdstar, Px, Pxstar,
n, nstar, ne, nestar, nfa, q, Z, Zstar, vp, vpstar, g1, g2, g1star, g2star ;

predetermined_variables n, nstar;

varexo zz zzstar;

parameters alfa, alfaf, beta, gamma, delta, eta, rho, teta, psi, csi, niz, nizstar, tau, taui, taup, tauy, chi, fe, festar, fx, fxstar, fmin ;


eta = 0.6; %exchange rate pass-through
gamma = 0.6;
rho = 2; %inter-temporal elasticity
teta = 3.8; %elasticity of substitution for goods
psi = 0.85; %Frisch elasticity
beta = 0.96;
delta = 0.1;
alfa = 0.59;
alfaf = 0.41;
niz = 0.815;
nizstar = 0.815;
taui = 0.3;
taup = 0.8;
tauy = 0;
chi = 8.1; %labor disutility in VV 8.92
csi = 2.8 ;
fe = 1 ;
fx = 1.3 ;
festar = 1 ;
fxstar = 1.3 ;
fmin =1 ;
tau = 0.3 ;

model;

v=fe;
vstar=fe;

c^(-rho)=beta*c(+1)^(-rho)*(i*P/P(+1));
cstar^(-rho)=beta*cstar(+1)^(-rho)*(istar*Pstar/Pstar(+1));

c^(-rho)=beta*(1-delta)*c(+1)^(-rho)*((d(+1)+v(+1)))/v;
cstar^(-rho)=beta*(1-delta)*cstar(+1)^(-rho)*((dstar(+1)+vstar(+1)))/vstar;

chi*l^(1/psi)=w*c^(-rho);
chi*lstar^(1/psi)=wstar*cstar^(-rho);

P=Pd^gamma*Px^(1-gamma);
Pstar=Pdstar^gamma*Pxstar^(1-gamma);

y=gamma*(Pd/Px)^(gamma-1)*(c+ne*fe+0.2*n*fx)+(1-gamma)*(Pdstar/Pxstar)^(gamma)*(cstar+nestar*festar+0.2*nstar*fxstar);
ystar=gamma*(Pdstar/Pxstar)^(gamma-1)*(cstar+nestar*festar+0.2*nstar*fxstar)+(1-gamma)*(Pd/Px)^(gamma)*(c+ne*fe+0.2*n*fx);

l=(y/exp(Z))*vp;
lstar=(ystar/exp(Zstar))*vpstar;

vp=alfa*vp(-1)+(1-alfa)*(Pd(-1)/pd(-1))/(Pd/pd);
vpstar=alfaf*vpstar(-1)+(1-alfaf)*(Pdstar(-1)/pdstar(-1))/(Pdstar/pdstar);

Pd^(1-teta)=alfa*(n/n(-1))*Pd(-1)^(1-teta)+(1-alfa)*n*pd^(1-teta);
Pdstar=alfaf*(nstar/nstar(-1))*Pdstar(-1)^(1-teta)+(1-alfaf)*nstar*pdstar^(1-teta);

Px^(1-teta)=alfa*(0.2*n/0.2*n(-1))*Px(-1)^(1-teta)+(1-alfa)*0.2*n*px^(1-teta);
Pxstar^(1-teta)=alfaf*(0.2*nstar/0.2*nstar(-1))*Pxstar(-1)^(1-teta)+(1-alfaf)*0.2*nstar*pxstar^(1-teta);

%optimal flex price
%pd=(teta/(teta-1))*w*P/exp(Z);
%pdstar=(teta/(teta-1))*wstar*Pstar/exp(Zstar);

% firm's price setting
g1=(c^(rho)/P)*w/exp(Z)*y+beta*alfa*(1-delta)*g1(+1)*(Pd/Pd(-1))^(-teta);
g2=(c^(rho)/P)*pd*y+beta*alfa*(1-delta)*g2(+1)*(Pd/Pd(-1))^(1-teta)*(pd/Pd)/(pd(-1)/Pd(-1));
teta*g1=(teta-1)*g2;

g1star=(cstar^(rho)/Pstar)*wstar/exp(Zstar)*ystar+beta*alfaf*(1-delta)*g1star(+1)*(Pdstar/Pdstar(-1))^(-teta);
g2star=(cstar^(rho)/Pstar)*pdstar*ystar+beta*alfaf*(1-delta)*g2star(+1)*(Pdstar/Pdstar(-1))^(1-teta)*(pdstar/Pdstar)/(pdstar(-1)/Pdstar(-1));
teta*g1star=(teta-1)*g2star;

px=(eps^eta)*(1+tau)*pdstar;
pxstar=(eps^(-eta))*(1+tau)*pd;

q=(c/cstar)^rho;
q=eps*Pstar/P;

n=(1-delta)*(n(-1)+ne(-1));
nstar=(1-delta)*(nstar(-1)+nestar(-1));

nfa=y-c-ne*v;
-nfa=ystar-cstar-nestar*vstar;

eps(+1)=eps*(i(+1)/istar(+1));
i=i(-1)^taui*((P)^taup*y^tauy)^(1-taui);
istar=istar(-1)^taui*((Pstar)^taup*ystar^tauy)^(1-taui);

Z=niz*Z(-1)+zz ;
Zstar=nizstar*Zstar(-1)+zzstar ;


end;

initval;

c = 0.340230256;
cstar = 0.325320421;
y = 0.608807922;
ystar = 0.064640746;
l = 0.608807939;
lstar = 0.064640799;
eps = 1.045832489;
i = 1.041666664;
istar = 1.041666655;
px = 0.302517613;
pxstar = 0.480200307;
pd = 0.352348146;
pdstar = 0.210351285;
v = 1;
vstar = 1;
P = 1.3;
Pstar = 1.23;
d = 0.068376068;
dstar = 0.068376068;
w = 0.259625049;
wstar = 0.154995591;
Pd = 1.323759708;
Pdstar= 0.84037721;
Px = 0.7028038;
Pxstar= 1.389420809;
n = 1.29408165;
nstar = -1.388383153;
ne = 0.033181622;
nestar = -0.035599434;
nfa=0; %nfa = 0.235396022;
q=1; %q = 1.045831204;
g1 =0.013 ;
g2 =0.0172;
g1star =0.013;
g2star=0.0172;
Z = 0;
Zstar = 0;
vp=1;
vpstar=1;

end;

steady(maxit=30, solve_algo =0) ;

check;

shocks;
% for moments
var zz = 0.013;
var zzstar = 0.015;
%var zz,zzstar= 0.0025;


end;

stoch_simul(pruning, hp_filter=1600, irf=0, drop=200, periods=2100) y c ne n ystar cstar nestar nstar ;

Re: failure of the rank condition

PostPosted: Fri Mar 04, 2016 2:49 pm
by jpfeifer
No. Running model_diagnostics returns
MODEL_DIAGNOSTICS: The following endogenous variables aren't present at the current period in the model:
d
dstar
n
nstar

You need to fix this.