Beispiel #1
0
def test_get_biz_tax():
    # Test function for business tax receipts
    w = np.array([1.2, 1.1])
    Y = np.array([3.0, 7.0])
    L = np.array([2.0, 3.0])
    K = np.array([5.0, 6.0])
    tau_b = 0.20
    delta_tau = 0.06
    biz_tax = tax.get_biz_tax(w, Y, L, K, (tau_b, delta_tau))
    assert np.allclose(biz_tax, np.array([0.06, 0.668]))
Beispiel #2
0
def test_get_biz_tax():
    # Test function for business tax receipts
    p = Specifications()
    new_param_values = {'tau_b': [0.20], 'delta_tau_annual': [0.06]}
    p.update_specifications(new_param_values)
    p.T = 3
    w = np.array([1.2, 1.1, 1.2])
    Y = np.array([3.0, 7.0, 3.0])
    L = np.array([2.0, 3.0, 2.0])
    K = np.array([5.0, 6.0, 5.0])
    biz_tax = tax.get_biz_tax(w, Y, L, K, p, 'TPI')
    assert np.allclose(biz_tax, np.array([0.06, 0.668, 0.06]))
Beispiel #3
0
def test_get_biz_tax():
    # Test function for business tax receipts
    p = Specifications()
    new_param_values = {
        'tau_b': [0.20],
        'delta_tau_annual': [0.06]
    }
    p.update_specifications(new_param_values)
    p.T = 3
    w = np.array([1.2, 1.1, 1.2])
    Y = np.array([3.0, 7.0, 3.0])
    L = np.array([2.0, 3.0, 2.0])
    K = np.array([5.0, 6.0, 5.0])
    biz_tax = tax.get_biz_tax(w, Y, L, K, p, 'TPI')
    assert np.allclose(biz_tax, np.array([0.06, 0.668, 0.06]))
Beispiel #4
0
def revenue(r, w, b, n, bq, c, Y, L, K, factor, theta, etr_params, p, method):
    r'''
    Calculate aggregate tax revenue.

    .. math::
        R_{t} = \sum_{s=E}^{E+S}\sum_{j=0}^{J}\omega_{s,t}\lambda_{j}
        (T_{j,s,t} + \tau^{p}_{t}w_{t}e_{j,s}n_{j,s,t} - \theta_{j}
        w_{t} + \tau^{bq}bq_{j,s,t} + \tau^{c}_{s,t}c_{j,s,t} +
        \tau^{w}_{t}b_{j,s,t}) + \tau^{b}_{t}(Y_{t}-w_{t}L_{t}) -
        \tau^{b}_{t}\delta^{\tau}_{t}K^{\tau}_{t}

    Args:
        r (array_like): the real interest rate
        w (array_like): the real wage rate
        b (Numpy array): household savings
        n (Numpy array): household labor supply
        bq (Numpy array): household bequests received
        c (Numpy array): household consumption
        Y (array_like): aggregate output
        L (array_like): aggregate labor
        K (array_like): aggregate capital
        factor (scalar): scaling factor converting model units to
            dollars
        theta (Numpy array): social security replacement rate for each
            lifetime income group
        etr_params (Numpy array): paramters of the effective tax rate
            functions
        p (OG-USA Specifications object): model parameters
        method (str): adjusts calculation dimensions based on 'SS' or
            'TPI'

    Returns:
        total_tax_revenue (array_like): aggregate tax revenue
        iit_payroll_tax_revenue (array_like): aggregate income and
            payroll tax revenue
        agg_pension_outlays (array_like): aggregate outlays for gov't
            pensions
        bequest_tax_revenue (array_like): aggregate bequest tax revenue
        wealth_tax_revenue (array_like): aggregate wealth tax revenue
        cons_tax_revenue (array_like): aggregate consumption tax revenue
        business_tax_revenue (array_like): aggregate business tax
            revenue
        payroll_tax_revenue (array_like): aggregate payroll tax revenue
        iit_tax_revenue (array_like): aggregate income tax revenue

    '''
    inc_pay_tax_liab = tax.income_tax_liab(r, w, b, n, factor, 0, None, method,
                                           p.e, etr_params, p)
    pension_benefits = tax.pension_amount(w, n, theta, 0, None, False, method,
                                          p.e, p)
    bq_tax_liab = tax.bequest_tax_liab(r, b, bq, 0, None, method, p)
    w_tax_liab = tax.wealth_tax_liab(r, b, 0, None, method, p)
    if method == 'SS':
        pop_weights = np.transpose(p.omega_SS * p.lambdas)
        iit_payroll_tax_revenue = (inc_pay_tax_liab * pop_weights).sum()
        agg_pension_outlays = (pension_benefits * pop_weights).sum()
        wealth_tax_revenue = (w_tax_liab * pop_weights).sum()
        bequest_tax_revenue = (bq_tax_liab * pop_weights).sum()
        cons_tax_revenue = (p.tau_c[-1, :, :] * c * pop_weights).sum()
        payroll_tax_revenue = (p.frac_tax_payroll[-1] *
                               iit_payroll_tax_revenue)
    elif method == 'TPI':
        pop_weights = (np.squeeze(p.lambdas) *
                       np.tile(np.reshape(p.omega[:p.T, :], (p.T, p.S, 1)),
                               (1, 1, p.J)))
        iit_payroll_tax_revenue = (inc_pay_tax_liab *
                                   pop_weights).sum(1).sum(1)
        agg_pension_outlays = (pension_benefits * pop_weights).sum(1).sum(1)
        wealth_tax_revenue = (w_tax_liab * pop_weights).sum(1).sum(1)
        bequest_tax_revenue = (bq_tax_liab * pop_weights).sum(1).sum(1)
        cons_tax_revenue = (p.tau_c[:p.T, :, :] * c *
                            pop_weights).sum(1).sum(1)
        payroll_tax_revenue = (p.frac_tax_payroll[:p.T] *
                               iit_payroll_tax_revenue)
    business_tax_revenue = tax.get_biz_tax(w, Y, L, K, p, method)
    iit_revenue = iit_payroll_tax_revenue - payroll_tax_revenue

    total_tax_revenue = (iit_payroll_tax_revenue + wealth_tax_revenue +
                         bequest_tax_revenue + cons_tax_revenue +
                         business_tax_revenue)

    return (total_tax_revenue, iit_payroll_tax_revenue, agg_pension_outlays,
            bequest_tax_revenue, wealth_tax_revenue, cons_tax_revenue,
            business_tax_revenue, payroll_tax_revenue, iit_revenue)
Beispiel #5
0
def revenue(r, w, b, n, bq, c, Y, L, K, factor, theta, etr_params,
            p, method):
    r'''
    Calculate aggregate tax revenue.

    .. math::
        R_{t} = \sum_{s=E}^{E+S}\sum_{j=0}^{J}\omega_{s,t}\lambda_{j}(T_{j,s,t} + \tau^{p}_{t}w_{t}e_{j,s}n_{j,s,t} - \theta_{j}w_{t} + \tau^{bq}bq_{j,s,t} + \tau^{c}_{s,t}c_{j,s,t} + \tau^{w}_{t}b_{j,s,t}) + \tau^{b}_{t}(Y_{t}-w_{t}L_{t}) - \tau^{b}_{t}\delta^{\tau}_{t}K^{\tau}_{t}

    Args:
        r (array_like): the real interest rate
        w (array_like): the real wage rate
        b (Numpy array): household savings
        n (Numpy array): household labor supply
        bq (Numpy array): household bequests received
        c (Numpy array): household consumption
        Y (array_like): aggregate output
        L (array_like): aggregate labor
        K (array_like): aggregate capital
        factor (scalar): factor (scalar): scaling factor converting
            model units to dollars
        theta (Numpy array): social security replacement rate for each
            lifetime income group
        etr_params (Numpy array): paramters of the effective tax rate
            functions
        p (OG-USA Specifications object): model parameters
        method (str): adjusts calculation dimensions based on 'SS' or
            'TPI'

    Returns:
        REVENUE (array_like): aggregate tax revenue
        T_I (array_like): aggregate income tax revenue
        T_P (array_like): aggregate net payroll tax revenue, revenues
            minus social security benefits paid
        T_BQ (array_like): aggregate bequest tax revenue
        T_W (array_like): aggregate wealth tax revenue
        T_C (array_like): aggregate consumption tax revenue
        business_revenue (array_like): aggregate business tax revenue

    '''
    if method == 'SS':
        I = r * b + w * p.e * n
        T_I = np.zeros_like(I)
        T_I = tax.ETR_income(r, w, b, n, factor, p.e, etr_params, p) * I
        T_P = p.tau_payroll[-1] * w * p.e * n
        T_P[p.retire[-1]:] -= theta * w
        T_W = (tax.ETR_wealth(b, p.h_wealth[-1], p.m_wealth[-1],
                              p.p_wealth[-1]) * b)
        T_BQ = p.tau_bq[-1] * bq
        T_C = p.tau_c[-1, :, :] * c
        business_revenue = tax.get_biz_tax(w, Y, L, K, p, method)
        REVENUE = ((np.transpose(p.omega_SS * p.lambdas) *
                    (T_I + T_P + T_BQ + T_W + T_C)).sum() +
                   business_revenue)
    elif method == 'TPI':
        r_array = utils.to_timepath_shape(r)
        w_array = utils.to_timepath_shape(w)
        I = r_array * b + w_array * n * p.e
        T_I = np.zeros_like(I)
        T_I = tax.ETR_income(r_array, w_array, b, n, factor, p.e,
                             etr_params, p) * I
        T_P = p.tau_payroll[:p.T].reshape(p.T, 1, 1) * w_array * n * p.e
        for t in range(T_P.shape[0]):
            T_P[t, p.retire[t]:, :] -= (theta.reshape(1, p.J) *
                                        p.replacement_rate_adjust[t] *
                                        w_array[t])
        T_W = (tax.ETR_wealth(b, p.h_wealth[:p.T].reshape(p.T, 1, 1),
                              p.m_wealth[:p.T].reshape(p.T, 1, 1),
                              p.p_wealth[:p.T].reshape(p.T, 1, 1)) * b)
        T_BQ = p.tau_bq[:p.T].reshape(p.T, 1, 1) * bq
        T_C = p.tau_c[:p.T, :, :] * c
        business_revenue = tax.get_biz_tax(w, Y, L, K, p, method)
        REVENUE = ((((np.squeeze(p.lambdas)) *
                   np.tile(np.reshape(p.omega[:p.T, :], (p.T, p.S, 1)),
                           (1, 1, p.J)))
                   * (T_I + T_P + T_BQ + T_W + T_C)).sum(1).sum(1) +
                   business_revenue)

    return REVENUE, T_I, T_P, T_BQ, T_W, T_C, business_revenue
Beispiel #6
0
def revenue(r, w, b, n, bq, c, Y, L, K, factor, theta, etr_params, p, method):
    '''
    Gives lump sum transfer value.
    Inputs:
        r           = [T,] vector, interest rate
        w           = [T,] vector, wage rate
        b           = [T,S,J] array, wealth holdings
        n           = [T,S,J] array, labor supply
        BQ          = [T,J] array, bequest amounts
        factor      = scalar, model income scaling factor
        params      = length 12 tuple, (e, lambdas, omega, method, etr_params,
                                        theta, tau_bq, tau_payroll, h_wealth,
                                        p_wealth, m_wealth, retire, T, S, J)
        e           = [T,S,J] array, effective labor units
        lambdas     = [J,] vector, population weights by lifetime income group
        omega       = [T,S] array, population weights by age
        method      = string, 'SS' or 'TPI'
        etr_params  = [T,S,J] array, effective tax rate function parameters
        tax_func_types = string, type of tax function used
        theta       = [J,] vector, replacement rate values by lifetime
                      income group
        tau_bq      = scalar, bequest tax rate
        h_wealth    = scalar, wealth tax function parameter
        p_wealth    = scalar, wealth tax function parameter
        m_wealth    = scalar, wealth tax function parameter
        tau_payroll = scalar, payroll tax rate
        retire      = integer, retirement age
        T           = integer, number of periods in transition path
        S           = integer, number of age groups
        J           = integer, number of lifetime income groups
    Functions called:
        ETR_income
        ETR_wealth
    Objects in function:
        I    = [T,S,J] array, total income
        T_I  = [T,S,J] array, total income taxes
        T_P  = [T,S,J] array, total payroll taxes
        T_W  = [T,S,J] array, total wealth taxes
        T_BQ = [T,S,J] array, total bequest taxes
        T_H  = [T,] vector, lump sum transfer amount(s)
    Returns: T_H

    '''
    if method == 'SS':
        I = r * b + w * p.e * n
        T_I = np.zeros_like(I)
        T_I = tax.ETR_income(r, w, b, n, factor, p.e, etr_params, p) * I
        T_P = p.tau_payroll[-1] * w * p.e * n
        T_P[p.retire[-1]:] -= theta * w
        T_W = (
            tax.ETR_wealth(b, p.h_wealth[-1], p.m_wealth[-1], p.p_wealth[-1]) *
            b)
        T_BQ = p.tau_bq[-1] * bq
        T_C = p.tau_c[-1, :, :] * c
        business_revenue = tax.get_biz_tax(w, Y, L, K, p, method)
        REVENUE = ((np.transpose(p.omega_SS * p.lambdas) *
                    (T_I + T_P + T_BQ + T_W + T_C)).sum() + business_revenue)
    elif method == 'TPI':
        r_array = utils.to_timepath_shape(r, p)
        w_array = utils.to_timepath_shape(w, p)
        I = r_array * b + w_array * n * p.e
        T_I = np.zeros_like(I)
        T_I = tax.ETR_income(r_array, w_array, b, n, factor, p.e, etr_params,
                             p) * I
        T_P = p.tau_payroll[:p.T].reshape(p.T, 1, 1) * w_array * n * p.e
        for t in range(T_P.shape[0]):
            T_P[t,
                p.retire[t]:, :] -= (theta.reshape(1, p.J) *
                                     p.replacement_rate_adjust[t] * w_array[t])
        T_W = (tax.ETR_wealth(
            b, p.h_wealth[:p.T].reshape(p.T, 1, 1), p.m_wealth[:p.T].reshape(
                p.T, 1, 1), p.p_wealth[:p.T].reshape(p.T, 1, 1)) * b)
        T_BQ = p.tau_bq[:p.T].reshape(p.T, 1, 1) * bq
        T_C = p.tau_c[:p.T, :, :] * c
        business_revenue = tax.get_biz_tax(w, Y, L, K, p, method)
        REVENUE = ((((np.squeeze(p.lambdas)) *
                     np.tile(np.reshape(p.omega[:p.T, :], (p.T, p.S, 1)),
                             (1, 1, p.J))) *
                    (T_I + T_P + T_BQ + T_W + T_C)).sum(1).sum(1) +
                   business_revenue)

    return REVENUE, T_I, T_P, T_BQ, T_W, T_C, business_revenue
Beispiel #7
0
def revenue(r, w, b, n, bq, c, Y, L, K, factor, theta, etr_params,
            p, method):
    '''
    Gives lump sum transfer value.
    Inputs:
        r           = [T,] vector, interest rate
        w           = [T,] vector, wage rate
        b           = [T,S,J] array, wealth holdings
        n           = [T,S,J] array, labor supply
        BQ          = [T,J] array, bequest amounts
        factor      = scalar, model income scaling factor
        params      = length 12 tuple, (e, lambdas, omega, method, etr_params,
                                        theta, tau_bq, tau_payroll, h_wealth,
                                        p_wealth, m_wealth, retire, T, S, J)
        e           = [T,S,J] array, effective labor units
        lambdas     = [J,] vector, population weights by lifetime income group
        omega       = [T,S] array, population weights by age
        method      = string, 'SS' or 'TPI'
        etr_params  = [T,S,J] array, effective tax rate function parameters
        tax_func_types = string, type of tax function used
        theta       = [J,] vector, replacement rate values by lifetime
                      income group
        tau_bq      = scalar, bequest tax rate
        h_wealth    = scalar, wealth tax function parameter
        p_wealth    = scalar, wealth tax function parameter
        m_wealth    = scalar, wealth tax function parameter
        tau_payroll = scalar, payroll tax rate
        retire      = integer, retirement age
        T           = integer, number of periods in transition path
        S           = integer, number of age groups
        J           = integer, number of lifetime income groups
    Functions called:
        ETR_income
        ETR_wealth
    Objects in function:
        I    = [T,S,J] array, total income
        T_I  = [T,S,J] array, total income taxes
        T_P  = [T,S,J] array, total payroll taxes
        T_W  = [T,S,J] array, total wealth taxes
        T_BQ = [T,S,J] array, total bequest taxes
        T_H  = [T,] vector, lump sum transfer amount(s)
    Returns: T_H

    '''
    if method == 'SS':
        I = r * b + w * p.e * n
        T_I = np.zeros_like(I)
        T_I = tax.ETR_income(r, w, b, n, factor, p.e, etr_params, p) * I
        T_P = p.tau_payroll[-1] * w * p.e * n
        T_P[p.retire[-1]:] -= theta * w
        T_W = (tax.ETR_wealth(b, p.h_wealth[-1], p.m_wealth[-1],
                              p.p_wealth[-1]) * b)
        T_BQ = p.tau_bq[-1] * bq
        T_C = p.tau_c[-1, :, :] * c
        business_revenue = tax.get_biz_tax(w, Y, L, K, p, method)
        REVENUE = ((np.transpose(p.omega_SS * p.lambdas) *
                    (T_I + T_P + T_BQ + T_W + T_C)).sum() +
                   business_revenue)
    elif method == 'TPI':
        r_array = utils.to_timepath_shape(r, p)
        w_array = utils.to_timepath_shape(w, p)
        I = r_array * b + w_array * n * p.e
        T_I = np.zeros_like(I)
        T_I = tax.ETR_income(r_array, w_array, b, n, factor, p.e,
                             etr_params, p) * I
        T_P = p.tau_payroll[:p.T].reshape(p.T, 1, 1) * w_array * n * p.e
        for t in range(T_P.shape[0]):
            T_P[t, p.retire[t]:, :] -= (theta.reshape(1, p.J) *
                                        p.replacement_rate_adjust[t] *
                                        w_array[t])
        T_W = (tax.ETR_wealth(b, p.h_wealth[:p.T].reshape(p.T, 1, 1),
                              p.m_wealth[:p.T].reshape(p.T, 1, 1),
                              p.p_wealth[:p.T].reshape(p.T, 1, 1)) * b)
        T_BQ = p.tau_bq[:p.T].reshape(p.T, 1, 1) * bq
        T_C = p.tau_c[:p.T, :, :] * c
        business_revenue = tax.get_biz_tax(w, Y, L, K, p, method)
        REVENUE = ((((np.squeeze(p.lambdas)) *
                   np.tile(np.reshape(p.omega[:p.T, :], (p.T, p.S, 1)),
                           (1, 1, p.J)))
                   * (T_I + T_P + T_BQ + T_W + T_C)).sum(1).sum(1) +
                   business_revenue)

    return REVENUE, T_I, T_P, T_BQ, T_W, T_C, business_revenue