Page 1 of 1

Residuals

PostPosted: Tue Apr 17, 2012 12:53 pm
by rteconomics
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

Re: Residuals

PostPosted: Tue Apr 17, 2012 1:31 pm
by bkjecn
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.

Re: Residuals

PostPosted: Tue Apr 17, 2012 1:42 pm
by rteconomics
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

Re: Residuals

PostPosted: Tue Apr 17, 2012 1:44 pm
by rteconomics
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?

Re: Residuals

PostPosted: Tue Apr 17, 2012 2:16 pm
by bkjecn
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.