Income Process Functions#
income.py modules
ogusa.income#
percentiles, as it uses fitted polynomials to those percentiles.#
- ogusa.income.arc_error(abc_vals, params)[source]#
This function returns a vector of errors in the three criteria on which the arctan function is fit to predict extrapolated ability in ages 81 to 100.:
1) The arctan function value at age 80 must match the estimated original function value at age 80. 2) The arctan function slope at age 80 must match the estimated original function slope at age 80. 3) The level of ability at age 100 must be a given fraction (abil_deprec) below the ability level at age 80.
- Parameters:
abc_vals (tuple) –
contains (a,b,c)
a (scalar): scale parameter for arctan function
b (scalar): curvature parameter for arctan function
c (scalar): shift parameter for arctan function
params (tuple) –
contains (first_point, coef1, coef2, coef3, abil_deprec)
first_point (scalar): ability level at age 80, > 0
- coef1 (scalar): coefficient in log ability equation on
linear term in age
- coef2 (scalar): coefficient in log ability equation on
quadratic term in age
- coef3 (scalar): coefficient in log ability equation on
cubic term in age
- abil_deprec (scalar): ability depreciation rate between
ages 80 and 100, in (0, 1).
- Returns:
errors ([error1, error2, error3])
- error1 (scalar): error between ability level at age 80
from original function minus the predicted ability at age 80 from the arctan function given a, b, and c
- error2 (scalar): error between the slope of the original
function at age 80 minus the slope of the arctan function at age 80 given a, b, and c
- error3 (scalar): error between the ability level at age
100 predicted by the original model value times abil_deprec minus the ability predicted by the arctan function at age 100 given a, b, and c
- Return type:
error_vec (Numpy array)
- ogusa.income.arctan_deriv_func(xvals, a, b, c)[source]#
This function generates predicted derivatives of arctan function given data (xvals) and parameters a, b, and c. The functional form of the derivative of the function is the following:
\[y = - (a * b) / (\pi * (1 + (b * xvals + c)^2))\]- Parameters:
xvals (Numpy array) – data inputs to arctan derivative function
a (scalar) – scale parameter for arctan function
b (scalar) – curvature parameter for arctan function
c (scalar) – shift parameter for arctan function
- Returns:
- predicted values (output) of arctan
derivative function
- Return type:
yvals (Numpy array)
- ogusa.income.arctan_fit(first_point, coef1, coef2, coef3, abil_deprec, init_guesses)[source]#
This function fits an arctan function to the last 20 years of the ability levels of a particular ability group to extrapolate abilities by trying to match the slope in the 80th year and the ability depreciation rate between years 80 and 100.
- Parameters:
first_point (scalar) – ability level at age 80, > 0
coef1 (scalar) – coefficient in log ability equation on linear term in age
coef2 (scalar) – coefficient in log ability equation on quadratic term in age
coef3 (scalar) – coefficient in log ability equation on cubic term in age
abil_deprec (scalar) – ability depreciation rate between ages 80 and 100, in (0, 1)
init_guesses (Numpy array) – initial guesses
- Returns:
- extrapolated ability levels for ages
81 to 100, length 20
- Return type:
abil_last (Numpy array)
- ogusa.income.arctan_func(xvals, a, b, c)[source]#
This function generates predicted ability levels given data (xvals) and parameters a, b, and c, from the following arctan function:
\[y = (-a / \pi) * \arctan(b * x + c) + (a / 2)\]- Parameters:
xvals (Numpy array) – data inputs to arctan function
a (scalar) – scale parameter for arctan function
b (scalar) – curvature parameter for arctan function
c (scalar) – shift parameter for arctan function
- Returns:
- predicted values (output) of arctan
function
- Return type:
yvals (Numpy array)
- ogusa.income.get_e_interp(S, age_wgts, age_wgts_80, abil_wgts, plot_path=None)[source]#
This function takes a source matrix of lifetime earnings profiles (abilities, emat) of size (80, 7), where 80 is the number of ages and 7 is the number of ability types in the source matrix, and interpolates new values of a new S x J sized matrix of abilities using linear interpolation. [NOTE: For this application, cubic spline interpolation introduces too much curvature.]
This function also includes the two cases in which J = 9 and J = 10 that include higher lifetime earning percentiles calibrated using Piketty and Saez (2003).
- Parameters:
S (int) – number of ages to interpolate. This method assumes that ages are evenly spaced between the beginning of the 21st year and the end of the 100th year, >= 3
age_wgts (Numpy array) – distribution of population in each age for the interpolated ages, length S
age_wgts_80 (Numpy array) – percent of population in each one-year age from 21 to 100, length 80
abil_wgts (Numpy array) – distribution of population in each ability group, length J
plot_path (str) – Path to save plots of emat_orig and the new interpolated emat_new
- Returns:
- interpolated ability matrix scaled
so that population-weighted average is 1, size SxJ
- Return type:
emat_new_scaled (Numpy array)
- ogusa.income.get_e_orig(age_wgts, abil_wgts, plot_path=None)[source]#
This function generates the 80 x 7 matrix of lifetime earnings ability profiles, corresponding to annual ages from 21 to 100 and to paths based on income percentiles 0-25, 25-50, 50-70, 70-80, 80-90, 90-99, 99-100. The ergodic population distribution is an input in order to rescale the paths so that the weighted average equals 1.
The data come from the following file:
data/ability/FR_wage_profile_tables.xlsx
The polynomials are of the form
\[\ln(abil) = \alpha + \beta_{1}\text{age} + \beta_{2}\text{age}^2 + \beta_{3}\text{age}^3\]Values come from regression analysis using IRS CWHS with hours imputed from the CPS.
- Parameters:
age_wgts (Numpy array) – ergodic age distribution, length S
abil_wgts (Numpy array) – population weights in each lifetime earnings group, length J
plot_path (str) – path to save 3D plots of ability paths
- Returns:
- = lifetime ability profiles scaled
so that population-weighted average is 1, size SxJ
- Return type:
e_orig_scaled (Numpy array)