Closed rickecon closed 8 years ago
I was originally trying to use some bivariate kernel density estimation code to do this. But that approach is better when the data need to be smoothed. This original data in the first plot above is already smooth. So a simple interpolator works best.
By the way, the second picture above uses the "...method='linear'" option. The "cubic" option, for cubic spline, gives too many curves. See the following graph. The linear interpolation method above is clearly better.
@jdebacker , @kerkphil : I now have this working for calculating the steady-state with S=20 and J=1. It does not converge in the steady-state for anything lower than S=20. Now I just need to make sure that TPI works.
I am currently working on making the income.py module robust to general ages and ability types S and J. The module currently only works with S=80 and J=7. Because the resulting 80 x 7 ability matrix is smooth, we can simply use scipy.interpolate.griddata() to interpolate this.
I currently have a function written that takes general S and J midpoints of income distribution bins to interpolate ability matrix values. The following 3D plot is the original 80 x 7 ability matrix.
A version that I interpolated using the above described griddata() function with S=20 and ability distribution midpoints of np.linspace(0.15, 0.95, 10) gives the following interpolated plot.
This looks right. I now need to incorporate this function into income.py and into parameters.py, which calls the get_e function from income.py. @jdebacker