Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/book/content/api/aggregates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ ogcore.aggregates
------------------------------------------

.. automodule:: ogcore.aggregates
<<<<<<< HEAD
:members: get_io_prices, get_L, get_I, get_B, get_BQ, get_RM, get_C,
revenue, get_r_p, resource_constraint, get_capital_outflows,
=======
:members: get_L, get_I, get_B, get_BQ, get_RM, get_C, revenue,
get_payroll_tax_revenue, get_r_p, resource_constraint, get_capital_outflows,
>>>>>>> upstream/master
get_K_splits, get_ptilde
4 changes: 4 additions & 0 deletions docs/book/content/api/firm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ ogcore.firm

.. automodule:: ogcore.firm
:members: get_Y, get_r, get_w, get_KLratio_KLonly, get_KLratio, get_MPx,
<<<<<<< HEAD
get_w_from_r, get_K_KLonly, get_L_from_Y, get_K, get_cost_of_capital,
=======
get_w_from_r, get_K_KLonly, get_K, get_L_from_Y, get_cost_of_capital,
>>>>>>> upstream/master
get_pm, get_KY_ratio, solve_L, adj_cost
2 changes: 1 addition & 1 deletion docs/book/content/api/output_tables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Output Table Functions
=================================================

**output_tabls.py modules*
**output_tables.py modules**

ogcore.output_tables
------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions docs/book/content/api/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@ ogcore.utils
pickle_file_compare, comp_array, comp_scalar, dict_compare,
to_timepath_shape, get_initial_path, safe_read_pickle, rate_conversion,
save_return_table, print_progress, fetch_files_from_web, not_connected,
<<<<<<< HEAD
avg_by_bin, extrapolate_array, extrapolate_nested_list,
get_legacy_session, shift_bio_clock, unstationarize_vars,
params_to_json, json_to_dict
=======
avg_by_bin, extrapolate_array, extrapolate_nested_list, get_legacy_session,
shift_bio_clock, unstationarize_vars, params_to_json, json_to_dict
>>>>>>> upstream/master
5 changes: 4 additions & 1 deletion docs/book/content/intro/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ _Out-of-Range Action:_ error


#### `io_matrix`
_Description:_ Input-output matrix used to map production outputs into consumption goods using a fixed coefficient model. This matrix has dimensions I x M, where I is the number of distinct consumption goods and M is the number of distinct production goods. The sum each row of this matrix must be 1.
_Description:_ Input-output matrix used to map production outputs into consumption and government goods using a fixed coefficient model. This matrix has dimensions (I + 2) x M. The first I rows map consumption goods, row I maps government consumption, and row I + 1 maps infrastructure investment. The sum of each row must be 1.
_Value Type:_ float
_Valid Range:_ min = 0.0 and max = 1.0
_Out-of-Range Action:_ error
Expand Down Expand Up @@ -933,6 +933,8 @@ _Valid Range:_ min = 0.0 and max = 100.0
_Out-of-Range Action:_ error


<<<<<<< HEAD
=======
#### `TPI_stall_window`
_Description:_ Number of trailing TPI outer-loop iterations over which the best distance must improve on the best from before the window. When it does not, the loop has stalled (cycling or diverging) and a diagnosis is logged; see TPI_stall_action for whether the loop also stops. A value of 0 disables stall detection.
_Value Type:_ int
Expand All @@ -946,6 +948,7 @@ _Value Type:_ str
_Valid Choices:_['warn', 'stop']


>>>>>>> upstream/master
#### `SS_root_method`
_Description:_ Root finding algorithm for outer loop of the SS solution.
_Notes:_ Uses scipy.optimize.root, please see scipy documentation for description of methods. Note that some methods may require more arguments than are in the function calls in SS.py and TPI.py and will therefore break without modifications of the source code.
Expand Down
12 changes: 12 additions & 0 deletions docs/book/content/intro/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,18 @@ _TPI dimensions:_ TxI
_SS dimensions:_ I


#### `p_g`
_Description:_ Price of the government consumption composite good
_TPI dimensions:_ T
_SS dimensions:_ scalar


#### `p_Ig`
_Description:_ Price of the infrastructure investment composite good
_TPI dimensions:_ T
_SS dimensions:_ scalar


#### `p_tilde`
_Description:_ Price of composite output good
_TPI dimensions:_ T
Expand Down
81 changes: 52 additions & 29 deletions docs/book/content/theory/equilibrium.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/book/content/theory/firms.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The production side of the `OG-Core` model is populated by $M$ industries indexe
Y_{m,t} = Z_{m,t} (K_{m,t})^{\gamma_m} (K_{g,m,t})^{\gamma_{g,m}}(e^{g_y t}L_{m,t})^{1-\gamma_m-\gamma_{g,m}} \quad\forall m,t \quad\text{for}\quad \varepsilon_m=1
```

Industry $M$ in the model is unique in two respects. First, we will define industry $M$ goods as the numeraire in OG_Core. Therefore, all quantities are in terms of industry $M$ goods and all prices are relative to the price of a unit of industry $M$ goods. Second, the model solution is greatly simplified if just one production industry produces capital goods. The assumption in OG-Core is that industry $M$ is the only industry producing capital goods (though industry $M$ goods can also be used for consumption).
Industry $M$ in the model is unique in two respects. First, we define industry $M$ goods as the numeraire in OG-Core. Therefore, all prices are relative to the price of a unit of industry $M$ goods. Second, industry $M$ is the only industry producing private capital goods. Household consumption goods, government consumption goods, and infrastructure investment goods may each combine output from all $M$ industries through the input-output matrix.

(EqFirmsFOC)=
## Optimality Conditions
Expand Down
4 changes: 2 additions & 2 deletions docs/book/content/theory/government.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,10 +619,10 @@ Note that the budget closure rule (described in Section ref{`SecUnbalGBCcloseRul

```{math}
:label: EqUnbalGBCbudgConstr
D_{t+1} + Rev_t + FA_t = (1 + r_{gov,t})D_t + G_t + I_{g,t} + Pensions_t + TR_t + UBI_t \quad\forall t
D_{t+1} + Rev_t + FA_t = (1 + r_{gov,t})D_t + p_{g,t}G_t + p_{I_g,t}I_{g,t} + Pensions_t + TR_t + UBI_t \quad\forall t
```

where $r_{gov,t}$ is the interest rate paid by the government defined in equation {eq}`EqUnbalGBC_rate_wedge` below, $G_{t}$ is government spending on public goods, $I_{g,t}$ is total government spending on infrastructure investment, $TR_{t}$ are non-pension government transfers, and $UBI_t$ is the total UBI transfer outlays across households in time $t$. All variables in {eq}`EqUnbalGBCbudgConstr` are real variables denominated in units of current-period output in industry $M$ the numeraire ($p_{M,t}=1$ for all $t$).
where $G_t$ and $I_{g,t}$ are quantities of composite government consumption and infrastructure goods. Their prices are determined by the final two rows of the input-output matrix, $p_{g,t}=\sum_m\pi_{I+1,m}p_{m,t}$ and $p_{I_g,t}=\sum_m\pi_{I+2,m}p_{m,t}$. Other fiscal flows are denominated in units of industry $M$, the numeraire ($p_{M,t}=1$).

We assume that government spending on public goods in terms of the numeraire good is a fixed fraction of GDP each period in the initial periods.

Expand Down
2 changes: 1 addition & 1 deletion docs/book/content/theory/households.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ In this section, we describe what is arguably the most important economic agent
\tilde{p}_{t} = \prod_{i=1}^I\left(\frac{[1 + \tau^{c}_{i,t}]\tilde{p}_{i,t}}{\alpha_i}\right)^{\alpha_i} \quad\forall t
```

Consumption goods are determined from production goods through a fixed $I\times M$ coefficient matrix, $\Pi^I$. Each element, $\pi_{i,m}$, of $\Pi^I$ represents the fraction of good $i$ that is made up of output from industry $m$. It follows that the prices of consumption goods can be expressed as a function of the prices of production goods and the fixed coefficient matrix $\Pi^I$.
Household consumption goods, government consumption, and infrastructure investment are determined from production goods through a fixed $(I+2)\times M$ input-output matrix, $\Pi$. The first $I$ rows map output from the $M$ industries into the $I$ household consumption goods. For $1\leq i\leq I$, each element $\pi_{i,m}$ is the share of consumption good $i$ produced by industry $m$. Row $I+1$ contains the industry shares used to produce the government consumption good, and row $I+2$ contains the industry shares used to produce the infrastructure investment good. The elements in each row sum to one. It follows that the prices of household consumption goods can be expressed as functions of production-good prices and the first $I$ rows of $\Pi$.
```{math}
:label: EqHH_pi
\tilde{p}_{i,t} = \sum_{m=1}^M \pi_{i,m}\tilde{p}_{m,t} \quad\forall i,t
Expand Down
8 changes: 4 additions & 4 deletions docs/book/content/theory/market_clearing.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@
C_{i,t} \equiv \sum_{s=E+1}^{E+S}\sum_{j=1}^{J}\omega_{s,t}\lambda_j c_{i,j,s,t} \quad\forall i,t
```

Because we make a simplifying assumption that only the $M$th industry output can be used as investment, government spending, or government debt, consumption demand equals total output of good $m$ in the first $M-1$ industries.
Government consumption and infrastructure investment are also fixed-coefficient composites. Let $\pi_{I+1,m}$ and $\pi_{I+2,m}$ be the shares of industry $m$ used in one unit of those goods. Because private capital goods and net international financial flows remain assigned to industry $M$, the first $M-1$ goods-market conditions are
```{math}
:label: EqMarkClrGoods_Mm1
Y_{m,t} = C_{m,t} \quad\forall t \quad\text{and}\quad m=1,2,...M-1
Y_{m,t} = C_{m,t} + \pi_{I+1,m}G_t + \pi_{I+2,m}I_{g,t} \quad\forall t \quad\text{and}\quad m=1,2,...M-1
```

The output of the $M$th industry can be used for private investment, infrastructure investment, government spending, and government debt.[^M_ind] As such, the market clearing condition in the $M$th industry will look more like the traditional $Y=C+I+G+NX$ expression.[^RCrates_note]
Industry $M$ additionally produces all private capital goods and absorbs the modeled net international financial flows.[^M_ind]

```{math}
:label: EqMarkClrGoods_M
Y_{M,t} = C_{M,t} + I_{M,t} + I_{g,t} + G_t + r_{p,t} K^f_t + r_{p,t}D^f_t - (K^f_{t+1} - K^f_t) - \bigl(D^f_{t+1} - D^f_t\bigr) - RM_t \quad\forall t
Y_{M,t} = C_{M,t} + \pi_{I+1,M}G_t + \pi_{I+2,M}I_{g,t} + I_{M,t} + r_{p,t} K^f_t + r_{p,t}D^f_t - (K^f_{t+1} - K^f_t) - \bigl(D^f_{t+1} - D^f_t\bigr) - RM_t \quad\forall t
```
where
```{math}
Expand Down
2 changes: 1 addition & 1 deletion docs/book/content/theory/stationarization.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ The usual definition of equilibrium would be allocations and prices such that ho

```{math}
:label: EqStnrzGovBC
e^{g_y}\left(1 + \tilde{g}_{n,t+1}\right)\hat{D}_{t+1} + \hat{Rev}_t + \hat{FA}_t = (1 + r_{gov,t})\hat{D}_t + \hat{G}_t + \hat{I}_{g,t} + \hat{Pensions}_t + \hat{TR}_t + \hat{UBI}_t \quad\forall t
e^{g_y}\left(1 + \tilde{g}_{n,t+1}\right)\hat{D}_{t+1} + \hat{Rev}_t + \hat{FA}_t = (1 + r_{gov,t})\hat{D}_t + p_{g,t}\hat{G}_t + p_{I_g,t}\hat{I}_{g,t} + \hat{Pensions}_t + \hat{TR}_t + \hat{UBI}_t \quad\forall t
```

The stationarized versions of the rule for total government infrastructure investment spending $I_{g,t}$ in {eq}`EqUnbalGBC_Igt` and the rule for government investment spending in each industry in {eq}`EqUnbalGBC_Igt` are found by dividing both sides of the respective equations by $e^{g_y t}\tilde{N}_t$.
Expand Down
4 changes: 3 additions & 1 deletion examples/multi_industry_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def main():
"debt_ratio_ss": 1.5,
"alpha_T": alpha_T.tolist(),
"alpha_G": alpha_G.tolist(),
"io_matrix": np.eye(3).tolist(),
"io_matrix": np.vstack(
[np.eye(3), np.array([[0.0, 0.0, 1.0]] * 2)]
).tolist(),
"tau_c": [[0]],
}

Expand Down
Loading