Hi all,

I am trying to run a deterministic model simulating the effect of a permanent shock. I first run the model in a stochastic circumstance. It runs perfectly fine. However, when I changed into a deterministic environment, Dynare failed to solve the perfect foresight model. In the model simulation part, Dynare gives me the following message:

Iter: 3, err. = 2.98602704547348e+16, time = 0.29229

Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =

3.708341e-20.

In sim1>lin_solve (line 236)

In sim1 (line 165)

In perfect_foresight_solver_core (line 94)

In perfect_foresight_solver (line 61)

In code20 (line 605)

In dynare (line 235)

Last iteration provided complex number for the following variables:

lamb, Iter: 4, err. = 6.264235574022294e+31, time = 0.33963

Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND =

2.601730e-39.

In sim1>lin_solve (line 236)

In sim1 (line 165)

In perfect_foresight_solver_core (line 94)

In perfect_foresight_solver (line 61)

In code20 (line 605)

In dynare (line 235)

I am not sure what is going on. What did Dynare mean by saying “Last iteration provided complex number for the following variables: lamb,”? Anyone has run into the same situation as me?

From stochastic to deterministic, I moved 3 variables from the “parameter” block to the “varexo” block. Because they serve as an exotic change and the values differ from the initial value to the end value. I am not sure if it is the change that caused this problem. I have attached the mod files for your information. The code20 is the deterministic one and the code22 is the stochastic one. Please feel free to comment on this.

Thanks!

Jaxx

code20.mod (7.9 KB) code22_steadystate.m (2.4 KB) code22.mod (7.7 KB)