Government Transfer Distribution Estimation Functions

Government Transfer Distribution Estimation Functions#

transfer_distribution.py modules

ogusa.transfer_distribution#

ogusa.transfer_distribution.MVKDE(S, J, proportion_matrix, zaxis_label='Received proportion of total transfers', filename=None, plot=False, bandwidth=0.25)[source]#

Generates a Multivariate Kernel Density Estimator and returns a matrix representing a probability distribution according to given age categories, and ability type categories.

Parameters:
  • S (scalar) – the number of age groups in the model

  • J (scalar) – the number of ability type groups in the model.

  • proportion_matrix (Numpy array) – SxJ shaped array that represents the proportions of the total going to each (s,j) combination

  • filename (str) – the file name to save image to

  • plot (bool) – whether or not to save a plot of the probability distribution generated by the kde or the proportion matrix

  • bandwidth (scalar) – used in the smoothing of the kernel. Higher bandwidth creates a smoother kernel.

Returns:

SxJ shaped array that

that represents the smoothed distribution of proportions going to each (s,j)

Return type:

estimator_scaled (Numpy array)

ogusa.transfer_distribution.get_transfer_matrix(J=7, lambdas=array([0.25, 0.25, 0.2, 0.1, 0.1, 0.09, 0.01]), data_path=None, output_path=None)[source]#

Compute SxJ matrix representing the distribution of aggregate government transfers by age and lifetime income group.

Parameters:
  • J (int) – number of lifetime income groups

  • lambdas (Numpy array) – length J array of lifetime income group proportions

  • data_path (str) – path to PSID data

  • output_path (str) – path to save output plots and data

Returns:

SxJ shaped array that represents the

smoothed distribution of proportions going to each (s,j)

Return type:

kde_matrix (Numpy array)