# Log form steady state residual

**URL:** <https://forum.dynare.org/t/log-form-steady-state-residual/25503>\
**Category:** Steady state\
**Created:** [8 April 2024 02:31 UTC](https://forum.dynare.org/t/log-form-steady-state-residual/25503 "2024-04-08T02:31:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![max3](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@max3](https://forum.dynare.org/u/max3)\
**Post date:** [8 April 2024 02:31 UTC](https://forum.dynare.org/t/log-form-steady-state-residual/25503/1 "2024-04-08T02:31:35Z")

</div>

Here is my mod file  
[di\_no.mod](https://forum.dynare.org/uploads/short-url/p7GyaDNE1hZXXDXdwLLM2CoPcIV.mod) (3.5 KB)  
, which can be run successfully on dynare. But I found that the residuals of those equations defining variable’s log form are so huge that I think it should not be a steady state. \  
Thanks in advance!

> Residuals of the static equations:

> Equation number 1 : 0 : 1  
> Equation number 2 : 0 : lntheta\_d  
> Equation number 3 : 1.1763e-07 : 3  
> Equation number 4 : 0 : 4  
> Equation number 5 : 0 : q  
> Equation number 6 : 0 : 6  
> Equation number 7 : 0 : y  
> Equation number 8 : 0 : lntheta\_f  
> Equation number 9 : 0 : A  
> Equation number 10 : 0 : lna  
> Equation number 11 : 2.6025e-07 : dx  
> Equation number 12 : 0 : x  
> Equation number 13 : 0 : e  
> Equation number 14 : 0 : rk  
> Equation number 15 : 8.3061e-08 : w  
> Equation number 16 : 0 : 16  
> Equation number 17 : 0 : g  
> Equation number 18 : 0 : lng  
> Equation number 19 : 0 : 19  
> Equation number 20 : 0 : 20  
> Equation number 21 : 0 : 21  
> Equation number 22 : 0 : 22  
> Equation number 23 : 0 : 23  
> Equation number 24 : 0 : 24  
> Equation number 25 : 0 : lny  
> Equation number 26 : 0 : lni  
> Equation number 27 : 0 : lnc  
> Equation number 28 : -0.45554 : lnk  
> Equation number 29 : 0.98154 : lnh  
> Equation number 30 : -0.01005 : lnr  
> Equation number 31 : 0 : lnpi  
> Equation number 32 : -0.41524 : lne

---

<div class="post-metadata">

**Author:** ![max3](https://forum.dynare.org/letter_avatar_proxy/v4/letter/m/59ef9b/32.png) [@max3](https://forum.dynare.org/u/max3)\
**Post date:** [8 April 2024 05:42 UTC](https://forum.dynare.org/t/log-form-steady-state-residual/25503/2 "2024-04-08T05:42:47Z")

</div>

This problem is fixed! The reason is that I forgot to give these log form variable initial value. But here is a new question: why the code can be run successfully ? Moreover, I noticed that the residual is the log value of these variables in steady state.

---

<div class="post-metadata">

**Author:** ![stepan-a](https://forum.dynare.org/user_avatar/forum.dynare.org/stepan-a/32/6652_2.png) [@stepan-a](https://forum.dynare.org/u/stepan-a)\
**Post date:** [8 April 2024 07:40 UTC](https://forum.dynare.org/t/log-form-steady-state-residual/25503/3 "2024-04-08T07:40:37Z")

</div>

Hi Max,

The residuals, whose display is triggered by the `resid` command, are calculated for the values given in the `initval` block. These residuals will be non-zero if the values given in the `initval` block are not the steady state. After that, when you call the `steady` command, Dynare acknowledges that the initial guess is not the steady state and runs a nonlinear solver to find the zero of the static equations. If the non-linear solver is successful (as in your case), Dynare can proceed and solve the approximated model.

Best,  
Stéphane.
