Error adding deposit fee in DSGE!

I get an error when I try to use the Gali 2015 (that professor Johannes has posted as chap 3 mod).

The errors occur when I try to add deposit fee to the model.

I am trying to add CBDC, deposit fee and exchange rate. But I started with deposit fee. The errors I get are the following… NaN for FOC labor eq, and real wage definition, nominal money stock. All of which were in the Gali 2015 code.

Can you please help me find the issue?

Residuals of the static equations:
Equation number 1: New Keynesian Phillips Curve eq. (22) : 0.000000
Equation number 2: Dynamic IS Curve eq. (23) : 0.000000
Equation number 3: Interest Rate Rule eq. (26) : 0.000000
Equation number 4: Definition natural rate of interest eq. (24) : 0.000000
Equation number 5: Definition real interest rate : 0.000000
Equation number 6: Definition natural output, eq. (20) : 0.000000
Equation number 7: Definition output gap : 0.000000
Equation number 8: Monetary policy shock : 0.000000
Equation number 9: TFP shock : 0.000000
Equation number 10: Production function (eq. 14) : 0.000000
Equation number 11: Preference shock, p. 54 : 0.000000
Equation number 12: Money growth (derived from eq. (4)) : 0.000000
Equation number 13: Real money demand (eq. 4) : 0.000000
Equation number 14: Annualized nominal interest rate : 0.000000
Equation number 15: Annualized real interest rate : 0.000000
Equation number 16: Annualized natural interest rate : 0.000000
Equation number 17: Annualized inflation : 0.000000
Equation number 18: Output deviation from steady state : 0.000000
Equation number 19: Definition price level : 0.000000
Equation number 20: resource constraint, eq. (12) : 0.000000
Equation number 21: FOC labor, eq. (2) : 0.000000
Equation number 22: definition real wage : 0.000000
Equation number 23: definition nominal money stock : 0.000000
Equation number 24: average price markup, eq. (18) : 0.000000
Equation number 25: average price markup, eq. (20) : 0.000000
Equation number 26: deposit fee : 3.000000

Warning: Matrix is singular to working precision.

In evaluate_steady_state (line 339)
In steady (line 112)
In Gali.driver (line 567)
In dynare (line 310)

Residuals of the static equations:
Equation number 1: New Keynesian Phillips Curve eq. (22) : 0.000000
Equation number 2: Dynamic IS Curve eq. (23) : 0.000000
Equation number 3: Interest Rate Rule eq. (26) : 0.000000
Equation number 4: Definition natural rate of interest eq. (24) : 0.000000
Equation number 5: Definition real interest rate : 0.000000
Equation number 6: Definition natural output, eq. (20) : 0.000000
Equation number 7: Definition output gap : 0.000000
Equation number 8: Monetary policy shock : 0.000000
Equation number 9: TFP shock : 0.000000
Equation number 10: Production function (eq. 14) : 0.000000
Equation number 11: Preference shock, p. 54 : 0.000000
Equation number 12: Money growth (derived from eq. (4)) : 0.000000
Equation number 13: Real money demand (eq. 4) : 0.000000
Equation number 14: Annualized nominal interest rate : 0.000000
Equation number 15: Annualized real interest rate : 0.000000
Equation number 16: Annualized natural interest rate : 0.000000
Equation number 17: Annualized inflation : 0.000000
Equation number 18: Output deviation from steady state : 0.000000
Equation number 19: Definition price level : 0.000000
Equation number 20: resource constraint, eq. (12) : 0.000000
Equation number 21: FOC labor, eq. (2) : NaN
Equation number 22: definition real wage : NaN
Equation number 23: definition nominal money stock : NaN
Equation number 24: average price markup, eq. (18) : 0.000000
Equation number 25: average price markup, eq. (20) : 0.000000
Equation number 26: deposit fee : 0.000000

Error using print_info (line 33)
The steady state has NaNs or Inf.

Error in steady (line 143)
print_info(info,options_.noprint, options_);

Error in Gali.driver (line 567)
steady;

Error in dynare (line 310)
evalin(‘base’,[fname ‘.driver’]);

It seems that your last equations was incorrectly linearized.

I believe you are referring to the deposit fee:
[name=‘deposit fee’]

omegaa = love*(i - r_nat) + peace*(pi - pi_star) + life*y_gap;

I don’t see how this is incorrect. It is linear?

What is pi_star? There must be a constant term in that equation that does not belong there.

It is target inflation rate.
However, I tried to simplify it now: tau = gammai
This is the deposit fee. However max, min does not work in dynare. I also tried using @# to create conditions that if interest rate, i <= 1 then tau = gamma
i
If not, if i >1 then tau = 0

It also did not work. How can I make this condition. Because I get an error. It says something about conditions not being able to be used during simulations: runtime

You did not provide sufficient information to understand what you are trying to achieve. But it sounds a lot like you need to use OccBin or perfect foresight simulations.

I will try to give you some more context:

We are using your existing codes from GALI(2015) chap_3.mod to build a DSGE Model that captures the implementation of a Central Bank Digital Currency (CBDC) as the unit of account, with paper currency circulating in the economy as well. We want to investigate that when we have CBDC we can eliminate the Zero lower bound (ZLB), and have a negative interest rate. To stop people from hoarding money in times with negative interest rate, we want to implement a deposit fee which applies to the paper currency only when the interest rate (i) <= 0.

Our deposit fee equation is tau = I*gamma. But we want to add an condition to this fee.

I am now trying to use Occbin: I get an error:
ERROR: tryagainb.mod: line 191, col 1 - line 193, col 20: tau_fee is not a parameter
tryagainb.mod (11.1 KB)

Please see my answer above

Occbinerror.mod (11.2 KB)

Here is updated codes. With error when using occbin. I tried to follow the similar method used for when applying ZLB

The equations need to have the same name tag:

[name = 'Deposit Fee Activated', bind='tau_bind']
tau_fee = tau;

[name = 'Deposit Fee Activated', relax='tau_bind']
tau_fee = gamma_zero;

Thank you so much for the reply! The codes are running now perfectly fine!

In reference to my other post about using constraint for deposit fee here (ZLB in the other model)… according to your previous response in the other topic, it seems my simulations here also don’t include the occbin toolkit I used, since I am running simulations by using: stoch_simul(order = 1,irf=15,irf_plot_threshold=0)?

I am really unsure, since the code runs, but graphs dont seem to have changed.
Occbinerror.mod (11.2 KB)