Hello everyone,

I am beginner and after going through all the example of user guide and practicing 2 examples from the book of Gali, I am trying to replicate a paper. I am trying hard to write the code properly but still there is an error in executing the code. Could someone help me by pointing out the mistakes. The link of the paper is bis.org/publ/work372.pdf . mode file is also attached.

Thanks in advance.

Regard,

Tehseen Iqbal

[code] var c i pi mc yf yi wf wi nf ni q gf gi xf xi hf hi y n a d;

varexo e_a e_d;

parameters chi beta epsilon delta gamma tech alpha_f alpha_i beta_f beta_i lamda phi_pi phi_y theta eta rho_a rho_d kappa phi phi_f phi_i mu Wu omega_f omega_i gff gii A sii Y N Wf Wi Yf Yi Xf Xi Gf Gi ;

% Calibration.

beta =0.99; // discount factor

chi =1; // preference parameter

epsilon = 6; // elasticity of substituion

delta = 0.2; // seperation rate

gamma = 0.95; // tech

tech = 1; // tech

alpha_f = 1.5; // elasticity of hiring cost of formal labor w.r.t market tightness

alpha_i = 0.75; // elasticity of hiring cost of informal labor w.r.t market tightness

beta_f = 2.5; //

beta_i = 0.5; //

lamda = 0.5; // bargaining powe of labor

phi_pi = 1.5; // policy parameter related to inflation

phi_y = 0.5; // policy parameter related to output

theta = 2/3; // number of firms who can’t adjust prices

//eta = ? //

mu = epsilon/(epsilon-1);

kappa = (1-theta)*(1-theta*beta)/theta;

phi_f = A/Wf*mu;
A =1;
Phi_i = (gamma*A)/Wi

*mu;*

sii =0.75;

Wu = sii(gamma

sii =0.75;

Wu = sii

*A/mu);*

omega_f = (chic

omega_f = (chi

*N^eta)/Wf;*

omega_i = (chic*N^eta)/Wi;

omega_i = (chi

rho_d = 0.95;

rho_a = 0.95;

// Steady state

Y = Yf+Yi;

N = Nf+Ni;

Wf = A*(1/mu)-Gf*(1-beta*(1-sigma)); // labor demand of formal sector

Wi = gamma*A*(1/mu)-Gi*(1-beta*(1-sigma)); // labor demand of informal sector

Wf = chi*C*N^phi+Wu+lamda*(Gf-beta*(1-sigma)*((1-Xf) Gf-XiGi)); // labor supply of formal sector
Wi = chi*C

*N^phi+Wu+lamda*(Gi-beta*(1-sigma)

*((1-Xi)*

Y = C+sigmaGf+Nf+sigma

*Gi-Xf*Gf)); // labor supply of informal sectorY = C+sigma

*Gi*N-Wu*(1-N); // aggregate budjet condition

Yf = A

*Nf; // production function formal sector*

Yi = gammaA

Yi = gamma

*Ni; // production function informal sector*

Xf = sigmaNf/(1-(1-sigma)

Xf = sigma

*N); // labor tightness of formal sector*

Xi = sigmaNi/(1-(1-sigma)

Xi = sigma

*N); // labor tightness of informal sector*

Gf = betaiA

Gf = betai

*X^alpha_f; // Hiring cost informal sector*

Gi = betafA*X^alpha_i; // Hiring cost formal sector

Gi = betaf

//Linear

Model(linear);

//c = c(+1)-(i-(pi(+1)); // Euler equation

gf = a + alpha_f*xf; // hiring cost
gi = a + alpha_i*xi; // hiring cost

nf = (1-delta)*nf(-1)+delta*hf; // evolution of labor

ni = (1-delta)*ni(-1)+delta*hi; // evolution of labor

xf = hf +((1-delta)*n/1-(1-delta))*n(-1); // labor market tightness

xi = hi +((1-delta)*n/1-(1-delta))*n(-1); // labor market tightness
pi = kappa*mc+pi(+1); // phillips curve.

y = (Yf/Y)*yf+(Yi/Y)*yi;

yf = a + nf;

yi = a+ni;

wf = phi_f*(a+mc)+(Gf-Gf(-1)/Wf)*(gff); // labor demand
wi = phi_i*(a+mc)+(Gi-Gi(-1)/Wi)*(gii); // labor demand

q(+1) = c-c(+1);

wf = omega_f*(c+eta*n)+lamda*(Gf/Wf)*gff+((1-delta) betalamda/Wf)*(Gf

*Xf*(q(+1)+gf(+1)+xf(+1))

*Gi*Xi*(q(+1)+gi(+1)+xi(+1)));

wi = omega_i*(c+eta

*n)+lamda*(Gi/Wi)

*gii+((1-delta)*(Gf

*beta*lamda/Wi)*Xf*(q(+1)+gf(+1)+xi(+1))

*Gi*Xi*(q(+1)+gi(+1)+xi(+1)));

gff = gf-(1-delta)

*beta*(q(+1)+gf(+1));

gii = gi-(1-delta)

*beta*(q(+1)+gi(+1));

//n = (Ni/N)

*ni + (Nf/N)*(Gf-Gf(-1))

*nf;*

mc = (mu/A)((1+lamda)/(1-gamma))mc = (mu/A)

*gff-(Gi-Gi(-1)*y; //monetary policy rule

*gii)-a;*

i = phi_pipi + phi_yi = phi_pi

a = rho_a

*a(-1)+e_a;*

d = rho_dd(-1)+e_d;

d = rho_d

end;

check;

shocks;

var e_a; stderr .005;

var e_d; stderr .005;

end;

//Computation

check;

stoch_simul(irf=30) pi yi yf;

]

rep1.mod (3.76 KB)