Singular Jacobian in model with fiscal sector and banking sector

Dear all,
my co-authors and I are working on a closed economy DSGE model including households, entrepreneurs, capital producers, retailers, a central bank and a fiscal sector and a banking sector. The banking sector is modelled according to Gerali et al. (2010). It includes a wholesale branch which underlies a leverage constraint and a retail branch that gives credit to entrepreneurs (under a borrowing constraint) and to the government. The fiscal sector is modelled including the government budget constraint, a fiscal spending rule and a fiscal tax rule.
We calculated the steady state by fixing K/Y, G/Y and T/Y shares. Dynare finds the steady state and is able to calculate moments and impulse responses. However, we get the following error message:

model_diagnostic: the Jacobian of the static model is singular, there is 1 colinear relationships between the variables and the equations
Colinear variables:
c_p
d_p
lam_p
l_p
c_e
k_e
b_ee
lam_e
s_e
l_pd
y_e
r_k
mc_E
J_R
x
I
C
Y
w_p
B
D
K
J_B
K_b
lev
rr
G
T
b_g
pi
r_ib
R_b
r_be
r_bg
spread_e
spread_g
Colinear equations
17
The collinear equation is the fiscal spending rule and collinearity affects almost all variables of the model (36 out of 42).

We tried leaving out the government budget constraint because in steady state it cannot be distinguished from the fiscal tax rule and instead included the retail profit function. This does not help and neither do specifications with taxes only paid by households or different specifications of the world resource constraint. We suspect that the model does not know how to allocate credit to entrepreneurs and the government, although they pay different interest rates.

We’re obviously missing something and would be very grateful for any ideas. I attach our mod-file.
Many thanks in advance!

CBB_Gov_closed_econ_20171110.mod (11.0 KB)

For the file you uploaded, the steady state cannot be computed.

Sorry about that. It works with Matlab R2015a or earlier and Dynare 4.4.3, but it turns out it doesn’t work with later versions because auf the changes to Tol.Fun in fsolve. We’re still trying to work this out.

In the meantime, could you perhaps have a look at the model itself to see if you have any ideas where our collinearity problem regarding the fiscal spending rule discussed in my previous post could stem from? Thank you very much!

I can only give the standard advice. Start from a simpler version of the model that works and see where the singularity is introduced.