SVD error (NaN or Inf) because of +1 variable?

Dear All,

I am facing the SVD error that many have ‘Input to SVD must not contain NaN or Inf.

I have gone through the forum and read the answers to the same error message (for instance this thread and that one), and double checked that all variables and parameters are loaded from my file.

The steady state calculation gives six values very close to 0, but I also have tried manually assigning a steady state vector with all variables significantly different from 0, but the error stays.

From the previous posts, I understand that it is most likely due to a non computable equation like a division by 0 maybe due to a negative power. So I manually found out that changing the ^ to a + in line 127 removes the error. I guess that the error might be that the lagged C(+1) is zero. But I don’t understand why it is so.

Can someone please confirm my analysis and help me solve this issue? I attach my model file and the mat file that contains the steady states and parameters loaded by the model. I renamed the MAT file to “dsge1_ss.mat.txt” because I couldn’t upload it otherwise. It needs to be renamed “dsge1_ss.mat” without .txt.

Thanks!
dsge1_forum.mod (4.58 KB)
dsge1_ss.mat.txt (514 Bytes)

Unfortunately, the error message is somewhat cryptic. If you put

before the steady command, you will see that some steady state values you provided are not close to the true ones (or the entered model equations are incorrect, but the steady state was):

[quote]Residuals of the static equations:
Equation number 1 : 3.8287e-005
Equation number 2 : 3.7537e-005
Equation number 3 : 3.8918e-006
Equation number 4 : -1.8426e-005
Equation number 5 : 3.5347e-005
Equation number 6 : -9.2706e-005
Equation number 7 : -1.3199e-005
Equation number 8 : -1.3357e-005
Equation number 9 : -6.8204e-005
Equation number 10 : -3.3649e-005
Equation number 11 : 3.2553e-005
Equation number 12 : 6.7483e-006
Equation number 13 : -6.0638e-005
Equation number 14 : 0.061165
Equation number 15 : -6.058e-005
Equation number 16 : 2.2328e-005
Equation number 17 : -0.038417
Equation number 18 : 6.8424e-005
Equation number 19 : -0.0014327
Equation number 20 : 0.022529
Equation number 21 : 0
Equation number 22 : 0.002674
Equation number 23 : 0
Equation number 24 : 0
Equation number 25 : 0.1
Equation number 26 : 0.315
Equation number 27 : 0.0164
Equation number 28 : 0.000382[/quote]

Dynare now has a problem to find the true steady state and fails during numerically searching for the steady state because in one iteration of the numerical algorithm the used guess for the steady state results in an “Inf” and crashes the algorithm. The solution is both simple and tough: provide better starting values that are closer to the true ones. For your values all four optimizers in Dynare fail.

Thanks so much for your help. I actually wrote a Matlab script to optimize the system to look for a steady state, and these are the best values it could find. I hoped the residuals were small enough :unamused: . I will work on improving my ss values.

Would it help Dynare, and would it be easier to find steady state values if I rewrote my model in log-linearized form?

Yes, log-linearizing would help, because then all SS-values are identical to 0. However, in this case the SS-values become parameters in front of the variables in the linearized equations. If you are able to compute those analytically, you can also provide them to Dynare. Hence, there is no gain in loglinearization as you need the steady state values in any case.

From the previous posts, I understand that it is most likely due to a non computable equation like a division by 0 maybe due to a negative power. So I manually found out that changing the ^ to a + in line 127 removes the error. I guess that the error might be that the lagged C(+1) is zero. But I don’t understand why it is so!


Classic Bridesmaid Dresses|Sheath Wedding Dresses|Black Junior Bridesmaid Dresses|Maternity Wedding Dresses