# Aggregates Equations#

aggregates.py modules

## ogcore.aggregates#

### Functions to compute economic aggregates.#

ogcore.aggregates.get_B(b, p, method, preTP)[source]#

Calculate aggregate savings

$B_{t} = \sum_{s=E}^{E+S}\sum_{j=0}^{J}\omega_{s,t}\lambda_{j}b_{j,s,t}$
Parameters:
• b (Numpy array) – savings of households

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

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

• preTP (bool) – whether calculation is for the pre-time path period amount of savings. If True, then need to use omega_S_preTP.

Returns:

aggregate supply of savings

Return type:

B (array_like)

ogcore.aggregates.get_BQ(r, b_splus1, j, p, method, preTP)[source]#

Calculation of aggregate bequests. If use_zeta is False, then computes aggregate bequests within each lifetime income group.

$BQ_{t} = \sum_{s=E}^{E+S}\sum_{j=0}^{J}\rho_{s}\omega_{s,t} \lambda_{j}b_{j,s+1,1}$
Parameters:
• r (array_like) – the real interest rate

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

• j (int) – index of lifetime income group

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

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

• preTP (bool) – whether calculation is for the pre-time path period amount of savings. If True, then need to use omega_S_preTP.

Returns:

aggregate bequests, overall or by lifetime

income group, depending on use_zeta value.

Return type:

BQ (array_like)

ogcore.aggregates.get_C(c, p, method)[source]#

Calculation of aggregate consumption.

Set up to only take one consumption good at a time. This function is called in a loop to get consumption for all goods.

$C_{t} = \sum_{s=E}^{E+S}\sum_{j=0}^{J}\omega_{s,t} \lambda_{j}c_{j,s,t}$
Parameters:
• c (Numpy array) – consumption of households

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

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

Returns:

aggregate consumption

Return type:

C (array_like)

ogcore.aggregates.get_I(b_splus1, K_p1, K, p, method)[source]#

Calculate aggregate investment.

$I_{t} = (1 + g_{n,t+1})e^{g_{y}}(K_{t+1} - \sum_{s=E}^{E+S} \sum_{j=0}^{J}\omega_{s+1,t}i_{s+1,t}\lambda_{j}b_{j,s+1,t+1} \ (1+ g_{n,t+1})) - (1 - \delta)K_{t}$
Parameters:
• b_splus1 (Numpy array) – savings of households

• K_p1 (array_like) – aggregate capital, one period ahead

• K (array_like) – aggregate capital

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

• method (str) – adjusts calculation dimensions based on ‘SS’ or ‘TPI’, also compute total investment (not net of immigrants)

Returns:

aggregate investment

Return type:

aggI (array_like)

ogcore.aggregates.get_K_splits(B, K_demand_open, D_d, zeta_K)[source]#

Returns total domestic capital as well as amounts of domestic capital held by domestic and foreign investors separately.

$\begin{split}\begin{split} \hat{K}_{t} &= \hat{K}^{f}_{t} + \hat{K}^{d}_{t}\\ \hat{K}^{d}_{t} &= \hat{B}_{t} + \hat{D}^{d}_{t}\\ \hat{K}^{f}_{t} &= \zeta_{D}\left(\hat{K}^{open}_{t} - K^{d}_{t}\right) \end{split}\end{split}$
Parameters:
• B (array_like) – aggregate savings by domestic households

• K_demand_open (array_like) – capital demand at the world interest rate

• D_d (array_like) – governmet debt held by domestic households

• zeta_K (array_like) – fraction of excess capital demand satisfied by foreign investors

Returns:

series of capital stocks:

• K (array_like): total capital

• K_d (array_like): capital held by domestic households

• K_f (array_like): capital held by foreign households

Return type:

(tuple)

ogcore.aggregates.get_L(n, p, method)[source]#

Calculate aggregate labor supply.

$L_{t} = \sum_{s=E}^{E+S}\sum_{j=0}^{J}\omega_{s,t}\lambda_{j}n_{j,s,t}$
Parameters:
• n (Numpy array) – labor supply of households

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

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

Returns:

aggregate labor supply

Return type:

L (array_like)

ogcore.aggregates.get_ptilde(p_i, tau_c, alpha_c, method='SS')[source]#

Calculate price of composite good.

$\tilde{p}_{t} = \prod_{i=1}^{I} \left(\frac{(1 + \tau^{c}_{i,t})p_{i,j}}{\alpha_{i,j}}\right)^{\alpha_{i,j}}$
Parameters:
• p_i (array_like) – prices for consumption good i

• tau_c (array_like) – consumption taxes on good i

• alpha_c (array_like) – consumption share parameters

Returns:

tax-inclusive price of composite good

Return type:

p_tilde (array_like)

ogcore.aggregates.get_r_p(r, r_gov, p_m, K_vec, K_g, D, MPKg_vec, p, method)[source]#

Compute the interest rate on the household’s portfolio of assets, a mix of government debt and private equity.

$r_{p,t} = \frac{r_{gov,t}D_{t} + r_{K,t}K_{t}}{D_{t} + K_{t}}$
Parameters:
• r (array_like) – the real interest rate

• r_gov (array_like) – the real interest rate on government debt

• p_m (array_like) – good prices

• K_vec (array_like) – aggregate capital demand from each industry

• K_g (array_like) – aggregate public capital

• D (array_like) – aggregate government debt

• MPKg_vec (array_like) – marginal product of government capital for each industry

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

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

Returns:

the real interest rate on the household portfolio

Return type:

r_p (array_like)

ogcore.aggregates.resource_constraint(Y, C, G, I_d, I_g, net_capital_flows)[source]#

Compute the error in the resource constraint.

$\text{rc_error} = \hat{Y}_t - \hat{C}_t - \Bigl(e^{g_y}\bigl[1 + \tilde{g}_{n,t+1}\bigr]\hat{K}^d_{t+1} - \hat{K}^d_t\Bigr) - \delta\hat{K}_t - \hat{G}_t - \hat{I}_{g,t} - \text{net capital outflows}_t$
Parameters:
• Y (array_like) – aggregate output by industry

• C (array_like) – aggregate consumption by industry

• G (array_like) – aggregate government spending by industry

• I_d (array_like) – aggregate private investment from domestic households

• I_g (array_like) – investment in government capital

• net_capital_flows (array_like) – net capital outflows

Returns:

error in the resource constraint

Return type:

rc_error (array_like)

ogcore.aggregates.revenue(r, w, b, n, bq, c, Y, L, K, p_m, factor, ubi, theta, etr_params, e, p, m, method)[source]#

Calculate aggregate tax revenue.

$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}) + \sum_{m=1}^{M}\tau^{b}_{m,t}(Y_{m,t}-w_{t}L_{m,t}) - \tau^{b}_{m,t}\delta^{\tau}_{m,t}K^{\tau}_{m,t}$
Parameters:
• 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

• p_m (array_like) – output prices

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

• ubi (array_like) – universal basic income household distributions

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

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

• e (Numpy array) – effective labor units

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

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

Returns:

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

UBI_outlays (array_like): aggregate universal basic income (UBI)

outlays

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

Return type:

total_tax_revenue (array_like)