 # Nonzero residuals of static equations

Hi professor
I have two equations:
1- b=d+kb
2- jb=rbb-rdd.
In steady state model block i use these two equations as below:
1- d=ln(exp(b)-exp(kb));
2- jb=ln(exp(rb)*exp(b)-exp(d)*exp(d));

But in residuals of static equations part, the residuals of two equations mentioned earlier are nonzero.
Best regards.
AAA.mod (16.5 KB)

Your equations above are impossible to read, because some multiplication signs must be missing.

It is usually better to work with auxiliary equations to get a log-linearization. See Question about understanding irfs in dynare

Excuse me
the two equations are:
1- b=d+kb;
2- jb=brb-drd
thanks for your tips, but if you see the steady state model block i find the steady state value of all variables by mentioned method and residuals of all get zero instead of 2 mentioned equations.
would you please check it again?
Best regards

Hi professor
as you said in the topics, I performed an exp() substituion and the right form of above equations are:
1- exp(b)=exp(d)+exp(kb);
2-exp(jb)=exp(b)*exp(rb)-exp(d)*exp(rd);
would you now check the model again?

In

``````d=log(exp(b)-exp(kb));
``````

you are getting a negative number inside of the bracket.

Excuse me professor
How do you understand that the exparation (ln(exp(b)-exp(kb)) become negative?
Because i experience this problem before and dynare give an error that “resid: The initial values for the steady state of the following variables are complex”.
But dynare do not give me this error now?
How i can fix the error?

You can execute the parameter definitions and the steady state model equations using F9 in Matlab. You will then see the problem. Tip: use % instead of // to add comments. Otherwise Matlab will complain if you execute lines with appended comments.

Hi Prof. jpfeifer, I have similar doubts.

If my model has, e.g. 20 equations, by `resid` MATLAB/dynare only reports the first 2 equations nonzero,

does it mean (i) I only need to check these 2 equations,
or (ii) I have to check all 20 equations
to remove these 2 nonzeros??

This means that all equation may be wrong, but for debugging, the place to start are the two equations with non-zero residuals.

1 Like

Furthermore, one follow-up question:
This post is in “Steady state” category, does it mean
(i) I only need to check my steady-state settings/file,
or (ii) the whole equation system and my model settings may have flaws??

Option ii). Your entered equations and the computed steady state values are inconsistent. There must be a mistake somewhere, but it is unclear whether it is the model equations or the steady state computation that has the mistake.

1 Like