"Impossible to find steady state" despite "sum of square residuals of the static equations" being 0

I have a model that I am trying to love. The following shows the error for each of the equation being close to zero.

Equation number 1 : -0.00019977 : Lambda
Equation number 2 : 0 : M
Equation number 3 : 0 : p
Equation number 4 : 0 : 4
Equation number 5 : -0.0010725 : 5
Equation number 6 : -0.0027062 : 6
Equation number 7 : 0 : 7
Equation number 8 : -8.6782e-05 : z_r
Equation number 9 : -7.9136e-05 : z_lr
Equation number 10 : -6.6192e-06 : y
Equation number 11 : -6.6173e-06 : pi
Equation number 12 : -6.9881e-06 : d
Equation number 13 : 0 : D
Equation number 14 : 0 : 14
Equation number 15 : 0 : 15
Equation number 16 : 0.001224 : 16
Equation number 17 : 0.0013341 : 17
Equation number 18 : -0.003505 : 18
Equation number 19 : -0.00094701 : 19
Equation number 20 : 0 : lev
Equation number 21 : 0 : log_p
Equation number 22 : 0 : log_e
Equation number 23 : 0 : log_md
Equation number 24 : 0 : log_mc
Equation number 25 : 0 : log_r
Equation number 26 : 0 : log_lev
Equation number 27 : 0 : log_ar
Equation number 28 : 0 : log_alr
Equation number 29 : 0 : log_as

However, there is still the “impossible to find steady state” error and it shows that “sum of square residuals of the static equations” is 0.0000. The initial guess is solved directly using an external .m file.

Why is this happening? Can you give me some help to make this go through?

I followed suggestion from another post by adding

options_.dynatol.f=5e-4;

before the steady command, but I this does not seem to do anything.

Can you please give me some help? Thank you!

1 Like

Your largest residual is 2e-3, so using 5e-4 as a tolerance criterion will not work. If you solved for the steady state numerically, try increasing the precision of the solver.

I have changed the residual to value smaller than the largest residual, but it still does not work.

resid(1);
options_.dynatol.f= 5e-3;
steady(solve_algo = 2, maxit = 1000000);
check;

Is this the right syntax?

1 Like

I would need to see the full file.

model_xi8.mod (3.1 KB)

This is the model file. The vector x8 is the vector of initial guesses that I calculate outside of this file, it won’t run independently. However if I run it, I get the following error with residuals

Residuals of the static equations:

Equation number 1 : 0 : Lambda
Equation number 2 : 0 : M
Equation number 3 : 0 : p
Equation number 4 : 0 : 4
Equation number 5 : -0.00094814 : 5
Equation number 6 : -0.0025217 : 6
Equation number 7 : 0 : 7
Equation number 8 : 0 : z_r
Equation number 9 : 0 : z_lr
Equation number 10 : 0 : y
Equation number 11 : 0 : pi
Equation number 12 : 0 : d
Equation number 13 : 0 : D
Equation number 14 : 0 : 14
Equation number 15 : 0 : 15
Equation number 16 : 0.0010581 : 16
Equation number 17 : 0.0011037 : 17
Equation number 18 : -0.0031503 : 18
Equation number 19 : -0.00098856 : 19
Equation number 20 : 0 : lev
Equation number 21 : 0 : log_p
Equation number 22 : 0 : log_e
Equation number 23 : 0 : log_md
Equation number 24 : 0 : log_mc
Equation number 25 : 0 : log_r
Equation number 26 : 0 : log_lev
Equation number 27 : 0 : log_ar
Equation number 28 : 0 : log_alr
Equation number 29 : 0 : log_as

Error using print_info (line 32)
Impossible to find the steady state (the sum of square residuals of the static equations is 0.0000). Either the model doesn’t have a steady
state, there are an infinity of steady states, or the guess values are too far from the solution

It seems I can’t make the residuals smaller and the tolerance option does not seem to work. Could you help me get over this step. Thank you so much.

Jeremy

Then I need the values for x8 as well.

x8 = [1.0e+03 * 1.9489, 0.0001, 0.2661, 0.2534, 1.0667, 0.6164, 0.0006, 2.1071, 1.5861, 0.0000, 0.0000, 0.0006, 0.0136]

Here it is! Thank you!

Given the size differences in the vector, the posted vector does not have sufficient precision.

Then why does it say the sum of square residuals of the static equations is 0.0000?

Is there a way to control the tolerance level?

What I was saying is: you cannot post numerical values with single precision here and expect the code too work on my machine if double precision is needed. Use e.g. format long.

Would it be possible to get a general advice on how to solve this problem? Judging by the error message “Impossible to find the steady state (the sum of square residuals of the static equations is 0.0000)”, it seems like there is a way to adjust the tolerance level a bit to make this go through?

I tried adding

resid(1);
options_.dynatol.f= 5e-3;
steady(solve_algo = 2, maxit = 1000000);
check;

before the steady command but it does not work.

With solve_algo=2, you need to use options.solve_tolf, not options_.dynatol.f.

3 Likes

Hi Professor Pfeifer,

I have almost the similar problem. The residuals for 4 equations are close to 0 and when I pllay with the tolerence, I cannot get the steady state.
Thanks for your time in advance

Equation number 14 : 0.00032602 : R14 - Budget constraint of Ricardian households
Equation number 21 : -8.4403e-05 : W7 - Budget constraint of the Wealthy Hand-to-Mouth households
Equation number 26 : -0.00020058 : P3 - Budget constraint of the Poor Hand-to-Mouth households
Equation number 57 : -4.1036e-05 : A11 - Aggregation - Non-durable goods Production

Steady_State.mod (29.1 KB)

You are not calling a solver. So you need to set

options_.solve_tolf

But given that you do not provide an analytical steady state, you may want to use initval and actually call a solver.

Steady_State.mod (29.1 KB)

Thanks a lot for your reply. I really appreciate that.
What is the difference between options_.solve_tolf and options_.dynatol.f?
Do I have to use the first one as I am using the analytical steady state and thesteady_state_model block and to use the second one instead if I have initval block in the model?

When I determine the steady state myself, I have to solve a system of linear equation to find the consumption for my agents. If I ask Matlab to consider more decimals for when she shows the solutions (right now it is four), the residuals of more equations become non-zero (but almost zero) but the residuals of the equations I mentioned in the previous post become closer to zero and if I play with the tolerence, I can get the steady state without anyproblem.
Why does this happen? Do I really loose anything by accepting the steady state even though it is not really absolute zero but super close to zero?

Again, thanks in advance for your help.

The first governs the checks whether the steady state is correct. The second one governs the termination criterion of the solver used when you do not provide an analytical steady state.

Whether a larger tolerance criterion is unproblematic depends cannot be generally answered. The tolerance for the equations does not one to one map into the tolerance for the actual variables. If you have variables with very small absolute values like 0.001, then a large tolerance may be more problematic.