# Residuals

**URL:** <https://forum.dynare.org/t/residuals/2470>\
**Category:** Dynare help (legacy posts)\
**Created:** [17 April 2012 12:53 UTC](https://forum.dynare.org/t/residuals/2470 "2012-04-17T12:53:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rteconomics](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@rteconomics](https://forum.dynare.org/u/rteconomics)\
**Post date:** [17 April 2012 12:53 UTC](https://forum.dynare.org/t/residuals/2470/1 "2012-04-17T12:53:47Z")

</div>

Hello,  
One easy (?) question. I’m working on a model that has 24 equations.  
With the command ‘resid;’ I can see the residuals from each equation. The model runs fine and the results are almost ok BUT the residuals of 1 of the 24 equations are NOT zero. After checking many times, I’m sure that equation is correctly specified.

Does anyone know why this happens and what issue can this generate?  
Many thanks in advance!  
RT

---

<div class="post-metadata">

**Author:** ![bkjecn](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@bkjecn](https://forum.dynare.org/u/bkjecn)\
**Post date:** [17 April 2012 13:31 UTC](https://forum.dynare.org/t/residuals/2470/2 "2012-04-17T13:31:45Z")

</div>

If you have non-zero residuals using the resid command it means that the values in the most recent initval or endval block, or the values that are returned form your \_steadystate.m file, do not satisfy the static equations. This means that the values for the endogenous variables don’t solve the steady state. The equation may be correct, but it seems that you haven’t quite solved for the steady state. It’s hard to tell exactly what is wrong without seeing the mod file.

---

<div class="post-metadata">

**Author:** ![rteconomics](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@rteconomics](https://forum.dynare.org/u/rteconomics)\
**Post date:** [17 April 2012 13:42 UTC](https://forum.dynare.org/t/residuals/2470/3 "2012-04-17T13:42:31Z")

</div>

Hi bkjecn!  
Attached is the .mod file. It’s an open economy model built on Uribe (2003) with capital adjustment costs, portfolio adjustment costs and government expenditure reversal. I solved the model by hand and found the corresponding steady state values (and equations) by hand.  
The equation that ‘does not clear’ is the FOC wrt h (marginal disutility of work). It’s very puzzling because if N-1 equations clear, why the N-th does not?  
Thanks again!  
RT  
[model.mod](https://forum.dynare.org/uploads/default/original/2X/4/4f10313a5e92d7a726095840e0e07b9f481c22a8.mod) (9.51 KB)

---

<div class="post-metadata">

**Author:** ![rteconomics](https://forum.dynare.org/letter_avatar_proxy/v4/letter/r/9de0a6/32.png) [@rteconomics](https://forum.dynare.org/u/rteconomics)\
**Post date:** [17 April 2012 13:44 UTC](https://forum.dynare.org/t/residuals/2470/4 "2012-04-17T13:44:25Z")

</div>

Actually,  
It just came to my mind that I am calibrating the steady-state value of h (I think you can’t get it from the equations). Do u think that might be the issue?

---

<div class="post-metadata">

**Author:** ![bkjecn](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@bkjecn](https://forum.dynare.org/u/bkjecn)\
**Post date:** [17 April 2012 14:16 UTC](https://forum.dynare.org/t/residuals/2470/5 "2012-04-17T14:16:22Z")

</div>

Yes, I think that could be the issue. h is an endogenous variable in your model. It’s steady state will be determined by the model equations.
