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!
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.
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?
model.mod (9.51 KB)
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?
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.