Household Functions#

household.py modules

ogcore.household#

Household functions.#

ogcore.household.FOC_labor(r, w, p_tilde, b, b_splus1, n, bq, factor, tr, ubi, theta, chi_n, etr_params, mtrx_params, t, j, p, method)[source]#

Computes errors for the FOC for labor supply in the steady state. This function is usually looped through over J, so it does one lifetime income group at a time.

\[w_t e_{j,s}\bigl(1 - \tau^{mtrx}_{s,t}\bigr) \frac{(c_{j,s,t})^{-\sigma}}{ \tilde{p}_{t}} = \chi^n_{s} \biggl(\frac{b}{\tilde{l}}\biggr)\biggl(\frac{n_{j,s,t}} {\tilde{l}}\biggr)^{\upsilon-1}\Biggl[1 - \biggl(\frac{n_{j,s,t}}{\tilde{l}}\biggr)^\upsilon\Biggr] ^{\frac{1-\upsilon}{\upsilon}}\]
Parameters:
  • r (array_like) – the real interest rate

  • w (array_like) – the real wage rate

  • p_tilde (array_like) – composite good price

  • b (Numpy array) – household savings

  • b_splus1 (Numpy array) – household savings one period ahead

  • n (Numpy array) – household labor supply

  • bq (Numpy array) – household bequests received

  • factor (scalar) – scaling factor converting model units to dollars

  • tr (Numpy array) – government transfers to household

  • ubi (Numpy array) – universal basic income payment

  • theta (Numpy array) – social security replacement rate for each lifetime income group

  • chi_n (Numpy array) – utility weight on the disutility of labor supply

  • e (Numpy array) – effective labor units

  • etr_params (list) – parameters of the effective tax rate functions

  • mtrx_params (list) – parameters of the marginal tax rate on labor income functions

  • t (int) – model period

  • j (int) – index of ability type

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns:

error from FOC for labor supply

Return type:

FOC_error (Numpy array)

ogcore.household.FOC_savings(r, w, p_tilde, b, b_splus1, n, bq, factor, tr, ubi, theta, rho, etr_params, mtry_params, t, j, p, method)[source]#

Computes Euler errors for the FOC for savings in the steady state. This function is usually looped through over J, so it does one lifetime income group at a time.

\[\frac{c_{j,s,t}^{-\sigma}}{\tilde{p}_{t}} = e^{-\sigma g_y} \biggl[\chi^b_j\rho_s(b_{j,s+1,t+1})^{-\sigma} + \beta_j\bigl(1 - \rho_s\bigr)\Bigl(\frac{1 + r_{t+1} \bigl[1 - \tau^{mtry}_{s+1,t+1}\bigr]}{\tilde{p}_{t+1}}\Bigr) (c_{j,s+1,t+1})^{-\sigma}\biggr]\]
Parameters:
  • r (array_like) – the real interest rate

  • w (array_like) – the real wage rate

  • p_tilde (array_like) – composite good price

  • b (Numpy array) – household savings

  • b_splus1 (Numpy array) – household savings one period ahead

  • b_splus2 (Numpy array) – household savings two periods ahead

  • n (Numpy array) – household labor supply

  • bq (Numpy array) – household bequests received

  • factor (scalar) – scaling factor converting model units to dollars

  • tr (Numpy array) – government transfers to household

  • ubi (Numpy array) – universal basic income payment

  • theta (Numpy array) – social security replacement rate for each lifetime income group

  • rho (Numpy array) – mortality rates

  • etr_params (list) – parameters of the effective tax rate functions

  • mtry_params (list) – parameters of the marginal tax rate on capital income functions

  • t (int) – model period

  • j (int) – index of ability type

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns:

Euler error from FOC for savings

Return type:

euler (Numpy array)

ogcore.household.constraint_checker_SS(bssmat, nssmat, cssmat, ltilde)[source]#

Checks constraints on consumption, savings, and labor supply in the steady state.

Parameters:
  • bssmat (Numpy array) – steady state distribution of capital

  • nssmat (Numpy array) – steady state distribution of labor

  • cssmat (Numpy array) – steady state distribution of consumption

  • ltilde (scalar) – upper bound of household labor supply

Returns:

None

Raises:

Warnings – if constraints are violated, warnings printed

ogcore.household.constraint_checker_TPI(b_dist, n_dist, c_dist, t, ltilde)[source]#

Checks constraints on consumption, savings, and labor supply along the transition path. Does this for each period t separately.

Parameters:
  • b_dist (Numpy array) – distribution of capital at time t

  • n_dist (Numpy array) – distribution of labor at time t

  • c_dist (Numpy array) – distribution of consumption at time t

  • t (int) – time period

  • ltilde (scalar) – upper bound of household labor supply

Returns:

None

Raises:

Warnings – if constraints are violated, warnings printed

ogcore.household.get_bq(BQ, j, p, method)[source]#

Calculate bequests to each household.

\[bq_{j,s,t} = \zeta_{j,s}\frac{BQ_{t}}{\lambda_{j}\omega_{s,t}}\]
Parameters:
  • BQ (array_like) – aggregate bequests

  • j (int) – index of lifetime ability group

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns:

bequests received by each household

Return type:

bq (array_like)

ogcore.household.get_cons(r, w, p_tilde, b, b_splus1, n, bq, net_tax, e, p)[source]#

Calculate household consumption.

\[c_{j,s,t} = \frac{(1 + r_{t})b_{j,s,t} + w_t e_{j,s} n_{j,s,t} + bq_{j,s,t} + tr_{j,s,t} - T_{j,s,t} - e^{g_y}b_{j,s+1,t+1}}{1 - \tau^{c}_{s,t}}\]
Parameters:
  • r (array_like) – the real interest rate

  • w (array_like) – the real wage rate

  • p_tilde (array_like) – the ratio of real GDP to nominal GDP

  • b (Numpy array) – household savings

  • b_splus1 (Numpy array) – household savings one period ahead

  • n (Numpy array) – household labor supply

  • bq (Numpy array) – household bequests received

  • net_tax (Numpy array) – household net taxes paid

  • e (Numpy array) – effective labor units

  • p (OG-Core Specifications object) – model parameters

Returns:

household consumption

Return type:

cons (Numpy array)

ogcore.household.get_tr(TR, j, p, method)[source]#

Calculate transfers to each household.

\[tr_{j,s,t} = \zeta_{j,s}\frac{TR_{t}}{\lambda_{j}\omega_{s,t}}\]
Parameters:
  • TR (array_like) – aggregate transfers

  • j (int) – index of lifetime ability group

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

Returns:

transfers received by each household

Return type:

tr (array_like)

ogcore.household.get_y(r_p, w, b_s, n, p, method)[source]#

Compute household income before taxes.

\[y_{j,s,t} = r_{p,t}b_{j,s,t} + w_{t}e_{j,s}n_{j,s,t}\]
Parameters:
  • r_p (array_like) – real interest rate on the household portfolio

  • w (array_like) – real wage rate

  • b_s (Numpy array) – household savings coming into the period

  • n (Numpy array) – household labor supply

  • p (OG-Core Specifications object) – model parameters

  • method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’

ogcore.household.marg_ut_cons(c, sigma)[source]#

Compute the marginal utility of consumption.

\[MU_{c} = c^{-\sigma}\]
Parameters:
  • c (array_like) – household consumption

  • sigma (scalar) – coefficient of relative risk aversion

Returns:

marginal utility of consumption

Return type:

output (array_like)

ogcore.household.marg_ut_labor(n, chi_n, p)[source]#

Compute the marginal disutility of labor.

\[MDU_{l} = \chi^n_{s}\biggl(\frac{b}{\tilde{l}}\biggr) \biggl(\frac{n_{j,s,t}}{\tilde{l}}\biggr)^{\upsilon-1} \Biggl[1-\biggl(\frac{n_{j,s,t}}{\tilde{l}}\biggr)^\upsilon \Biggr]^{\frac{1-\upsilon}{\upsilon}}\]
Parameters:
  • n (array_like) – household labor supply

  • chi_n (array_like) – utility weights on disutility of labor

  • p (OG-Core Specifications object) – model parameters

Returns:

marginal disutility of labor supply

Return type:

output (array_like)