Household Functions#
household.py modules
ogcore.household#
Household functions.#
- ogcore.household.FOC_labor(r, w, p_tilde, b, b_splus1, n, bq, rm, 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
rm (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, rm, 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
rm (Numpy array) – household remittances 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.
\[\hat{bq}_{j,s,t} = \zeta_{j,s} \frac{\hat{BQ}_{t}}{\lambda_{j}\hat{\omega}_{s,t}} \quad\forall j,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_ci(c_s, p_i, p_tilde, tau_c, alpha_c, method='SS')[source]#
Compute consumption of good i given amount of composite consumption and prices.
\[c_{i,j,s,t} = \frac{c_{s,j,t}}{\alpha_{i,j}p_{i,j}}\]- Parameters:
c_s (array_like) – composite consumption
p_i (array_like) – prices for consumption good i
p_tilde (array_like) – composite good price
tau_c (array_like) – consumption tax rate
alpha_c (array_like) – consumption share parameters
method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’
- Returns:
consumption of good i
- Return type:
c_si (array_like)
- ogcore.household.get_cons(r_p, w, p_tilde, b, b_splus1, n, bq, rm, net_tax, e, p)[source]#
Calculate household composite consumption.
\[\begin{split}\hat{c}_{j,s,t} &= \biggl[(1 + r_{p,t})\hat{b}_{j,s,t} + \hat{w}_t e_{j,s}n_{j,s,t} + \hat{bq}_{j,s,t} + \hat{rm}_{j,s,t} + \hat{tr}_{j,s,t} + \hat{ubi}_{j,s,t} + \hat{pension}_{j,s,t} - \hat{tax}_{j,s,t} \\ &\qquad - \sum_{i=1}^I\left(1 + \tau^c_{i,t}\right)p_{i,t}\hat{c}_{min,i} - e^{g_y}\hat{b}_{j,s+1,t+1}\biggr] / p_t \\ &\qquad\qquad\forall j,t \quad\text{and}\quad E+1\leq s\leq E+S \quad\text{where}\quad \hat{b}_{j,E+1,t}=0\end{split}\]- Parameters:
r_p (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
rm (Numpy array) – household remittances 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_rm(RM, j, p, method)[source]#
Calculate remittances to each household.
\[\hat{rm}_{j,s,t} = \eta_{RM,j,s,t} \frac{\hat{RM}_{t}}{\lambda_{j}\hat{\omega}_{s,t}} \quad\forall j,s,t\]- Parameters:
RM (array_like) – aggregate remittances
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:
remittances received by household
- Return type:
rm (array_like)
- ogcore.household.get_tr(TR, j, p, method)[source]#
Calculate transfers to each household.
\[\hat{tr}_{j,s,t} = \zeta_{j,s} \frac{\hat{TR}_{t}}{\lambda_{j}\hat{\omega}_{s,t}} \quad\forall j,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 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)