# Two country model with labour adjustment costs

Hi, I’m trying to run a simple two country NK model with an extension of non-linear labour adjustment costs. This is why I don’t log-linearise the model by hand and use a second order approximation in the simulation. The problem (I think) is that I can’t find the correct analytical steady state. This is not the first time I get stuck at this stage. I was wondering if you had any general advice on how you derive it (my strategy in the zero inflation steady state case is to propose the nominal variable values first (e.g. price levels, nominal ex rate etc. =1 etc.) and then work out the real variables from the optimality conditions of the firm, but I still get non-zero residuals that are not ginormous though non-trivial)

Any specific comments that you think are not related to the steady state are also more than welcome.

The error message that appears is as follows:

Error using print_info (line 74)
Impossible to find the steady state. Either the model doesn’t have a steady state, there are an infinity of
steady states, or the guess values are too far from the solution
print_info(info,options_.noprint, options_);
Error in NL_ERPT_DSGE (line 371)
Error in dynare (line 180)
evalin(‘base’,fname) ;

``````var
//DOMESTIC ECONOMY
Y
Y_H
C
C_H
C_F
W
N
M_F
CPI
PPI_H
ACL
ACL_N
ACL_LN
MC
X
PHI1
PHI2
THETA
PI_CPI
PI_PPI_H
i
A
//FOREIGN ECONOMY
Y_star
Y_F
C_star
C_H_star
C_F_star
W_star
N_star
M_H_star
CPI_star
PPI_F
ACL_star
ACL_N_star
ACL_LN_star
MC_star
X_star
PHI1_star
PHI2_star
THETA_star
PI_CPI_star
PI_PPI_F
i_star
A_star
//COMMON
S
Q;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//DESCRIPTION OF ALL ENDOGENOUS VARIABLES
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//-------------------------------------------------------------------------------------------------
//Y               DOMESTIC AGGREGATE INCOME
//Y_H             DOMESTIC PRODUCTION
//C               DOMESTIC AGGREGATE CONSUMPTION
//C_H             DOMESTIC AGGREGATE CONSUMPTION OF DOMESTIC PRODUCE
//C_F             DOMESTIC AGGREGATE CONSUMPTION OF FOREIGN PRODUCE
//W               DOMESTIC NOMINAL WAGE
//N               DOMESTIC LABOUR DEMAND
//M_F             DOMESTIC DEMAND FOR IMPORTED INPUTS
//CPI             DOMESTIC CONSUMER PRICE INDEX
//PPI_H           DOMESTIC PRODUCER PRICE INDEX
//ACL             DOMESTIC ADJUSTMENT COSTS OF LABOUR
//ACL_N           DOMESTIC MARGINAL ADJUSTMENT COSTS OF LABOUR (CONTEMPORANEOUS)
//ACL_LN          DOMESTIC MARGINAL ADJUSTMENT COSTS OF LABOUR (LAGGED)
//MC              DOMESTIC REAL MARGINAL COSTS
//X               DOMESTIC RESET PRICE
//PHI1            DOMESTIC AUXILIARY VARIABLE 1
//PHI2            DOMESTIC AUXILIARY VARIABLE 2
//THETA           DOMESTIC PRICE DISPERSION
//PI_CPI          DOMESTIC CPI INFLATION
//PI_PPI_H        DOMESTIC PPI INFLATION
//i               DOMESTIC NOMINAL INTEREST RATE
//A               DOMESTIC TECHNOLOGICAL PROGRESS
//
//Y_star          FOREIGN AGGREGATE INCOME
//Y_F             FOREIGN PRODUCTION
//C_star          FOREIGN AGGREGATE CONSUMPTION
//C_H_star        FOREIGN AGGREGATE CONSUMPTION OF DOMESTIC GOODS
//C_F_star        FOREIGN AGGREGATE CONSUMPTION OF FOREIGN GOODS
//W_star          FOREIGN NOMINAL WAGE
//N_star          FOREIGN LABOUR DEMAND
//M_H_star        FOREIGN DEMAND FOR IMPORTED INPUTS
//CPI_star        FOREIGN CONSUMER PRICE INDEX
//PPI_F           FOREIGN PRODUCER PRICE INDEX
//ACL_star        FOREIGN ADJUSTMENT COSTS OF LABOUR
//ACL_N_star      FOREIGN MARGINAL ADJUSTMENT COSTS OF LABOUR (CONTEMPORANEOUS)
//ACL_LN_star     FOREIGN MARGINAL ADJUSTMENT COSTS OF LABOUR (LAGGED)
//MC_star         FOREIGN REAL MARGINAL COSTS
//X_star          FOREIGN RESET PRICE
//PHI1_star       FOREIGN AUXILIARY VARIABLE 1
//PHI2_star       FOREIGN AUXILIARY VARIABLE 2
//THETA_star      FOREIGN PRICE DISPERSION
//PI_CPI_star     FOREIGN CPI INFLATION
//PI_PPI_F        FOREIGN PPI INFLATION
//i_star          FOREIGN NOMINAL INTEREST RATE
//A_star          FOREIGN TECHNOLOGICAL PROGRESS
//
//S               NOMINAL EXCHANGE RATE (DOMESTIC PRICE OF FOREIGN CURRENCY)
//Q               REAL EXCHANGE RATE
//
//-------------------------------------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------
//                        DECLARATION OF EXOGENOUS VARIABLES
//-------------------------------------------------------------------------------------------------
varexo
upsilon_A
upsilon_A_star;
//-------------------------------------------------------------------------------------------------
//                        DECLARATION OF PARAMETERS
//-------------------------------------------------------------------------------------------------
parameters
beta
varphi
alpha
eta
varepsilon
gamma
delta
zeta
lambda
kappa
rho
A_A_star_corr
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//COMMENT IN/OUT THE RELEVANT MONETARY POLICY PARAMETER
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
phi_PPI;
//phi_CPI;
//phi_S;
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//DESCRIPTION OF ALL PARAMETERS
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//-------------------------------------------------------------------------------------------------
//beta              DISCOUNT FACTOR
//varphi            INVERSE FRISHIAN ELASTICITY OF LABOUR
//alpha             DEGREE OF OPENNESS TO TRADE IN GOODS AND SERVICES
//eta               ELASTICITY OF SUBSTITUTION BETWEEN DOMESTIC AND FOREIGN GOODS
//varepsilon        ELASTICITY OF SUBSTITUTION BETWEEN DIFFERENT VARIETIES
//gamma             PRODUCTION ELASTICITY OF LABOUR
//delta             SIZE OF ADJUSTMENT COSTS OF LABOUR
//zeta              DEGREE OF ASYMMETRY OF ADJUSTMENT COST OF LABOUR
//lambda            INDEX OF PRICE STICKINESS
//kappa             WELFARE WEIGHT OF OUTPUT RELATIVE TO INFLATION
//rho               WEIGHT OF POLICY RATE PERSISTENCE RELATIVE TO INFLATION
//A_A_star_corr     CORRELATION OF DOMESTIC AND FOREIGN TECHNOLOGY SHOCKS
//phi_PPI           COEFFICIENT ON PPI INFLATION IN DIT
//phi_CPI           COEFFICIENT ON CPI INFLATION IN CIT
//phi_S             COEFFICIENT ON NOMINAL EXCHANGE RATE IN ERT
//-------------------------------------------------------------------------------------------------
//
//-------------------------------------------------------------------------------------------------
//                          CALIBRATION OF PARAMETERS
//-------------------------------------------------------------------------------------------------
//
//SIMPLE PARAMETERS
//
beta=0.99;
varphi=3;
alpha=0.4;
eta=6;
varepsilon=6;
gamma=0.5;
chi=0.5;
delta=1;
zeta=0.3;
lambda=0.75;
kappa=1;
rho=0.75;
//
//PARAMETERS OF THE SHOCKS
//
A_A_star_corr=0.3;
//
//MONETARY POLICY RULE SPECIFIC PARAMETERS
//
phi_PPI=15;
//phi_CPI=10;
//phi_S=10;
//
//-------------------------------------------------------------------------------------------------
//                       NON-LINEAR ERPT DSGE MODEL EQUATIONS
//-------------------------------------------------------------------------------------------------
model;
//
//DOMESTIC ECONOMY
//
Y=((PPI_H/CPI)^(-eta))*C*(1+alpha*(((Q/(S^eta)*(Q^eta)))-1));
Y=Y_H/THETA;
Y_H=A*(M_F^gamma)*(N^(1-gamma));
//
log(C)=log(CPI(+1))+log(C(+1))-(log(beta)+log(CPI)+i);
C_H=(1-alpha)*((PPI_H/CPI)^(-eta))*C;
C_F=alpha*((PPI_F/CPI)^(-eta))*C;
W=CPI*C*N^varphi;
//
ACL=((W*delta)/(CPI*(1+zeta)))*((((N/N(-1))^zeta)-1)*N-zeta*(N-N(-1)));
ACL_N=delta*zeta*(W/CPI)*(((N/N(-1))^zeta)-1);
ACL_LN=((delta*(zeta^2))/(1+zeta))*(W/CPI)*(1-((N/N(-1))^(1+zeta)));
N=((gamma/(1-gamma))*(PPI_F/CPI)*M_F)/((W/CPI)+ACL_N+ACL_LN(+1));
MC=(1/(1-gamma))*(W*N/CPI*Y)*(1+ACL_N*(CPI/W));
//
X=PPI_H*(PHI1/PHI2);
PHI1=(Y/C)+lambda*beta*((PI_PPI_H(+1)^(varepsilon-1))*PHI1(+1));
PHI2=(varepsilon/(varepsilon-1))*(Y/C)*MC+lambda*beta*((PI_PPI_H(+1)^varepsilon)*PHI2(+1));
THETA=lambda*(PI_PPI_H^varepsilon)*THETA(-1)+(1-lambda)*(X/PPI_H)^(-varepsilon);
//
CPI=((1-alpha)*PPI_H^(1-eta)+alpha*PPI_F^(1-eta))^(1/(1-eta));
PI_CPI=CPI(+1)/CPI;
PPI_H=((1-lambda)*X^(1-varepsilon)+lambda*PPI_H(-1)^(1-varepsilon))^(1/(1-varepsilon));
PI_PPI_H=PPI_H(+1)/PPI_H;
//
//FOREIGN ECONOMY
//
Y_star=((PPI_F/CPI_star)^(-eta))*C*(1+alpha*((((S^eta)*(Q^eta))/Q)-1));
Y_star=Y_F/THETA_star;
Y_F=A_star*(M_H_star^gamma)*(N_star^(1-gamma));
//
log(C_star)=log(CPI_star(+1))+log(C_star(+1))-(log(beta)+log(CPI_star)+i_star);
C_H_star=alpha*((PPI_H/CPI_star)^(-eta))*C_star;
C_F_star=(1-alpha)*((PPI_F/CPI_star)^(-eta))*C_star;
W_star=CPI_star*C_star*N_star^varphi;
//
ACL_star=((W_star*delta)/(CPI_star*(1+zeta)))*((((N_star/N_star(-1))^zeta)-1)*N_star-zeta*(N_star-N_star(-1)));
ACL_N_star=delta*zeta*(W_star/CPI_star)*(((N_star/N_star(-1))^zeta)-1);
ACL_LN_star=((delta*(zeta^2))/(1+zeta))*(W_star/CPI_star)*(1-((N_star/N_star(-1))^(1+zeta)));
N_star=((gamma/(1-gamma))*(PPI_H/CPI_star)*M_H_star)/((W_star/CPI_star)+ACL_N_star+ACL_LN_star(+1));
MC_star=(1/(1-gamma))*(W_star*N_star/CPI_star*Y_star)*(1+delta*zeta*(((N_star/N_star(-1))^zeta)-1));
//
X_star=PPI_F*(PHI1_star/PHI2_star);
PHI1_star=(Y_star/C_star)+lambda*beta*(PI_PPI_F(+1)^(varepsilon-1))*PHI1_star(+1);
PHI2_star=(varepsilon/(varepsilon-1))*(Y_star/C_star)*MC_star+lambda*beta*((PI_PPI_F(+1)^varepsilon)*PHI2_star(+1));
THETA_star=lambda*PI_PPI_F^varepsilon*THETA_star(-1)+(1-lambda)*(X_star/PPI_F)^(-varepsilon);
//
CPI_star=((1-alpha)*PPI_F^(1-eta)+alpha*PPI_H^(1-eta))^(1/(1-eta));
PI_CPI_star=CPI_star(+1)/CPI_star;
PPI_F=((1-lambda)*X_star^(1-varepsilon)+lambda*PPI_F(-1)^(1-varepsilon))^(1/(1-varepsilon));
PI_PPI_F=PPI_F(+1)/PPI_F;
//
//MONETARY POLICY
//
i=rho*i(-1)+((1-rho)*phi_PPI)*log(PI_PPI_H);
//i=rho*i(-1)+((1-rho)*phi_CPI)*log(PI_CPI);
//i=rho*i(-1)+((1-rho)*phi_S)*log(S);
i_star=rho*i_star(-1)+((1-rho)*phi_PPI)*log(PI_PPI_H);
//i_star=rho*i_star(-1)+((1-rho)*phi_CPI)*log(PI_CPI);
//i_star=rho*i_star(-1)+((1-rho)*phi_S)*log(S);
//
//COMMON
//
log(S)=log(S(+1))+i_star-i;
Q=(S*CPI_star)/CPI;
//
//SHOCKS
//
log(A)=log(A(-1))+upsilon_A;
log(A_star)=log(A_star(-1))+upsilon_A_star;
//
end;
//-------------------------------------------------------------------------------------------------
//                          INITIAL VALUE DECLARATION
//-------------------------------------------------------------------------------------------------
initval;
//
//
//DOMESTIC ECONOMY
Y=Y_H;
Y_H=C;
C=((gamma/(1-gamma))*alpha^((1+varphi*gamma)/(1-gamma)))^(1/(1+varphi));
C_H=(1-alpha)*C;
C_F=alpha*C;
W=(gamma/(1-gamma))*alpha^(1/(1-gamma));
N=((gamma/(1-gamma))*alpha)^(1/(1+varphi));
M_F=alpha*C;
CPI=1;
PPI_H=1;
ACL=0;
ACL_N=0;
ACL_LN=0;
MC=((varepsilon-1)/varepsilon);
X=1;
PHI1=1/(1-lambda*beta);
PHI2=(1/(1-lambda*beta))*MC*(varepsilon/(varepsilon-1));
THETA=1;
PI_CPI=1;
PI_PPI_H=1;
i=log(1/beta);
A=1;
//FOREIGN ECONOMY
Y_star=Y_F;
Y_F=C_star;
C_star=((gamma/(1-gamma))*alpha^((1+varphi*gamma)/(1-gamma)))^(1/(1+varphi));
C_H_star=alpha*C_star;
C_F_star=(1-alpha)*C_star;
W_star=(gamma/(1-gamma))*alpha^(1/(1-gamma));
N_star=((gamma/(1-gamma))*alpha)^(1/(1+varphi));
M_H_star=alpha*C;
CPI_star=1;
PPI_F=1;
ACL_star=0;
ACL_N_star=0;
ACL_LN_star=0;
MC_star=((varepsilon-1)/varepsilon);
X_star=1;
PHI1_star=1/(1-lambda*beta);
PHI2_star=(1/(1-lambda*beta))*MC*(varepsilon/(varepsilon-1));
THETA_star=1;
PI_CPI_star=1;
PI_PPI_F=1;
i_star=log(1/beta);
A_star=1;
//COMMON
S=1;
Q=1;
end;
//-------------------------------------------------------------------------------------------------
//                          SPECIFICATION OF SHOCKS
//-------------------------------------------------------------------------------------------------
shocks;
var upsilon_A; stderr 1;
//var upsilon_A_star; stderr 1;
end;
check;
//
stoch_simul(order=2,irf=16)
Y
C
C_H
C_F
W
N
ACL
ACL_N
ACL_LN
//
CPI
PPI_H
PI_CPI
PI_PPI_H
MC
THETA
i
S
Q
//
Y_star
C_star
C_H_star
C_F_star
W_star
N_star
ACL_star
ACL_N_star
ACL_LN_star
//
CPI_star
PPI_F
PI_CPI_star
PI_PPI_F
MC_star
THETA_star
i_star;``````