Not sure why the Gini for financial wealth and the LTV ratio are NaN.
In those results the Gini is NaN because the Lorenz Curve is NaN. This is because Lorenz Curves are not defined when there are negative values (the lorenz curve graph always starts at (0,0) and ends at (1,1), it cannot start at (0,0) if there are negative values).
There is a “Generalized Lorenz Curve” that can handle negative values (and I assume there is a Generalized Gini Coefficient you can calculate from it).
VFI Toolkit does not presently do Generalized Lorenz Curves, just plain-vanilla Lorenz Curves. Hence all the NaN.
Is there a toolkit function to compute life-cycle statistics by bins of say 5 years? This is what the paper does for the homeownership rate and I had to write my own function.
Yes, you just set simoptions.agegroupings=1:5:N_j
and then use LifeCycleProfiles_FHorz_Case1
. The numbers in simoptions.agegroupings are interpreted as the ‘start’ of each bin (since the above starts at 1, and then goes in steps of 5, it will give age bins of 5 model periods). Note that the default behaviour of just doing conditional on each age is essentially simoptions.agegroupings=1:1:N_j
.
The call to the function LifeCycleProfiles_FHorz_Case1 takes a long amount of time, more than the time needed to run VFI and distribution. This might be an issue if doing estimation/calibration. There are the running times in seconds (distribution is omitted since it’s super fast):
That is likely almost all from the runtimes for Lorenz and Quantiles. As long as the calibration only targets things like mean you can use simoptions.whichstats
to slash the runtimes during the calibration.
I will clean up the Chen codes based on what @aledinola has done sometime later this week. Thanks all for figuring out the income process and those grids!!!
General comment: this model has a perfectly elastic housing supply —you can see this as it is just ‘c+hprime’ in the budget constraint so the relative price of housing is always equal to one (unit of consumption). You could add a house price and limit the supply of housing, this would essentially just be an extra general equilibrium equation (note that currently there is no GE condition for the housing market in the codes).