The Jacobian matrix evaluated at the steady state contains elements that are not real or are infinite

Then the steady state won’t be symmetric. You can see that your equations generate exactly the same thing for your home country and the foreign country. Therefore, the steady state will be b = b_star = 0?

How do I solve this problem?

In the original paper, they just said that the two countries are similar (except for the shocks). So, isn’t it logical to assume that in SS, their SS equations will also be similar?

Yes, they should be similar, but what you did incorrectly in the model setting (might not be the only mistake, but this is what I saw) is that at steady state, you want b = leverage * y for both countries, i.e., both of them are borrowing to their capacity. And you also enforce the sum of two positive (or two negative) numbers to 0 by market clearing. That’s just not possible, right?

I would set both of them to 0 at steady state. But then the way you specify the model must be b <= leverage * y which is an occasionally binding constraint. I don’t know how to do that in Dynare (I know there’s a way to do, but I don’t know how), as I usually solve all these things by coding myself…

Also, I don’t see why you need a borrowing limit at all unless you want it to be binding.

If I want the limit to be binding, how should I change my setup?
Because according to the limit, at SS, both will borrow to the max of the limit, but as the other user pointed out, this violates the net supply bond equation.

If I want the limit to be binding, how should I change my setup?

This is something you need to ask yourself, I think, because it depends on what you exactly want.
If the international bond market has zero net supply, then it has to be one country borrowing and the other not. Therefore at least one of the countries won’t have a binding borrowing constraint at the steady state.

One potential problem with this whole setup is the nonstationary steady state.

I need to implement one of the “closing large open economy” trick to make sure that the ss is stationary (something like endogenous beta or debt elastic rate).

The non-stationarity issues just means there are infinitely many steady states of which you can pick one. But in your current setup no steady state exists at all.

Yes.

The problem comes from the binding debt constraint. I don’t think Dynare can solve this problem.

The problem comes from the binding debt constraint. I don’t think Dynare can solve this problem.

Indeed, it’s the issue of your setting, instead of Dynare. Dynare is not perfect, but your problem here cannot be solved by adding a feature to Dynare.

[mcp = ‘r > -1.94478’]

This means max (r, -1.94478), right?

So, if I have a debt limit in my model, meaning debt must never be smaller than -1.71336, my equation can be written as max (b, -1.71336)?

And in Dynare, I can write [mcp = ‘b > -1.94478’] before the bond accumulation equation right?

It means that whenever

r > -1.94478

then the equation belonging to the tag is used. Otherwise, use

r = -1.94478

Thanks!

I have a question about using this; if on paper I have a debt limit requirement, and this debt limit requirement enters the first order conditions, but on Dynare I am using this tag, do I still need to include the multiplier of that debt condition in the first order condition?

Thanks

Usually, the multiplier does not show up as it is 0 when the tag is not satisfied.

I see this problem in solving my DSGE model.

Error using print_info (line 32)
The Jacobian matrix evaluated at the steady state contains elements that
are not real or are infinite.

var  Y L W C I X RN eps_b A MC Q PI PIW RK Lambda P K m; 
varexo  u_a u_b u_x;


parameters        alphha  betta thetta thettaw rhoa rhob rhox deltta sigmac sigmal sigmam h k_a psi k_m  psiw;
sigmac=0.46;      %Relative risk aversion rate
sigmal=1.46;      %Inverse elasticity of labour supply
sigmam=2.39;      %Inverse elasticity of money demand
h=0.7;            %Habit persistance
alphha=0.53;      %Capital share in production
deltta=0.022;     %Depreciation rate in economy
betta=0.98;       %Discount factor
rhoa=0.72;        %Autoregressive coefficient in productivity shock 
rhox=0.85;        %Autoregressive coefficient in investment-specific shock 
rhob=0.85;        %Autoregressive coefficient in preference shock 
k_a=1.1;          %Adjustment cost parameter
thetta=0.4;       %Price stickness parameter
thettaw=0.5 ;     %wage  stickness parameter
psi=4.33;         %elasticity of substitution between intermediate goods
psiw=21;          %elasticity of substitution between differentiated labors
k_m=0.2;          %Quadratic adjustment cost coefficient
//=========================================================================
//                             Model  description  
//=========================================================================
model(linear);
#Pss=1;
#Qss=1;
#eps_bss=1;
#RNss=(1/betta);
#RKss=(1/betta)-(1-deltta);
#MCss=((psi-1)/psi)*(1-betta*thetta);
#XXX=alphha/(1-alphha);
#Wss=(MCss^(1/(1-alphha)))*(1-alphha)*((alphha/RKss)^XXX);
#XX1=(RKss/(RKss-alphha*deltta*MCss))^(sigmac/sigmal) ;
#XX2=(1/((1-h)*(1-betta*h)))^(sigmac/sigmal);
#XX3=Wss^((1+sigmal)/sigmac);
#XX4=(psiw/((1-psiw)*(1-betta*thetta)))^(-1/sigmal);
#XX5=1/((1-alphha)*MCss);
#Yss=XX1*XX2*XX3*XX4*XX5;
#Iss=alphha*deltta*MCss*(Yss/RKss);
#Css=Yss-Iss;
#Lambdass=((1-betta*h))*((Css-h*Css)^-sigmac);
#mss=(((1-betta)*Lambdass)/k_m)^(-1/sigmam);
#SS1=(1/(1-h))*C-(h/(1-h))*C(-1);
#SS2=(1/(1-h))*C(+1)-(h/(1-h))*C;
#SS3=eps_bss*(Css*(1-h))^-sigmac;
[name='Household Lagrangian equation']
SS3*((eps_b-sigmac*SS1)-betta*h*(eps_b(+1)-sigmac*SS2))=Lambdass*Lambda;
[name='Money demand equation']
k_m*(eps_b-sigmam*m)*(mss^ -sigmam)+betta*Lambdass*(Lambda(+1)-PI(+1))=Lambdass*Lambda;
[name='Bonds equation']
Lambda(+1)-Lambda+RN-PI(+1)=0;
[name='Tobins Q'] 
Qss*Q=betta*RKss*(Lambda(+1)-Lambda+RK(+1))+betta*(1-deltta)*Qss*(Lambda(+1)-Lambda+Q(+1));
[name='Investment equation']
Q+k_a*I(-1)-k_a*(1+betta)*I+betta*k_a*I(+1)+X=0;
[name='Law of motion of private capital']
K=(1-deltta)*K(-1)+deltta*I;
[name='Production function']
Y=A+alphha*K(-1)+(1-alphha)*L;
[name='Labour demand']
L=MC+Y-W ;
[name='Capital demand']
K(-1)=MC+Y-RK ;
[name='Marginal cost']
MC=(1-alphha)*(W-P)+alphha*RK-A ;
[name='Gross inflation']
PI=P-P(-1);
[name='Gross wages']
PIW=W-W(-1);
[name='New Keynesian philips equation']
PI=betta*PI(+1)+((1-thetta)*(1-betta*thetta)/thetta)*(MC-P);
[name='philips equation for wage']
PIW=betta*PIW(+1)+((1-thettaw)*(1-betta*thettaw)/thettaw)*(sigmal*L-Lambda-W);
[name='Equilibrium condition']
Yss*Y=Css*C+Iss*I;
[name='Productivity shock']
A=rhoa*A(-1)+u_a;
[name='Preference shock']
eps_b=rhob*eps_b(-1)+u_b;
[name='Investment-specific Technology shock']
X=rhox*X(-1)+u_x;
end;



resid;
steady;
check;
model_diagnostics;


shocks;
var u_a; stderr 0.01;
var u_b; stderr 0.01;
var u_x; stderr 0.01;
end;



stoch_simul( periods=100000 , irf=80 );

In

#XX4=(psiw/((1-psiw)*(1-betta*thetta)))^(-1/sigmal);

the part in the brackets is negative.

Thanks so much. The problem is solved completely.