No error information but theoretical moments NAN problem

I follow the model from Iacoviello and Neri (2010) which consists of the patient household, impatient household and firm. I add borrowing and saving to the model. The impatient household and firm have no borrowing constraints. We want the budget constraints to determine the borrowings and Euler equation determine consumption. The first version attached can be run without any error but the problem is that most of the variables are NaN. I searched the forum and found it could be the unit root problem. I also use model diagnostics which gives the following information,
model_diagnostic: the Jacobian of the static model is singular
**there is 2 colinear relationships between the variables and the equations
Relation 1
Colinear variables:
h_p
n_cp
n_hp
c_p
h_i
n_ci
n_hi
c_i
S
B
w_cp
w_ci
w_hp
w_hi
k_c
b_i1
k_h
l
c_e
q_h
b_e1
q_l
Y
GDP
ih
i_c
i_h
Relation 2
Colinear variables:
S
B
c_e
b_e1
Relation 1
Colinear equations
4 9 18 20

Relation 2
Colinear equations
4 9 18 20**
Actually the three Euler equations from the three sectors are involved. I tried to think about the problem may come from no borrowing constraints from both the impatient household and firm. I then add a borrowing constraint to the impatient household but not to firms (see attached the version 2). Then the model diagnostic gives the following,
model_diagnostic: the Jacobian of the static model is singular
**there is 1 colinear relationships between the variables and the equations
Colinear variables:
S
B
c_e
b_e1
Colinear equations
4 18 20
**
The number of variables to be NaN has become less in this case. I am wondering if the absence of borrowing constraints causes the model to be non-stationary or is there other problem that I didn’t realise?
2.mod (8.7 KB)
1.mod (8.56 KB)

One issue are unit roots. When you use the check-command, the eigenvalues will be displayed. There you can see of they are the source of the problem.
A different problem is that sometimes variables in a model cannot be determined uniquely in steady state. For example, in the basic RBC model where Ricardian equivalence holds, bonds and lump sum taxes are perfect substitutes and cannot be determined separately, leading to the same error message. You need to understand which of the two cases happens in your model.

Hi Johannes,
Many thanks for your prompt reply. I think my problem is the unit root. I checked the eigenvalues displayed as follows,
**EIGENVALUES:
Modulus Real Imaginary

   3.988e-17        3.988e-17                0
   4.909e-14        4.909e-14                0
   8.887e-14        8.887e-14                0
   9.514e-14       -9.514e-14                0
      0.0356           0.0356                0
     0.03808         -0.03808                0
         0.9              0.9                0
         0.9              0.9                0
         0.9              0.9                0
         0.9              0.9                0
         0.9              0.9                0
         0.9              0.9                0
         0.9              0.9                0
         0.9              0.9                0
      0.9571           0.9571                0
      0.9958           0.9958                0
      0.9994           0.9994                0
           1                1                0
           1                1                0
       1.009            1.009                0
       1.009            1.009                0
       1.024            1.024                0
       1.026            1.026                0
       1.125            1.125                0
       196.3            196.3                0
         Inf              Inf                0
         Inf              Inf                0
         Inf              Inf                0

There are 9 eigenvalue(s) larger than 1 in modulus
for 9 forward-looking variable(s)**
There are two eigenvalues that are unit roots. However, I am not able to see which equations are the sources of these unit roots. I suspect the Eulers equations may cause the problem. The model diagnostics also show that three Euler equations from the three sectors have colinear relations. I will appreciate you could have a look at my mod file and help me to find the unit root equations.
test.mod (8.64 KB)

I cannot really help you here. But it is suspicious that equation 4 is involved

c_p=c_p(+1)-BETA_P*r_s;
In itself, this looks like it can give rise to a unit root as c_p(+1) is equal to its past value plus an additional term. This is basically a random walk.

Many thanks for your reply. You’ve helped me a lot.