Hello everyone, I’ve recently encountered some issues while trying to implement occbin. In my model, there is an equilibrium condition:

E_t \leq \bar{E}

According to my model assumptions, when E_t < \bar{E}, its price \tau should be 0; when E_t = \bar{E}, its price should be 0.097890 at the steady state according to my calculations.

I wanted the system to initially be in a binding steady state, so I input the corresponding steady state into the steady_state_model block. However, it seems that Dynare considers my constraint to be slack, thus using the corresponding equilibrium condition, which leads to non-zero residuals for the equations.

I really don’t know what went wrong and hope someone can help me. Thanks in advance!

Here are my complete code and mod file, as well as the equation residuals:

```
// Define Endogenous Variables
var y ${Y}$ (long_name='Output')
c ${C}$ (long_name='Consumption')
i ${I}$ (long_name='Investment')
k ${K}$ (long_name='Capital Stock')
k_star ${K^*}$ (long_name='Capital Decision')
n ${N}$ (long_name='Labor')
w ${W}$ (long_name='Wage')
rk ${R^K}$ (long_name='Capital Rental Rate')
r ${R}$ (long_name='Interest Rate')
m ${M}$ (long_name='Pollution Stock')
e ${E}$ (long_name='Emission')
u ${u}$ (long_name='Abatement Effort')
z ${Z}$ (long_name='Abatement Cost')
tau ${P^E}$ (long_name='Permit Price')
a ${A}$ (long_name='Technology')
Delta ${\Delta}$ (long_name='Disaster Size')
x ${x}$ (long_name='Disaster Binary Variable')
lny ${\ln(y)}$ (long_name='Log Form Output')
lnc ${\ln(c)}$ (long_name='Log Form Consumption')
lni ${\ln(i)}$ (long_name='Log Form Investment')
lnk ${\ln(k)}$ (long_name='Log Form Capital')
lnks ${\ln(k^*)}$ (long_name='Log Form Capital Decision')
;
//define predetermined variable
predetermined_variables x;
// Define Exogenous Variables
varexo ex ${\varepsilon^x}$ (long_name='Disaster Shock')
ed ${\varepsilon^{\Delta}$ (long_name='Disaster Risk Shock')
;
// Define Parameters
parameters
beta ${\beta}$ (long_name='Subjective Discount Factor')
alpha ${\alpha}$ (long_name='Capital Share')
phi ${\varphi}$ (long_name='Inverse Frisch Elasticity')
delta ${\delta}$ (long_name='Capital Depreciation Rate')
deltam ${\delta_M}$ (long_name='Pollution Decay Rate')
theta ${\theta}$ (long_name='Disaster Probability')
Delta_ss ${\Delta}$ (long_name='Steady State Value of Disaster Size')
theta1 ${\theta_1}$ (long_name='Abatement Cost Function Efficient')
theta2 ${\theta_2}$ (long_name='Abatement Cost Function Efficient')
gamma1 ${\gamma_1}$ (long_name='Emission Function Efficient')
d0 ${d_0}$ (long_name='Pollution Externality Coefficient')
d1 ${d_1}$ (long_name='Pollution Externality Coefficient')
d2 ${d_2}$ (long_name='Pollution Externality Coefficient')
ga ${g_A}$ (long_name='Growth Rate')
rho ${\rho}$ (long_name='Disaster Risk Smoothing Parameter')
erow ${E^{row}}$ (long_name='Emission rof World')
chi ${\chi}$ (long_name='Disutility Scale')
ebar ${\bar{E}}$ (long_name='Permit Quota')
;
//Calibration
beta = 0.99; // Subjective Discount Factor
alpha = 0.3; // Capital Share
phi = 3; // Inverse Frisch Elasticity
delta = 0.025; // Capital Depreciation Rate
deltam = 0.0021; // Pollution Decay Rate
Delta_ss = 0.43; // Disaster Size
theta = 0.009; // Disaster Probability
gamma1 = 0.601; // Emission Function Efficiency
theta1 = 0.18; // Abatement Cost Function Efficiency
theta2 = 2.8; // Abatement Cost Function Efficiency
d0 = 1.4e-3; // Parameter of the damage function
d1 = -6.672e-6; // Parameter of the damage function
d2 = 1.465e-8; // Parameter of the damage function
rho = 0.8;
ga = 0.005;
chi = 14.4300083796; // Disutility Scale
erow = 1.0653773496; // emission rest of the world
ebar = 0.70421477 * 0.7;
model;
[name='Disaster Size ']
log(Delta) = (1-rho)*log(Delta_ss) + rho*log(Delta(-1)) + ed;
[name='Disaster']
x(+1) = theta + ex;
[name='Growth Rate']
a = exp(ga + x * log(1-Delta));
[name='Output Equation']
y = k^alpha * (n)^(1-alpha) * (1 - (d0 + d1 * m + d2 * m^2));
[name='Capital Disaster']
k * a = k_star(-1) * exp(x * log(1-Delta));
[name='Market Clearing']
y = c + i + z;
[name='Capital Accumulation']
k_star = (1-delta) * k + i;
[name='Optimal Capital']
1 = beta * (c / c(+1)) * exp(x(+1) * log(1-Delta)) * (1-delta + rk(+1));
[name='Consumption Euler']
1 = beta * (c / c(+1)) * r;
[name='Labor Supply']
chi * n^phi * c = w;
[name='Emission Function']
e = (1 - u) * gamma1 * y;
[name='Abatement Cost']
z = y * theta1 * u^theta2;
[name='Pollution Stock Dynamics']
m = (1 - deltam) * m(-1) / a + e + erow;
[name='Labor Demand']
w = (1 - alpha) * (y / n);
[name='Capital Demand']
rk = alpha * (y / k);
[name='Abatement Effort']
u = (tau * gamma1 / (theta1 * theta2))^(1 / (theta2-1));
[name='Log Form']
lny = log(y);
lnc = log(c);
lnk = log(k);
lni = log(i);
lnks = log(k_star);
[name='Emission Dynamics', bind='Cap']
e = ebar;
[name='Emission Dynamics', relax='Cap']
tau = 0;
end;
steady_state_model;
y = 1.1771653161;
c = 0.9061690278;
i = 0.2634963021;
k = 8.7795458217;
k_star = 8.8235534782;
n = 0.5010313778;
w = 1.6446389544;
rk = 0.0402241303;
r = 1.0101010101;
a = 0.9999409315;
m = 763.4923833657;
e = ebar;
u = 0.3032271177;
z = 0.0074999863;
tau = 0.0978900460;
x = theta;
Delta = Delta_ss;
lny = log(y);
lnc = log(c);
lnk = log(k);
lnks = log(k_star);
lni = log(i);
end;
write_latex_dynamic_model;
write_latex_static_model;
resid;
steady;
occbin_constraints;
name 'Cap';
bind e >= ebar;
relax e < ebar;
end;
occbin_setup;
Residuals of the static equations:
Equation number 1: Disaster Size : 0.000000
Equation number 2: Disaster : 0.000000
Equation number 3: Growth Rate : 0.000000
Equation number 4: Output Equation : 0.000000
Equation number 5: Capital Disaster : 0.000000
Equation number 6: Market Clearing : 0.000000
Equation number 7: Capital Accumulation : 0.000000
Equation number 8: Optimal Capital : 0.000000
Equation number 9: Consumption Euler : 0.000000
Equation number 10: Labor Supply : 0.000000
Equation number 11: Emission Dynamics : 0.097890
Equation number 12: Emission Function : 0.000000
Equation number 13: Abatement Cost : 0.000000
Equation number 14: Pollution Stock Dynamics : 0.000000
Equation number 15: Labor Demand : 0.000000
Equation number 16: Capital Demand : 0.000000
Equation number 17: Abatement Effort : 0.000000
Equation number 18: Log Form : 0.000000
Equation number 19: lnc : 0.000000
Equation number 20: lnk : 0.000000
Equation number 21: lni : 0.000000
Equation number 22: lnks : 0.000000
```