Hi Romero,
Thanks for taking a close look at the example and for the careful comparison with the SSJ toolbox!
The two formulations are actually equivalent. The difference comes down to how each implementation exploits Walras’ Law.
In a general equilibrium model, if all equilibrium conditions but one are satisfied, the remaining one holds automatically. This means you have one degree of freedom in choosing which equations to include explicitly. The Dynare steady-state file and the SSJ toolbox exercise this freedom differently.
In the SSJ toolbox, div = Y - w*N - I - psip appears as an explicit block (see two_asset.py), while B = Bh (i.e., Bh - SUM(b) = 0) is used as a steady-state calibration target (see line 175: targets_ss = {'asset_mkt': 0., 'B': 'Bh'}). So the bond market clearing condition is very much present in the SSJ code , just not as a model equation.
In the Dynare steady-state file, it’s the other way around: Bh - SUM(b) = 0 appears as an explicit model equation, while the dividend/resource constraint is dropped from the model block and instead computed directly in the verbatim block (div = 1 - w - I, which equals Y - w*N - I - psip given the steady-state values Y=1, N=1, psip=0). By Walras’ Law, the resource constraint is automatically satisfied if all other equations hold.
Note that the main simulation file (hank_two_assets.mod) does include the resource constraint explicitly (Y - w * N - I - psip - div) and uses only one aggregate asset market clearing equation (p + Bg - SUM(a) - SUM(b)), without Bh - SUM(b). So the “full” model contains the dividend equation, it is only the steady-state computation that swaps it for the bond market clearing target.
Now, why does replacing Bh-SUM(b) with Y - w * N - I - psip - div fail? The steady-state computation calibrates three free parameters (beta_ss, vphi, chi1) by targeting three equations:
calibration_target_equations=['Wage Phillips curve',
'Liquid asset market clearing',
'Illiquid asset market clearing']
The Bh - SUM(b) = 0 condition (“Liquid asset market clearing”) is what pins down the split between liquid and illiquid asset holdings, which is needed to calibrate chi1 (the portfolio adjustment cost parameter). When you replace this equation with div = Y - w*N - I - psip, the solver loses the information it needs to determine this portfolio split, so it can no longer find a consistent steady state.
Overall, both implementations encode the same economic model. They just choose different (but equivalent, by Walras’ Law) subsets of equations to include explicitly.
I hope I’ve answered your questions.
Best regards,
Normann